How to change triangles in TriangleSelector

A forum to store posts deemed exceptionally wise and useful
Post Reply
soconne
Posts: 87
Joined: Fri Mar 05, 2004 2:00 pm

How to change triangles in TriangleSelector

Post by soconne »

Once you have created a triangle selector, how can you manually change what triangles it is using for collision?? For instance, I create a standard triangleselector in the following way

selector = smgr->createOctTreeTriangleSelector(mesh, scenenode);
scenenode->setTriangleSelector(selector);

And then below this I create the AnimatorCollisionResponse variable. What I want to do is then change the triangles and vertices that the selector is using each frame that it does collision. I know there is a getTriangles() function, but that only gets the triangles that collide with a specified 3d line. I need to get a pointer to the triangles, and erase and update as necessary.

Anybody have any idea??
soconne
Posts: 87
Joined: Fri Mar 05, 2004 2:00 pm

Post by soconne »

well i figured it out. i basically just needed to call anim->setWorld(selector) to reset the data for collision. I did have to un protect the Triangles data member in ITriangleSelector so I had access to it though.
Post Reply