Game Engine bge.constraints Module

Note

This documentation is still very weak, and needs some help!

createConstraint([obj1[, obj2[, restLength[, restitution[, damping]]]]])

Creates a constraint.

Parameters:
  • obj1 (:class:’bge.types.KX_GameObject’ #I think, there is no error when I use one) – first object on Constraint
  • obj2 (:class:’bge.types.KX_GameObject’ #too) – second object on Constraint
  • restLength (float) – #to be filled
  • restitution (float) – #to be filled
  • damping (float) – #to be filled
error

Simbolic constant string that indicates error.

exportBulletFile(filename)

export a .bullet file

Parameters:filename (string) – File name
getAppliedImpulse(constraintId)
Parameters:constraintId (int) – The id of the constraint.
Returns:the most recent applied impulse.
Return type:float
getVehicleConstraint(constraintId)
Parameters:constraintId (int) – The id of the vehicle constraint.
Returns:a vehicle constraint object.
Return type::class:’KX_VehicleWrapper’
removeConstraint(constraintId)

Removes a constraint.

Parameters:constraintId (int) – The id of the constraint to be removed.
setCcdMode(ccdMode)
..note::
Very experimental, not recommended

Sets the CCD mode in the Physics Environment.

Parameters:ccdMode (int) – The new CCD mode.
setContactBreakingTreshold(breakingTreshold)

Note

Reasonable default is 0.02 (if units are meters)

Sets the contact breaking treshold in the Physics Environment.

Parameters:breakingTreshold (float) – The new contact breaking treshold.
setDeactivationAngularTreshold(angularTreshold)

Sets the deactivation angular treshold.

Parameters:angularTreshold (float) – New deactivation angular treshold.
setDeactivationLinearTreshold(linearTreshold)

Sets the deactivation linear treshold.

Parameters:linearTreshold (float) – New deactivation linear treshold.
setDeactivationTime(time)

Sets the time after which a resting rigidbody gets deactived.

Parameters:time (float) – The deactivation time.
setDebugMode(mode)

Sets the debug mode.

Debug modes:
  • No debug: 0
  • Draw wireframe: 1
  • Draw Aabb: 2 #What’s Aabb?
  • Draw freatures text: 4
  • Draw contact points: 8
  • No deactivation: 16
  • No help text: 32
  • Draw text: 64
  • Profile timings: 128
  • Enable sat comparision: 256
  • Disable Bullet LCP: 512
  • Enable CCD: 1024
  • Draw Constraints: #(1 << 11) = ?
  • Draw Constraint Limits: #(1 << 12) = ?
  • Fast Wireframe: #(1 << 13) = ?
Parameters:mode (int) – The new debug mode.
setGravity(x, y, z)

Sets the gravity force.

Parameters:
  • x (float) – Gravity X force.
  • y (float) – Gravity Y force.
  • z (float) – Gravity Z force.
setLinearAirDamping(damping)

Not implemented.

setNumIterations(numiter)

Sets the number of iterations for an iterative constraint solver.

Parameters:numiter (int) – New number of iterations.
setNumTimeSubSteps(numsubstep)

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

Parameters:numsubstep (int) – New number of substeps.
setSolverDamping(damping)
..note::
Very experimental, not recommended

Sets the solver damping.

Parameters:damping (float) – New damping for the solver.
setSolverTau(tau)

Note

Very experimental, not recommended

Sets the solver tau.

Parameters:tau (float) – New tau for the solver.
setSolverType(solverType)

Note

Very experimental, not recommended

Sets the solver type.

Parameters:solverType (int) – The new type of the solver.
setSorConstant(sor)

Note

Very experimental, not recommended

Sets the sor constant.

Parameters:sor (float) – New sor value.
setUseEpa(epa)

Not implemented.

Previous topic

Game Engine bge.events module

Next topic

Blender API Change Log