Transforming collision models
What's the best way to scale a collision model such as a compound collision, a triangle mesh collision model, etc.? Ideally this would be good to apply arbitary vector based scaling to any collision model without having to rebuild it. I think Havok has a way to do this considering Source Engine.
Can you apply shearing to the different collision models?
Applying scaling to collider shapes isn’t supported yet. So right now you have to build the scaled object yourself. In the future, we intend to support applying any positive non-uniform scaling to triangle meshes.
Applying scaling to collider shapes isn’t supported yet. So right now you have to build the scaled object yourself. In the future, we intend to support applying any positive non-uniform scaling to triangle meshes.
What about other colliders like box, cylinder, capsule, etc?
It wouldn’t be supported for these shapes because these colliders would lose all their nice geometric properties (that makes the collision-detection fast) under general scaling (like shear). I am not aware of any physics engine that supports that (except for uniform scale).
The only other shapes that could support arbitrary scaling are ConvexPolygon, ConvexPolyhedron, and Polyline.
It wouldn’t be supported for these shapes because these colliders would lose all their nice geometric properties (that makes the collision-detection fast) under general scaling (like shear). I am not aware of any physics engine that supports that (except for uniform scale).
The only other shapes that could support arbitrary scaling are
ConvexPolygon,ConvexPolyhedron, andPolyline.
I was talking about non uniform scaling, not shearing. I think Havok has some support for non uniform scaling, shearing not sure though.
EDIT: I understand that maybe for capsule and cylinder you could only support uniform scaling but for cuboid collision you can certainly handle non uniform scaling.
+1 for scaling collision models. I'm attempting to replace AmmoJS with Rapier.js and setLocalScaling on convex hulls is a feature I use and would like to see available in rapier.
Any chance of getting uniform scaling soon? It would be nice to be able to scale a rigid bodies without having to rebuild it. Lots of use cases for this.
@frankieali Have you considered building the scaled shape and assigning it to the existing collider using Collider.setShape?