In Panda3d Manual, this page (panda3d.org/manual/index.php/Collision_Solids), c++ mode, says this :
where cSphere_node is an instance of CollisioneNode class BUT…
…er… CollisionNode class DOESN’T have any method called show
So, what’s the real correct why of showing a collision ray for debugging purpose? Should I treat che CollisionNode as a PandaNode and wrap it in a NodePath and use NodePath’s show method?
without having used c++ in combination with collisions. my guess would be you have to do showCollisions on your collisiontraverser.
http://www.panda3d.org/apiref.php?page=CollisionVisualizer this might be another useful class for you.
Well actually that’s the same thing, CollisionTraverser.showCollision just creates a CollisionVisualizer.
Anyway, that seems to just show collisions, not actual collision solids. The only way I found to show collision solids is the following
PT(CollisionRay) cr = new CollisionRay(0,0,0,0,0,-1);
CollisionNode *cRay_node= new CollisionNode("Ray");
NodePath collNp =nodep.attach_new_node(cRay_node);
in this code I load an egg model, create a collision ray and attach it to the model: this way I get a NodePath for the CollisionNode object and I call show() to actually show the CollisionNode containing the collision ray.
This way sounds quite correct and logic to me, since the ray had to be attached to the model 'coz it should move with it (is a classic -Z ray to detect floor)
I’m in the middle of compiling Panda so I can’t test it right now, but have you tried changing: