KX_ConstraintWrapper(EXP_PyObjectPlus)

base class — EXP_PyObjectPlus

class bge.types.KX_ConstraintWrapper

KX_ConstraintWrapper

getConstraintId(val)

Returns the constraint ID

Returns:

the constraint ID

Return type:

integer

setParam(axis, value0, value1)

Set the constraint limits

Parameters:

axis (integer) –

Note

  • Lowerlimit == Upperlimit -> axis is locked

  • Lowerlimit > Upperlimit -> axis is free

  • Lowerlimit < Upperlimit -> axis it limited in that range

For PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3:

axis = 3 is a constraint limit, with low/high limit value
  • 3: X axis angle

Parameters:
  • (min) (value0) – Set the minimum limit of the axis

  • (max) (value1) – Set the maximum limit of the axis

For PHY_CONE_TWIST_CONSTRAINT = 4:

axis = 3..5 are constraint limits, high limit values
  • 3: X axis angle

  • 4: Y axis angle

  • 5: Z axis angle

Parameters:
  • (min) (value0) – Set the minimum limit of the axis

  • (max) (value1) – Set the maximum limit of the axis

For PHY_GENERIC_6DOF_CONSTRAINT = 12:

axis = 0..2 are constraint limits, with low/high limit value
  • 0: X axis position

  • 1: Y axis position

  • 2: Z axis position

axis = 3..5 are relative constraint (Euler) angles in radians
  • 3: X axis angle

  • 4: Y axis angle

  • 5: Z axis angle

Parameters:
  • (min) (value0) – Set the minimum limit of the axis

  • (max) (value1) – Set the maximum limit of the axis

axis = 6..8 are translational motors, with value0=target velocity, value1 = max motor force
  • 6: X axis position

  • 7: Y axis position

  • 8: Z axis position

axis = 9..11 are rotational motors, with value0=target velocity, value1 = max motor force
  • 9: X axis angle

  • 10: Y axis angle

  • 11: Z axis angle

Parameters:
  • (speed) (value0) – Set the linear velocity of the axis

  • (force) (value1) – Set the maximum force limit of the axis

axis = 12..14 are for linear springs on each of the position of freedom
  • 12: X axis position

  • 13: Y axis position

  • 14: Z axis position

axis = 15..17 are for angular springs on each of the angle of freedom in radians
  • 15: X axis angle

  • 16: Y axis angle

  • 17: Z axis angle

Parameters:
  • (stiffness) (value0) – Set the stiffness of the spring

  • (damping) (value1) – Tendency of the spring to return to it’s original position

getParam(axis)

Get the constraint position or euler angle of a generic 6DOF constraint

Parameters:

axis (integer) –

axis = 0..2 are linear constraint values
  • 0: X axis position

  • 1: Y axis position

  • 2: Z axis position

Returns:

position

Return type:

float

axis = 3..5 are relative constraint (Euler) angles in radians
  • 3: X axis angle

  • 4: Y axis angle

  • 5: Z axis angle

Returns:

angle

Return type:

float

constraint_id

Returns the constraint ID (read only)

Type:

integer

constraint_type

Returns the constraint type (read only)

Type:

integer

breakingThreshold

The impulse threshold breaking the constraint, if the constraint is broken enabled is set to False.

Type:

float greater or equal to 0

enabled

The status of the constraint. Set to True to restore a constraint after breaking.

Type:

boolean