PhysicsJoint Class Reference

Joint. More...

List of all members.

Public Member Functions

 PhysicsJoint (PhysicsBody body1, PhysicsBody body2, Vector2 anchor, uint index1, uint index2)
 PhysicsJoint Constructor.
void CopyJoint (PhysicsJoint jnt)
 Copy all members of joint.

Public Attributes

uint totalIndex
 totalIndex of joint
Vector2 localAnchor1 = new Vector2(0, 0)
 relative position to anchor point from bodyA
Vector2 localAnchor2 = new Vector2(0, 0)
 relative position to anchor point from bodyB
Vector2 axis1Lim = new Vector2(1, 0)
 one axis of the joint
Vector2 axis2Lim = new Vector2(0, 1)
 the other axis of the joint
float angleLim = 1.0f
 rotation of the joint
float friction = 0.001f
 friction of the joint
float axis1Lower = 0.0f
 distance lower limitation for linear motion
float axis1Upper = 0.0f
 distance upper limitation for linear motion
float axis2Lower = 0.0f
 distance lower limitation for linear motion
float axis2Upper = 0.0f
 distance upper limitation for linear motion
float angleLower = 0.0f
 angular lower limitation for angular motion
float angleUpper = 0.0f
 angular upper limitation for angular motion
float impulseRotMotor = 0.0f
 external impulse for angular motion
Vector2 impulseLinearMotor = new Vector2(0, 0)
 external impulse for linear motion

Properties

uint TotalIndex [get, set]
 setter and getter of totalIndex
Vector2 LocalAnchor1 [get, set]
 setter and getter of localAnchor1
Vector2 LocalAnchor2 [get, set]
 setter and getter of LocalAnchor2
Vector2 Axis1Lim [get, set]
 setter and getter of axis1Lim
Vector2 Axis2Lim [get, set]
 setter and getter of axis2Lim
float AngleLim [get, set]
 setter and getter of angleLim
float Friction [get, set]
 setter and getter of friction
float Axis1Lower [get, set]
 setter and getter of axis1Lower
float Axis1Upper [get, set]
 setter and getter of axis1Upper
float Axis2Lower [get, set]
 setter and getter of axis2Lower
float Axis2Upper [get, set]
 setter and getter of axis2Upper
float AngleLower [get, set]
 setter and getter of angleLower
float AngleUpper [get, set]
 setter and getter of angleUpper
Vector2 ImpulseLinearMotor [get, set]
 setter and getter of linear impulse of joint
float ImpulseRotMotor [get, set]
 setter and getter of rotational impulse of joint
Vector2 ImpulseLinear [get]
 getter of linear impulse of joint
float ImpulseRot [get]
 getter of rotational impulse of joint

Detailed Description

Joint.


Constructor & Destructor Documentation

PhysicsJoint ( PhysicsBody  body1,
PhysicsBody  body2,
Vector2  anchor,
uint  index1,
uint  index2 
)

PhysicsJoint Constructor.

Parameters:
body1one of rigid body for joint
body2the other of rigid body for joint
anchoranchor point of joint
index1index of body1
index2index of body2

Member Function Documentation

void CopyJoint ( PhysicsJoint  jnt)

Copy all members of joint.

Parameters:
jntjoint

Member Data Documentation

float angleLim = 1.0f

rotation of the joint

angleLim [0.0f - 1.0f]
lock of angle angleLim=1.0f
free of angle angleLim=0.0f
When you set the value which does not belong to [0.0f - 1.0f], it will be truncated

Vector2 axis1Lim = new Vector2(1, 0)

one axis of the joint

axis1 direction and axis2 direction should be orthonormal to each other
axis1Lim = new Vector2(1, 0) means that it lock the x-direction movement
when it is normalized, it means for joint to lock the direction completely

Vector2 axis2Lim = new Vector2(0, 1)

the other axis of the joint

axis2 direction and axis2 direction should be orthonormal to each other
axis2Lim = new Vector2(0, 1) means that it lock the y-direction movement
when it is normalized, it means for joint to the direction completely

float friction = 0.001f

friction of the joint

friction is necessary to stop joint rotation finally, ball joint will continue to rotate if this value is not set properly /remarks>