Scaling a mesh

shanefarris

03-07-2010 22:33:35

Hi, I am new to PhysX and the wrapper, but it looks like in order to create and render a mesh you send that request to the render system, and it will set it up for both the physics side, and for Ogre as well? What if we need to rescale the node after its been created by the NxOgre rendersystem, will I need to update the scale of the physical shape around it as well?

I've worked with Bullet and Ode, so this is a little different. What I've always have done is create the entity and node directly with ogre, then tied the node and entity to a physical shape. This seems to be a little different in that the render system creates it all for you, is that correct? If so, is there any way around that? If not, no big deal, just curious.

Thanks.

betajaen

03-07-2010 22:51:05

Primitive shapes; cubes, spheres, capsules, wheels, etc. can be re-scaled at a whim and is really easy and fast to do so, but meshes are more difficult. You can scale the mesh but it's "expensive" to do so. It requires time for NxOgre to send all the information to PhysX then PhysX to "cook" it, then NxOgre to get the cooked mesh and then tell PhysX to load it in again, and each Mesh would be a copy of the original. It's a real pain but that's how they made it. If you scaled many meshes in mid-frame you would see some a performance hit.

You can create the node/entity and manage it yourself; either passing that onto a body, or polling the changes yourself from a pre-made Actor and updating the SceneNode/Entity by hand from the Actor's position (basically what a Body does). You don't have to use the RenderSystem to use NxOgre with Ogre, or if you wish you can use some bits of it only.

shanefarris

04-07-2010 00:12:15

Thanks for your reply. I'm still waiting for Nivida to approve my registration, how long does this normally take? I signed up last night, and I would really like to get working with this, looks like you did a great job on the code.

Thanks for makes such a good product.

betajaen

04-07-2010 09:46:19

About a few business days. It's processed by hand, it's Sunday today (for me), and Sunday in the States so probably tomorrow the earliest I'm afraid.