* jump() -- causes the character to jump * onGround -- specifies whether or not the character is on the ground * gravity -- controls the "gravity" that the character physics uses for the character More options could be added (such as jump speed, step height, make fall speed, max slope, etc).
8.0 KiB
Sphinx Warnings
7: ERROR: Error in "warning" directive: unknown option: "language". .. warning:: include not available in preview: ../examples/bge.constraints.py :language: rest :lines: 2-4 11: ERROR: Error in "warning" directive: unknown option: "lines". .. warning:: include not available in preview: ../examples/bge.constraints.py :lines: 6-
Note the preview is not accurate and warnings may not indicate real issues.
Physics Constraints (bge.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) –
- 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.getCharacter(gameobj)
- Parameters:
gameobj (
bge.types.KX_GameObject) – The game object with the character physics.- Returns:
character wrapper
- Return type:
bge.types.KX_CharacterWrapper
- 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
setDebugModeNo debug.
- bge.constraints.DBG_DRAWWIREFRAME
Note
Debug mode to be used with function
setDebugModeDraw wireframe in debug.
- bge.constraints.DBG_DRAWAABB
Note
Debug mode to be used with function
setDebugModeDraw Axis Aligned Bounding Box in debug.
- bge.constraints.DBG_DRAWFREATURESTEXT
Note
Debug mode to be used with function
setDebugModeDraw freatures text in debug.
- bge.constraints.DBG_DRAWCONTACTPOINTS
Note
Debug mode to be used with function
setDebugModeDraw contact points in debug.
- bge.constraints.DBG_NOHELPTEXT
Note
Debug mode to be used with function
setDebugModeDebug without help text.
- bge.constraints.DBG_DRAWTEXT
Note
Debug mode to be used with function
setDebugModeDraw text in debug.
- bge.constraints.DBG_PROFILETIMINGS
Note
Debug mode to be used with function
setDebugModeDraw profile timings in debug.
- bge.constraints.DBG_ENABLESATCOMPARISION
Note
Debug mode to be used with function
setDebugModeEnable sat comparision in debug.
- bge.constraints.DBG_DISABLEBULLETLCP
Note
Debug mode to be used with function
setDebugModeDisable Bullet LCP.
- bge.constraints.DBG_ENABLECCD
Note
Debug mode to be used with function
setDebugModeEnable Continous Colision Detection in debug.
- bge.constraints.DBG_DRAWCONSTRAINTS
Note
Debug mode to be used with function
setDebugModeDraw constraints in debug.
- bge.constraints.DBG_DRAWCONSTRAINTLIMITS
Note
Debug mode to be used with function
setDebugModeDraw constraint limits in debug.
- bge.constraints.DBG_FASTWIREFRAME
Note
Debug mode to be used with function
setDebugModeDraw 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