Scaling MobileMesh

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Wilhelm
Posts: 2
Joined: Sun Apr 14, 2013 3:51 pm

Scaling MobileMesh

Post by Wilhelm »

I have been looking around for a solution for awhile but I can't find any for scaling the mobilemesh & the convexhull entities.
The AffineTransform can scale them at initialization but howabout after, continuously.

Does anybody know a solution to my problem?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Scaling MobileMesh

Post by Norbo »

Dynamic scaling is a nonphysical operation in rigid body physics, so it's not uniformly supported. You could go in and modify the MobileMeshShape to allow it, but to do so, you'll have to repeat some of the work done in the constructor. For example, changing the affine transform potentially changes the center of mass, requiring a recentering. You could also just recreate the shape with the new transform.

Scaling ConvexHullShapes is a little easier. You can put the ConvexHullShape into a TransformableShape and modify the TransformableShape's linear transform. It will propagate the updates to entities using the shape.

Also, when I said it was a nonphysical operation, I mean the collision solver will not be able to deal with it rigidly. Object resizing is treated as a form of teleportation; it isn't velocity based. New or deeper collisions caused by expansion will be resolved by the 'squishier' baumgarte velocity feedback instead of a solid rigid response. To see what this looks like, try spawning a box in another box.
Wilhelm
Posts: 2
Joined: Sun Apr 14, 2013 3:51 pm

Re: Scaling MobileMesh

Post by Wilhelm »

Thanks for your answer!
I guess I will take a look at the constructor in order to save the garbisch collector some work :wink:
Post Reply