Problem with Character and the terrain

alejandro

25-05-2007 22:51:59

hi, when i add the terrain ( body ) to a group the character controler do not colide with the terrain , and falls down .

whats happening?

version 0.4

any comments will be helpful

betajaen

25-05-2007 23:21:35

You mean it falls through the terrain? Isn't that the effect you wanted?

Pottej

25-05-2007 23:21:39

I found that the default skin width is too small. You cannot specify this in your code (the blueprint variable is not actually used), so youll have to manually edit the nxOgre code.

A small skinWidth causes the character to slowly sink through a floor and fall out the other side. If you are having trouble getting your character to collide at all then maybe you have set up the collision shape wrong... I dunno.

alejandro

25-05-2007 23:47:09

The character controler works fine with my terrain , but when i want add the terrain to a group , the character dont work , its falls

m_terreno = m_Scene->createStaticBody("terreno","terreno.mesh", new meshShape("terreno.mesh", m_Scene),Ogre::Vector3 (0,0,0)
);
terreno= m_Scene->createGroup("terreno");

// m_terreno->setGroup( terreno );

when i uncomments the above line , its falls

betajaen

26-05-2007 00:36:37

But if your body is using a group that forbids collisions with the character controller, then the character will fall through it.

alejandro

26-05-2007 23:55:49

so , how can i make it ?, so ,are you tellme that the character controler do not colide if is part of a group?

betajaen

27-05-2007 00:13:19

Well no, your telling that group that when it meets the character controller, it will pass through it.

The character controller's actor is in the default group (0), which I'm not sure if it can change to another, and if you did move it to that group. Then what about the other default groups; dynamic(0), and static(1), The character controller wouldn't collide with them (unless you told it not too), but then it's same as not using an extra group there.

Dirso

27-05-2007 00:20:38

Hi,

I'm using DotSceneOctree and I had a problem with the terrain.

1) I created the world and the scene NxOgre
2) I loaded the .scene file using setWorldGeometry
3) I created a *body that will be a body of a car

_world = new NxOgre::World("FrameListener: Yes, log: text");
_scene = _world->createScene("RacingGame", mSceneMgr, "floor: yes, gravity: 0 -9.8 0");
_car = new CarUSC("Flame.car", Ogre::Vector3(0,100,0), _scene);
mSceneMgr->setWorldGeometry(Ogre::String("NewLA_track.scene"));
_scene->createBody(_car.carMesh, new NxOgre::CubeShape(1,1,3),
Ogre::Vector3(0,0,0), "static: yes");


my CarUSC constructor: mBodyCar = mScene->createBody(_car.carMesh, new NxOgre::CubeShape(1,1,3),
Ogre::Vector3(0,100,0), "mass: 1000");
mBodyCar->setCMassOffsetLocalPosition(Ogre::Vector3(0,-1,0));


But the car follows through the "ground". What am I missing?

Thanks,
Dirso.

betajaen

27-05-2007 00:27:04

I don't see any code that sets up the physics representation of your scene.

Also; that could of been posted in a separate thread, don't you think?

Dirso

27-05-2007 00:43:57

I don't see any code that sets up the physics representation of your scene.

Also; that could of been posted in a separate thread, don't you think?


I'm so sorry :( I'm so tired that I clicked in the wrong button. Almost one week to make it work is making me crazy.
I'll start a new thread

Thanks,
Dirso.