Multiple entities within a scenenode....

CWilly

09-02-2006 23:05:07

I have just started experimenting with using ogrenewt within my project but am having some teething difficulties.

When creating a body with a convex hull collision primitive made from a scenenode with multiple entities, only one of the entities (the one with the lowest alphanumeric name i think) acts 'solid'. All the other entities fall through my treecollision floor. I'd imagine there is a pretty simple fix to this, but cant figure it out!

Thanks in advance,

CWilly

walaber

10-02-2006 00:36:56

the default convex hull constructor only takes the first attached object to make into a hull. you can modify OgreNewt to iterate through all entities if you wish, it would be an easy fix.... perhaps I should change OgreNewt's default behavior for this...

CWilly

10-02-2006 01:14:12

Just read the ogrenewt source and its obvious why it doesnt work now. I've tried modifying the constructor by wrapping a for loop around the code:

int n;
for(n = 0; n<node->numAttachedObjects();n++)
{
.......
}

and obviously updating the getAttachedObject line to:

Ogre::Entity* obj = (Ogre::Entity*)node->getAttachedObject(n);

but this doesnt seem to have fixed it.

Any ideas why this wont work? I think it would be handy to at least have an option to use nodes with multiple entities yep!

CWilly