I’ve been trying to solve this problem for quite a few months now. I’m still new to Panda3D, but I have read and ran nearly all the build-in tutorials, and a series of Collision examples and Physics examples. I feel comfortable with the panda terminology and i’ve gotten some simple simulations to run great.
In my game, I want to have a series of robot parts that you can assemble into a robot. Once assembled, I need to detect collisions between other objects in the world and each individual part. That robot can also do stuff like move around, rotate parts, etc, primarily through the control of the parts, and not of the whole robot itself. e.g. To move the robot, we ask the wheels to provide a force, subsequently all the parts move that are attached to the wheels.
The main problem I keep running into is some way to ‘fasten’ the parts to each other or to some Host. Lots of reading leads me to Multi-part actors, Actor sub-parts (which are different things?), parenting nodes to one another, setting joints and skeletons, etc. I can’t get them to work though. Perhaps there’s a way to set things intangible? Or make the PhysicsCollisionHandler not push certain objects?
I’ve been trying to implement it in many ways, but always seem rife with problems. What is the correct way to implement this? Here’s some examples of what I’ve tried:
Each part is an Actornode. Parent them all to one other ActorNode. All part-actornodes and the host-actornode have CollisionNode attached to them along with a nodepath which is the model from loadModel.
Problem: Gravity pulls all the parts to the floor and the bot falls apart. CollisionHandlerPusher pushes all the parts away and it explodes.
One actornode. Each part is a Nodepath just loaded with differnt models. Each part’s nodepath is given a different CollisionNode.
Problem: The ‘wheels’ part and other parts do not exhbit friction, so it slides around on ice all the time. If the bot tips over, it slides forever in a non-realistic way.
–3 Variation of 1, with the collision node for the host-actornode extremely tiny from setScale(0.001). ForceNodes set on the parts to counteract gravity.
Problem: Any acceleration causes the parts to keep going in the same path until they fly apart again.
–4 Variation of 2, with the CollisionNode for the only ActorNode huge and encompasses all of the parts in some sort of shell.
Problem: This collision shell pushes all the parts out of it with the PhysicsCollisionHandler, specifically the CollisionHandlerPusher.
Any help would be very appreciated!