[PhysX 3.3.1] Loading .obj and creating a dynamic actor

Hi Guys!

We are currently trying to simulate a waterwheel. Particles are running down a feed and fall into the chambers of the wheel, which causes the wheel to rotate.

The problem is we are stuck at rotating the wheel. We use the wavefront.cpp from the samples to load the wheel from an obj file. I then tried to use cooking to create a PxTriangleMesh and use this to create a kinematic PxRigidDynamic according to https://developer.nvidia.com/sites/default/files/akamai/physx/Manual/Shapes.html#kinematic-triangle-meshes-planes-heighfields

The cooking seems to work, i also get a correct collision with the particles. What i can’t figure out is how to rotate the actor using addForce/addTorque/angularVelocity. The only movement i got was by changing the global pose of the dynamic actor.

Is this even the correct approach for my problem? Is a kinematic actor with a triangle mesh enough for the wheel rotation or do i need to work with convexMeshes? (already dismantled the wheel for the convex shapes to work, but still can’t get a rotation to work)

I looked through the User’s Guide, the Forum and the Samples, still can’t get the hang of this.

Regards,
Aster

If you have set up the waterwheel as a kinematic then it can only be rotated/translated with the function PxRigidDynamic::setKinematicTarget. The alternative is to lower the kinematic flag on the actor and set an angular velocity or torque. The combination of kinematic flag and angular velocity, however, will definitely not work.

For performance reasons, some limitations are placed on triangle meshes and heightfields that are attached to dymamic actors. Such geometry does participate in scene queries but does not participate in rigid body or particle contact. I’d recommend using multiple convex shapes to represent the waterwheel geometry.

Thanks,

Gordon