Ok.
I need to show you one more possibility… in the physics dept. CannonJS cloth. @RaananW made this:
https://www.babylonjs-playground.com/#1M67K8#11
Real nice demo. You can click the cloth, too.
Later, I did some tweaking… turned it into this:
https://www.babylonjs-playground.com/#1M67K8#16
Wait a bit… sphere will move thru mesh. Not much different… just a bit naked.
Lastly, the latest version, using LockJoints instead of DistanceJoints:
https://www.babylonjs-playground.com/#1M67K8#25
Yes, I’m manually force-positioning a green sphere that has a physicsImpostor… a semi-unwise thing to do with potential unpredictable results. I should use setLinearVelocity on its impostor, instead.
Main point: Think about 5-9 of these spheres… hooked together by physics joints like these spheres… to make a platform for your camera. None of the spheres in your little “physics magic carpet” could roll-over or tip-over, even if they were box impostors. The joints that attach the impostors… to their fellow impostors in the magic carpet… won’t allow ANY significant impostor rotation.
Likely, if you DID build a small “camera raft” with these things, you would ONLY setAngularVelocity and setLinearVelocity on the sphere in the center, and the “outrigger?” spheres would also (automatically) turn/move… because of the joints connecting them to center-sphere.
Anyway, I just wanted to make sure that you had this “thing”… in your toolbox… in case you wanted to give it a try. In a way, it is similar to your “extra sphere for intersect testing” - method… but here… extra spheres are connected to main sphere… by joints, not parenting. AND… using sphere impostors on the surrounding spheres, but box impostor on the main/center mesh… CAN DO… and might work goooood.
There are a half-dozen TYPES of physics joints, and they don’t care what type of impostors are attached to both ends of them.
Joints sometimes have settings like stiffness and springyness.
Ok, have fun with your capsule building. I showed you in the last post… how to make half-spheres. Why not just position/parent two half spheres… to the butt-ends of a cylinder… and mergeMesh as wanted? Seems easier, but might have odd UV’s.
Capsule impostors DO show-up here and there… in the physics engines, and if not available, can be built out of compounds (like 2 sphereImpostors+?)
Last I heard, the ORDER of adding impostors… is important, for compounds.
I think… FIRST add parent’s impostor. THEN parent children to parent mesh. THEN add impostors to children. (I hope I remember that correctly). Don’t set parent on an impostor’d mesh. Parent it first, then set its impostor.
kbyeee