This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/doc/python_api/rst/bge.constraints.rst

7.7 KiB
Raw Blame History

Physics Constraints (bge.constraints)

Warning

include not available in preview: ../examples/bge.constraints.py

bge.constraints.createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag]]]])

Creates a constraint.

Parameters:
  • physicsid (int) the physics id of the first object in constraint

  • physicsid2 (int) the physics id of the second object in constraint

  • constrainttype the type of the constraint. The constraint types are:

Parameters:
  • pivotX (float) pivot X position

  • pivotY (float) pivot Y position

  • pivotZ (float) pivot Z position

  • axisX (float) X axis

  • axisY (float) Y axis

  • axisZ (float) Z axis

  • flag (int)

bge.constraints.error

Simbolic constant string that indicates error.

bge.constraints.exportBulletFile(filename)

export a .bullet file

Parameters:

filename (string) File name

bge.constraints.getAppliedImpulse(constraintId)
Parameters:

constraintId (int) The id of the constraint.

Returns:

the most recent applied impulse.

Return type:

float

bge.constraints.getVehicleConstraint(constraintId)
Parameters:

constraintId (int) The id of the vehicle constraint.

Returns:

a vehicle constraint object.

Return type:

bge.types.KX_VehicleWrapper

bge.constraints.removeConstraint(constraintId)

Removes a constraint.

Parameters:

constraintId (int) The id of the constraint to be removed.

bge.constraints.setCcdMode(ccdMode)

Note

Very experimental, not recommended

Sets the CCD (Continous Colision Detection) mode in the Physics Environment.

Parameters:

ccdMode (int) The new CCD mode.

bge.constraints.setContactBreakingTreshold(breakingTreshold)

Note

Reasonable default is 0.02 (if units are meters)

Sets tresholds to do with contact point management.

Parameters:

breakingTreshold (float) The new contact breaking treshold.

bge.constraints.setDeactivationAngularTreshold(angularTreshold)

Sets the angular velocity treshold.

Parameters:

angularTreshold (float) New deactivation angular treshold.

bge.constraints.setDeactivationLinearTreshold(linearTreshold)

Sets the linear velocity treshold.

Parameters:

linearTreshold (float) New deactivation linear treshold.

bge.constraints.setDeactivationTime(time)

Sets the time after which a resting rigidbody gets deactived.

Parameters:

time (float) The deactivation time.

bge.constraints.setDebugMode(mode)

Sets the debug mode.

Debug modes:
Parameters:

mode (int) The new debug mode.

bge.constraints.setGravity(x, y, z)

Sets the gravity force.

Parameters:
  • x (float) Gravity X force.

  • y (float) Gravity Y force.

  • z (float) Gravity Z force.

bge.constraints.setLinearAirDamping(damping)

Note

Not implemented.

Sets the linear air damping for rigidbodies.

bge.constraints.setNumIterations(numiter)

Sets the number of iterations for an iterative constraint solver.

Parameters:

numiter (int) New number of iterations.

bge.constraints.setNumTimeSubSteps(numsubstep)

Sets the number of substeps for each physics proceed. Tradeoff quality for performance.

Parameters:

numsubstep (int) New number of substeps.

bge.constraints.setSolverDamping(damping)

Note

Very experimental, not recommended

Sets the damper constant of a penalty based solver.

Parameters:

damping (float) New damping for the solver.

bge.constraints.setSolverTau(tau)

Note

Very experimental, not recommended

Sets the spring constant of a penalty based solver.

Parameters:

tau (float) New tau for the solver.

bge.constraints.setSolverType(solverType)

Note

Very experimental, not recommended

Sets the solver type.

Parameters:

solverType (int) The new type of the solver.

bge.constraints.setSorConstant(sor)

Note

Very experimental, not recommended

Sets the successive overrelaxation constant.

Parameters:

sor (float) New sor value.

bge.constraints.setUseEpa(epa)

Not implemented.

bge.constraints.DBG_NODEBUG

Note

Debug mode to be used with function setDebugMode

No debug.

bge.constraints.DBG_DRAWWIREFRAME

Note

Debug mode to be used with function setDebugMode

Draw wireframe in debug.

bge.constraints.DBG_DRAWAABB

Note

Debug mode to be used with function setDebugMode

Draw Axis Aligned Bounding Box in debug.

bge.constraints.DBG_DRAWFREATURESTEXT

Note

Debug mode to be used with function setDebugMode

Draw freatures text in debug.

bge.constraints.DBG_DRAWCONTACTPOINTS

Note

Debug mode to be used with function setDebugMode

Draw contact points in debug.

bge.constraints.DBG_NOHELPTEXT

Note

Debug mode to be used with function setDebugMode

Debug without help text.

bge.constraints.DBG_DRAWTEXT

Note

Debug mode to be used with function setDebugMode

Draw text in debug.

bge.constraints.DBG_PROFILETIMINGS

Note

Debug mode to be used with function setDebugMode

Draw profile timings in debug.

bge.constraints.DBG_ENABLESATCOMPARISION

Note

Debug mode to be used with function setDebugMode

Enable sat comparision in debug.

bge.constraints.DBG_DISABLEBULLETLCP

Note

Debug mode to be used with function setDebugMode

Disable Bullet LCP.

bge.constraints.DBG_ENABLECCD

Note

Debug mode to be used with function setDebugMode

Enable Continous Colision Detection in debug.

bge.constraints.DBG_DRAWCONSTRAINTS

Note

Debug mode to be used with function setDebugMode

Draw constraints in debug.

bge.constraints.DBG_DRAWCONSTRAINTLIMITS

Note

Debug mode to be used with function setDebugMode

Draw constraint limits in debug.

bge.constraints.DBG_FASTWIREFRAME

Note

Debug mode to be used with function setDebugMode

Draw a fast wireframe in debug.

bge.constraints.POINTTOPOINT_CONSTRAINT

Note

Constraint type to be used with function createConstraint

bge.constraints.LINEHINGE_CONSTRAINT

Note

Constraint type to be used with function createConstraint

bge.constraints.ANGULAR_CONSTRAINT

Note

Constraint type to be used with function createConstraint

bge.constraints.CONETWIST_CONSTRAINT

Note

Constraint type to be used with function createConstraint

bge.constraints.VEHICLE_CONSTRAINT

Note

Constraint type to be used with function createConstraint