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

7.6 KiB
Raw Blame History

Physics Constraints (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)

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:

bge.types.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 (Continous Colision Detection) 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 tresholds to do with contact point management.

Parameters:

breakingTreshold (float) The new contact breaking treshold.

setDeactivationAngularTreshold(angularTreshold)

Sets the angular velocity treshold.

Parameters:

angularTreshold (float) New deactivation angular treshold.

setDeactivationLinearTreshold(linearTreshold)

Sets the linear velocity 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:
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)

Note

Not implemented.

Sets the linear air damping for rigidbodies.

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 damper constant of a penalty based solver.

Parameters:

damping (float) New damping for the solver.

setSolverTau(tau)

Note

Very experimental, not recommended

Sets the spring constant of a penalty based solver.

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 successive overrelaxation constant.

Parameters:

sor (float) New sor value.

setUseEpa(epa)

Not implemented.

DBG_NODEBUG

Note

Debug mode to be used with function setDebugMode

No debug.

DBG_DRAWWIREFRAME

Note

Debug mode to be used with function setDebugMode

Draw wireframe in debug.

DBG_DRAWAABB

Note

Debug mode to be used with function setDebugMode

Draw Axis Aligned Bounding Box in debug.

DBG_DRAWFREATURESTEXT

Note

Debug mode to be used with function setDebugMode

Draw freatures text in debug.

DBG_DRAWCONTACTPOINTS

Note

Debug mode to be used with function setDebugMode

Draw contact points in debug.

DBG_NOHELPTEXT

Note

Debug mode to be used with function setDebugMode

Debug without help text.

DBG_DRAWTEXT

Note

Debug mode to be used with function setDebugMode

Draw text in debug.

DBG_PROFILETIMINGS

Note

Debug mode to be used with function setDebugMode

Draw profile timings in debug.

DBG_ENABLESATCOMPARISION

Note

Debug mode to be used with function setDebugMode

Enable sat comparision in debug.

DBG_DISABLEBULLETLCP

Note

Debug mode to be used with function setDebugMode

Disable Bullet LCP.

DBG_ENABLECCD

Note

Debug mode to be used with function setDebugMode

Enable Continous Colision Detection in debug.

DBG_DRAWCONSTRAINTS

Note

Debug mode to be used with function setDebugMode

Draw constraints in debug.

DBG_DRAWCONSTRAINTLIMITS

Note

Debug mode to be used with function setDebugMode

Draw constraint limits in debug.

DBG_FASTWIREFRAME

Note

Debug mode to be used with function setDebugMode

Draw a fast wireframe in debug.

POINTTOPOINT_CONSTRAINT

Note

Constraint type to be used with function createConstraint

LINEHINGE_CONSTRAINT

Note

Constraint type to be used with function createConstraint

ANGULAR_CONSTRAINT

Note

Constraint type to be used with function createConstraint

CONETWIST_CONSTRAINT

Note

Constraint type to be used with function createConstraint

VEHICLE_CONSTRAINT

Note

Constraint type to be used with function createConstraint