Character Controller not interacting with other objects

rhaith

01-08-2011 22:53:45

Hi all!

I'm really hoping someone can help me with this problem I'm having with the charactercontroller implementation in Critter. I've tried to implement a background character as in tutorial 1201 but I'm left with an object that just clips through the world and falls to its infinite doom. I've set all my external objects to use collision groups and I'm setting the collision mask as shown in the tutorial but still left with this strange issue.

Here is my animatedcharacter implementation:
Critter::AnimatedCharacter* NRPhysics::createCharacter(Ogre::SceneNode *node, Ogre::String meshFileName, const Ogre::String& strName, bool restrictZ)
{
Critter::AnimatedCharacterDescription desc;
desc.mShape = NxOgre::SimpleCapsule(3, 0.5f);
desc.mMaxGroundSpeed = 17.f;
desc.setJumpVelocityFromMaxHeight(m_pScene->getGravity().y, 2);
desc.mCollisionMask = (WORLD << 1) | (OBJECTS << 1);

Critter::Node *pCritNode = new Critter::Node(m_pSceneMgr, node, m_pCritterRenderSystem);

Critter::AnimatedCharacter *animChar = m_pCritterRenderSystem->createAnimatedCharacter(node->getPosition(), Ogre::Radian(0), pCritNode, desc);

NxOgre::RigidBodyDescription bodyDesc;
bodyDesc.mDynamicRigidbodyFlags += NxOgre::DynamicRigidbodyFlags::FreezeRotation;

return animChar;
}


I'm completely stuck and have no idea what to try next, any help is greatly appreciated. Also Betajaen we've been using a lot of your code for our projects, including Gorilla: Thank you very much for your amazing and generous contributions.

rhaith

02-08-2011 04:30:05

and of course a problem I've had for weeks I solve shortly after breaking down and making a post. Turns out if I set the collision mask to 1 it works. Not sure why my collision groups are not working.