createConstraint( obj1_PhysicsID,
obj2_PhysicsID,
constraintType,
pivotPos_X, pivotPos_Y, pivotPos_Z,
pivotAxis_X,
pivotAxis_Y, pivotAxix_Z,
Flag
)
6DOF
( 6 Degrees Of Freedom) set limits on the pivot's x,y and z position
and the rotation of the pivot's x-axis, y-axis and z-axis.
Method
Parameters:
obj1_PhysicsID:
The physics ID
of object 1
obj2_PhysicsID:
The physics ID
of object 2
Type:
integer
constraintType:
Type:
integer
pivotPos_X:
pivotPos_Y:
Type:
float
pivotPos_Z:
Type: float
pivotAxis_X:
pivotAxis_Y:
Type:
float
pivotAxis_Z:
Flag:
Type:
integer
128 = disable collision between obj1 and obj2
Note:
Pivot
Position (pivotPos_X, pivotPos_Y, pivotPos_Z) is the distance
of the pivot from the object center of obj1.
Note:
Pivot
Axis (pivotAxis_X, pivotAxis_Y, pivotAxis_Z) is the euler
angle
of the pivot axis to the axis of the object center of obj1.
Additional
Parameters:
Pivot
Max/Min Position:
Allows you to set
a min and max amount the pivot point can move from it's
original position.
setParam(type, min, max)
type:
integer
0 = pivot
position X
1 = pivot position Y
2 = pivot position Z
min: float
max: float
Pivot
Angle Rotation:
Allows you to set a
min and max amount the angle can pivot.
Min and Max values:
uses Radians (?)
In other words, 0.52
= approximately 30 degrees
setParam(type, min, max)
type:
integer
3 =
pivot angle X
4 = pivot angle Y
5 = pivot angle Z
min:
float
max: float
Force --
Translational Motor:
Use with Pivot
Max/Min Position. (If the Pivot Point is locked in place, it
can't move.)
Allows you to set a target velocity for the Pivot Point and the maximum
force to apply to achieve it.
setParam(type, vel, maxForce)
type:
integer
6 =
pivot X axis
7 = pivot Y axis
8 = pivot Z axis
vel:
linear velocity
Type:
float
Range: -10,000.00 to 10,000.00
maxForce:
Type:
float
Range: -10,000.00 to 10,000.00
Force --
Rotational Motor:
Allows you to set a
target angular velocity for the Pivot Point and the maximum force to
apply to achieve it.
setParam(type, angVel,
maxForce)
type:
integer
9 = pivot X axis
10 = pivot Y axis
11 = pivot Z axis
angVel:
angular velocity
Type:
float
Range: -10,000.00 to 10,000.00
maxForce:
Type:
float
Range: -10,000.00 to 10,000.00
Springs -- Linear
Use with Pivot
Max/Min Position. (If the Pivot Point is locked in place, it
can't move.)
Allows you to create a linear spring.
setParam(type, stiffness,
reset)
type:
integer
12 =
pivot X axis
13 = pivot Y axis
14 = pivot Z axis
stiffness:
Type:
float
reset:
Type:
integer
1 = return to original position
0 = don't return to original position
Springs -- Angular
Allows you to create
a angular spring.
setParam(type, stiffness,
reset)
type:
integer
15 =
pivot X axis
16 = pivot Y axis
17 = pivot Z axis
stiffness:
Type:
float
reset:
Type:
integer
1 = return to original position
0 = don't return to original position