
setParam(axis, min, max)
- movement on the x, y and z axis.
- Object 2 moves. But uses Object 1 axis to move on.
- Type: integer
- 0 = x axis
- 1 = y axis
- 2 = z axis
- 3 = x axis rotation
- 4 = y axis rotation
- 5 = z axis rotation
- minimum distance (0.0 is Object 2 object center)
- Type: float
max:
- maximum distance (0.0 is Object 2 object center)
- Type: float
setParam(axis, speed, acceleration)
- Linear/Rotational Motor
- Object 2 moves. But uses Object 1 axis to move on
- Type: integer
- 6 = x axis linear
- 7 = y axis linear
- 8 = z axis linear
- 9 = x axis rotation
- 10 = y axis rotation
- 11 = z axis rotation
- movement speed
- Type: float
- acceleration
- Type: float
setParam(axis, stiffness, elasticity)
- Linear/Rotational Spring
- Object 2 moves. But uses Object 1 axis to move on.
- Type: integer
- 12 = x axis
- 13 = y axis
- 14 = z axis
- 15 = x axis rotation
- 16 = y axis rotation
- 17 = z axis rotation
- stiffness of the spring.
- Type: float
- Tendency of the spring to return to its original shape.
- Type: float

Sample Code
################ create an angular spring
# import bge
import bge
# get current scene
scene = bge.logic.getCurrentScene()
# get object list
objList = scene.objects
# get object named Cube_Green
obj1 = objList["Cube_Green"]
# get object named Cube_Red
obj2 = objList["Cube_Red"]
# want to use a 6DOF constraint
constraintType = 12
# get obj1 physics ID
obj1_ID = obj1.getPhysicsId()
# get obj2 physics ID
obj2_ID = obj2.getPhysicsId()
# Use the object center of obj1 for pivot point
pivotPos_X = 0.0
pivotPos_Y = 0.0
pivotPos_Z = 0.0
# create a 6DOF constraint
cube_6DOF = bge.constraints.createConstraint( obj1_ID, obj2_ID,
constraintType,
pivotPos_X, pivotPos_Y, pivotPos_Z)
pivotPos_X, pivotPos_Y, pivotPos_Z)
# set rotation around pivot x and y axis to zero
cube_6DOF.setParam(3, 0.0, 0.0)
cube_6DOF.setParam(4, 0.0, 0.0)
# create an angular spring around the pivot z axis
# stiffness of 50.0 Elasticity of 0.01
cube_6DOF.setParam(17, 50.0, .01)