PxVehicleShiftOrigin

Defined in include/vehicle2/PxVehicleFunctions.h

inline void PxVehicleShiftOrigin(const PxVehicleAxleDescription &axleDesc, const PxVec3 &shift, PxVehicleRigidBodyState &rigidBodyState, PxVehicleRoadGeometryState *roadGeometryStates, PxVehiclePhysXActor *physxActor = NULL, PxVehiclePhysXRoadGeometryQueryState *physxQueryStates = NULL)

Shift the origin of a vehicle by the specified vector.

Call this method to adjust the internal data structures of vehicles to reflect the shifted origin location (the shift vector will get subtracted from all world space spatial data).

Note

It is the user’s responsibility to keep track of the summed total origin shift and adjust all input/output to/from the vehicle accordingly.

Note

This call will not automatically shift the PhysX scene and its objects. PxScene::shiftOrigin() must be called seperately to keep the systems in sync.

Note

If there is no associated PxRigidActor then set physxActor to NULL.

Note

If there is an associated PxRigidActor and it is already in a PxScene then the complementary call to PxScene::shiftOrigin() will take care of shifting the associated PxRigidActor. This being the case, set physxActor to NULL. physxActor should be a non-NULL pointer only when there is an associated PxRigidActor and it is not part of a PxScene. This can occur if the associated PxRigidActor is updated using PhysX immediate mode.

Note

If scene queries are independent of PhysX geometry then set queryStates to NULL.

Parameters
  • axleDesc[in] is a description of the wheels on the vehicle.

  • shift[in] is the translation vector used to shift the origin.

  • rigidBodyState[in] stores the current position of the vehicle

  • roadGeometryStates[in] stores the hit plane under each wheel.

  • physxActor[in] stores the PxRigidActor that is the vehicle’s PhysX representation.

  • physxQueryStates[in] stores the hit point of the most recent execution of PxVehiclePhysXRoadGeometryQueryUpdate() for each wheel.