I need to do collision detection for my robot model, which is in complex shape so that I can’t cover it by simple collision shapes such as sphere and tube. Thanks for rdb that telling me the way to transform my model to an “into” solid by adding a tag to my .egg file, but it can’t work for my “from” solid.
So, is there any approach to transform my loaded model to an “from” collision solid for detection? I don’t care the efficiency now, and the third part libs like Bullet can also be used if necessary,
Thanks in advance
Bullet has no ‘from’ and ‘into’ nodes and it can do polygon into polygon collisions, but it will not mix with the default collision detection system, it’s one or the other (but there are some helper functions to convert panda3d collision solids into bullet collision solids). Check out the manual for more info: https://www.panda3d.org/manual/index.php?title=Bullet_Collision_Shapes&language=cxx
I can confirm Bullet works for robots:
…but not always:
wezu, thank you for your again help,
I try to use bullet to transform my model to a bulletrigidbody now, and it looks normal now.
By the way, do you know what nodepaht.find("**/+GeomNode") means?
I found it in some examples, but there is not clear explanations.
I do recommend building up your robot from many smaller collision solids (such as boxes) if at all possible. Solids are much better at stable collision detection than polygons or trimeshes because those are infinitely thin.
nodepath.find("**/+GeomNode") means "find a node at any level under this node that is of type
GeomNode". It is used to find a subnode that contains the geometry for the model.
thank you Mr. RDB, for your help again, I will consider it, but I will try bullet first, which may be the fastest way to build my world. When it is realized, I will follow your advice to improve the efficiency.
Besides, thank you for your explanation for nodepath.find("**/+GeomNode") , actually what I’m refused about is that I don’t find “GeomNode” in my egg file, so the subnode is generated automatically when loading the model?
Yes, GeomNode is generated automatically from geometry definitions in the .egg file.
You can use this command to get an insight into the structure of your model: