spacegaier
08-03-2008 17:30:32
I've created a plane (NxOgre::Body), a cubish NxOgre::Body and a NxOgre::Character.
The two cubes (the character is also a cube) are standing on the plane.
Now I let fall down many other bodies (SphereShapes) on this plane -> the cubish body is affected by them (pushed around on the plane). But the character is only affecting the other obejcts (the spheres are bouncing away or I can push the cubish body around with my character).
Is that normal? Do I have to handle the collision effects on my character manually by my own and if I do so how (some keywords)?
My spheres:
The two cubes (the character is also a cube) are standing on the plane.
Now I let fall down many other bodies (SphereShapes) on this plane -> the cubish body is affected by them (pushed around on the plane). But the character is only affecting the other obejcts (the spheres are bouncing away or I can push the cubish body around with my character).
Is that normal? Do I have to handle the collision effects on my character manually by my own and if I do so how (some keywords)?
NxOgre::Body *gr = m_pNxScene->createBody("Plane.mesh", new NxOgre::CubeShape(50,0.1f,50),Vector3(0,0,0), "static: yes");
gr->getNode()->showBoundingBox(true);
NxOgre::Body *b = m_pNxScene->createBody("cube.1m.mesh", new NxOgre::CubeShape(1,1,1), Vector3(0,20,0), "Mass: 10");
NxOgre::CharacterParams params;
params.setToDefault();
params.CT_Box;
params.fromString("mass: 1");
params.fromString("material: characterMat");
m_pNxScene->createMaterial("characterMat")->setAll(0.5f, 0.5f, 0.5f);
m_pPlayer1Character = m_pNxScene->createCharacter("Player", NxOgre::Pose(Vector3(0,5,0),Quaternion::IDENTITY),params);
m_pPlayer1Character->createNode();
Entity* ent = m_pSceneMgr->createEntity("PlayerEntity","cube.1m.mesh");
m_pPlayer1Character->getNode()->attachObject(ent);
m_pPlayer1Character->setMovementVectorController(new myMovement());
My spheres:
NxOgre::Body * b;
NxOgre::SphereShape * s = new NxOgre::SphereShape(1);
b = m_pNxScene->createBody("sphere.2m.mesh", s, m_pCamera->getPosition(), "mass: 20, material: name");
b->addForce(m_pCamera->getDirection()*550,NX_IMPULSE);