private static void onCCDContactModify(PxCCDContactModifyCallback * @this, PxContactModifyPair *pairs, uint count) { for (uint i = 0; i < count; i++) { PxRigidActor **actors = (PxRigidActor **)&pairs[i].actor; //BIOQUIRK: Unobvious cast. PxShape ** shapes = (PxShape **)&pairs[i].shape; //BIOQUIRK: Unobvious cast //Search for actors that represent vehicles and shapes that represent wheels. for (uint j = 0; j < 2; j++) { PxRigidActor *actor = actors[j]; if (actor->userData != null && ((ActorUserData *)(actor->userData))->vehicle != null) { PxVehicleWheels *vehicle = ((ActorUserData *)(actor->userData))->vehicle; Debug.Assert(vehicle->getRigidDynamicActor() == actors[j]); PxShape *shape = shapes[j]; if (shape->userData != null && ((ShapeUserData *)(shape->userData))->isWheel) { uint wheelId = ((ShapeUserData *)(shape->userData))->wheelId; Debug.Assert(wheelId < vehicle->mWheelsSimData.getNbWheels()); //Modify wheel contacts. PxVehicleModifyWheelContacts(*vehicle, wheelId, WHEEL_TANGENT_VELOCITY_MULTIPLIER, MAX_IMPULSE, ref pairs[i]); } } } } }
private static void Destructor(PxCCDContactModifyCallback * @this) { }