|
getWheelRotationgetWheelRotation(wheel)Returns the distance (in Blender Units) the tire has traveled.Return type: float wheel:
Type: integer
0 = first wheel added
1 = second wheel added 2 = third wheel added 3 = fourth wheel added Note:This works like your car odometer. Forward adds to the distance. Reverse substracts.Sample Code# import PhysicsConstraintsimport PhysicsConstraints# get list of objects in sceneobjList = GameLogic.getCurrentScene().objects# get vehicle 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)# get the distance 1st tire has traveledodometer = vehicle.getWheelRotation(0) |