The base class for all types of physics joints. The class itself does not set up the joint itself, but makes it possible to add to the physics world and set properties of one.
More...
#include <VPhysicsJoints.h>
|
typedef VBase | VSUPERCLASS |
| Used to call parent class functions when they are overrided in class.
|
|
|
enum | VPhysicsJointType {
PIN,
SLIDE,
PIVOT,
GROOVE,
DAMPED,
DAMPEDROTARY,
ROTARYLIMIT,
RATCHET,
GEAR,
SIMPLEMOTOR,
NUMJOINTTYPES
} |
| The types of Physics joints that can be set.
|
|
|
static const wchar_t * | VString (const char *fmt,...) |
|
static void | VLog (const char *fmt,...) |
|
static void | VLogError (const char *fmt,...) |
|
static void | VClearLog () |
|
bool | active = true |
| Base can be updated using Update if true.
|
|
bool | visible = true |
| Base can be rendered using Draw if true.
|
|
bool | alive = true |
| Helper member that is mainly used filter out behaviours to objects which aren't alive in the scene.
|
|
bool | exists = true |
| Base can be updated and rendered if true, else it would no longer be treated as being part of the scene.
|
|
VType | type = NONE |
| Base object type, typically set in the constructor of an inherited object to specify what type it is.
|
|
uint32_t | RefCount = 0 |
| Counts the amount of times the object is referenced in groups, ensures an object is only destroyed when no longer part of a single group.
|
|
The base class for all types of physics joints. The class itself does not set up the joint itself, but makes it possible to add to the physics world and set properties of one.
◆ VPhysicsJointBase()
- Parameters
-
BodyA | The first physics body to apply the joint to. |
BodyB | The second physics body to apply the joint to. |
◆ Deinitialise()
Deinitises and removes the physics joint from the world.
- Parameters
-
space | The physics space to remove the joint from. |
◆ DoesCollideBodies()
bool VPhysicsJointBase::DoesCollideBodies |
( |
| ) |
|
- Returns
- When two bodies collide, Chipmunk ignores the collisions if this property is set to false on any constraint that connects the two bodies. Defaults to true. This can be used to create a chain that self collides, but adjacent links in the chain do not collide.
◆ GetBodyA()
- Returns
- The first body in the joint.
◆ GetBodyB()
- Returns
- The second body in the joint.
◆ GetConstraint()
- Returns
- The constraint that makes up the joint.
◆ GetErrorBias()
float VPhysicsJointBase::GetErrorBias |
( |
| ) |
|
- Returns
- The percentage of joint error that remains unfixed after a second. This works exactly the same as the collision bias property of a space, but applies to fixing error (stretching) of joints instead of overlapping collisions.
◆ GetImpulse()
float VPhysicsJointBase::GetImpulse |
( |
| ) |
|
- Returns
- The most recent impluse that has been applied. Divide by the timestep to get the force.
◆ GetMaxBias()
float VPhysicsJointBase::GetMaxBias |
( |
| ) |
|
- Returns
- The maximum speed at which the constraint can apply error correction. Defaults to INFINITY.
◆ GetMaxForce()
float VPhysicsJointBase::GetMaxForce |
( |
| ) |
|
- Returns
- The maximum force that the constraint can use to act on the two bodies. Defaults to INFINITY.
◆ Initialise()
Initialises the physics joint.
- Parameters
-
space | The physics space to initialise the joint to. |
◆ SetCollideBodies()
void VPhysicsJointBase::SetCollideBodies |
( |
bool |
value | ) |
|
- Parameters
-
value | When two bodies collide, Chipmunk ignores the collisions if this property is set to false on any constraint that connects the two bodies. Defaults to true. This can be used to create a chain that self collides, but adjacent links in the chain do not collide. |
◆ SetErrorBias()
void VPhysicsJointBase::SetErrorBias |
( |
float |
Bias | ) |
|
- Parameters
-
Bias | The percentage of joint error that remains unfixed after a second. This works exactly the same as the collision bias property of a space, but applies to fixing error (stretching) of joints instead of overlapping collisions. |
◆ SetMaxBias()
void VPhysicsJointBase::SetMaxBias |
( |
float |
Bias | ) |
|
- Parameters
-
Bias | The maximum speed at which the constraint can apply error correction. Defaults to INFINITY. |
◆ SetMaxForce()
void VPhysicsJointBase::SetMaxForce |
( |
float |
Max | ) |
|
- Parameters
-
Max | The maximum force that the constraint can use to act on the two bodies. Defaults to INFINITY. |
The documentation for this class was generated from the following file: