applyEngineForce
applyEngineForce( force, wheel)
Applies a force to the wheel's y-axis.
force:
Type: float
wheel:
Type: integer
0 = first wheel added
1 = second wheel added
2 = third wheel added
3 = fourth wheel added
Sample Code
# import PhysicsConstraints
import PhysicsConstraints
# get list of objects in scene
objList = GameLogic.getCurrentScene().objects
# get object named Car
objCar = objList["OBCar"]
# Retrieve constraint ID you saved when wheels were
attached
constraint_ID = objCar.constraint_ID
# get the vehicle constraint
vehicle = PhysicsConstraints.getVehicleConstraint(constraint_ID)
# set engine force
power = 100.0
# apply to all four tires
vehicle.applyEngineForce( power, 0)
vehicle.applyEngineForce( power, 1)
vehicle.applyEngineForce( power, 2)
vehicle.applyEngineForce( power, 3)
|