Axmol 3.0.0-89d6d9a
Loading...
Searching...
No Matches
DistanceJoint2D Class Reference

Set the fixed distance with two bodies. More...

#include <Joint2D.h>

Inherits Joint2D.

Public Member Functions

float getLength () const
 Get the rest length of a distance joint.
void setLength (float distance)
 Set the rest length of a distance joint.
float getDamping () const
 Get spring damping.
void setDamping (float damping)
 Set spring damping, distance limits requires damping not zero.
Public Member Functions inherited from Joint2D
bool isAttached () const
 Check if this joint is currently attached to the physics world.
PhysicsWorld2D * getWorld () const
 Get the physics world that owns this joint.
Rigidbody2D * getAttachedBody () const
 Get the primary body (body A) attached to this joint.
void setConnectedBody (Rigidbody2D *body)
 Set the secondary body (body B) connected to this joint.
Rigidbody2D * getConnectedBody () const
 Get the secondary body (body B) connected to this joint.
AnchorSpace getAnchorSpace () const
 Get the current anchor space mode.
void setAnchorSpace (AnchorSpace space)
 Set the anchor space mode.
void setAnchorsInWorldSpace (const Vec2 &anchor)
 Set both attached and connected anchors in world coordinates.
Vec2 getAnchor () const
 Get the anchor point of the attached body.
void setAnchors (const Vec2 &anchor, const Vec2 &connectedAnchor)
 Set both anchors in the current coordinate space.
void setAnchor (const Vec2 &anchor)
 Set the anchor point of the attached body in the current coordinate space.
Vec2 getConnectedAnchor () const
 Get the anchor point of the connected body.
void setConnectedAnchor (const Vec2 &anchor)
 Set the anchor point of the connected body in the current coordinate space.
bool isCollisionEnabled () const
 Check if collision between the two bodies is enabled.
void setCollisionEnabled (bool enable)
 Enable or disable collision between the two bodies connected by this joint.
void setAutoConfigureConnectedAnchor (bool val)
 Enable or disable automatic configuration of the connected anchor.
bool isAutoConfigureConnectedAnchor () const
 Check if automatic configuration of the connected anchor is enabled.
void setDrawScale (float scale)
 Set the debug draw scale for this joint.
int getTag () const
 Get this joint's tag.
void setTag (int tag)
 Set this joint's tag.

Static Public Member Functions

static DistanceJoint2D * create (Rigidbody2D *connectedBody)
 Create a fixed distance joint.

Detailed Description

Set the fixed distance with two bodies.

Member Function Documentation

◆ create()

DistanceJoint2D * create ( Rigidbody2D * connectedBody)
static

Create a fixed distance joint.

Returns
A object pointer.

The documentation for this class was generated from the following file:
  • Joint2D.h