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

A fixed joint fuses the two bodies together at a reference point. More...

#include <Joint2D.h>

Inherits Joint2D.

Static Public Member Functions

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

Additional Inherited Members

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.

Detailed Description

A fixed joint fuses the two bodies together at a reference point.

Fixed joints are useful for creating complex shapes that can be broken apart later.

Member Function Documentation

◆ create()

FixedJoint2D * create ( Rigidbody2D * connectedBody)
static

Create a fixed joint.

Parameters
anchrIt's the pivot position.
Returns
A object pointer.

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