|
applyBrakingapplyBraking(force, wheel)Applies a braking force to a wheel.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 PhysicsConstraintsimport PhysicsConstraints# get list of objects in sceneobjList = GameLogic.getCurrentScene().objects# get object named CarobjCar = objList["OBCar"]# Retrieve constraint ID you saved when wheels were attachedconstraint_ID = objCar.constraint_ID# get the vehicle constraintvehicle = PhysicsConstraints.getVehicleConstraint(constraint_ID)# set braking forceforce = 10.0# brake with all four tiresvehicle.applyBraking( force, 0)vehicle.applyBraking( force, 1) vehicle.applyBraking( force, 2) vehicle.applyBraking( force, 3) |