[SOLVED]How to make unmovables & collision detection

lexchou

20-08-2007 08:27:43

Problem one
Almost all the game they have some unmovable things, like rocks, buildings, they can't be moved, they have no any physical effects, how to make such a unmovable things in NxOgre? I didn't find any possible solutions. I think such a this thing without any physical effects, only collision detection enabled, is more efficient than a very heavy NxOgre::Actor.
How to implement such a thing?

Problem two
I have posted a question here, about why character is underneath the terrain below knees, that solved, thanks to betajaen, but now, I got a similar problems with NxOgre::Body,
here is my code:

NxOgre::ActorParams ap;
ap.setToDefault();
ap.density=100;
ap.nodescale=Vector3(10,10,10);
NxOgre::Body * box=scene->createBody("box.mesh",new NxOgre::ConvexShape("box.mesh"),NxOgre::Pose(Vector3(1710,211,310)),ap);

if I do not set ap.nodescale, everything works fine, but if I did, half of the box are under the terrain.

Problem three
How to make character collision detection responsible, I use NxOgre::Character::addMovement to control a character's movement, but in this case, the character may walk through a NxOgre::Actor even I called NxController::setCollision with true, but the result acts like there is no collision detection in the earth, , why this happens? and how to prevent this happens?

betajaen

20-08-2007 10:40:34

1. You can set it to static.

createBody(..., "static: yes");

2. You could add half the height of the box to the vertical position. Also what is your scale?, Do you really want your box to be 10 metres by 10 metres by 10 metres?

3. Your the second person to tell me this, I'll have a look later and see what is going on with the character.

lexchou

20-08-2007 11:51:22

1. You can set it to static.

createBody(..., "static: yes");

2. You could add half the height of the box to the vertical position. Also what is your scale?, Do you really want your box to be 10 metres by 10 metres by 10 metres?

3. Your the second person to tell me this, I'll have a look later and see what is going on with the character.

:lol:
Thank you for your reply, does the NxOgre or the PhysX's scales are meant to set to an absolute unit, not meant to multiple a factor? :shock:



__________________________________________
Edit
Now I got it, Me and the first person told you that, because we set the nodescale but forgot to set mesh scale. we are all wrong :oops:

betajaen

20-08-2007 12:12:42

You mean the nodeScale? It's a scale factor.

lexchou

20-08-2007 12:15:15

oops. I'm wrong. the character indeed have the bug. I used a robot mesh and scale to 0.3 0.3 0.3, the bug disappeared. remove the scale code, bug comes back.


Your quick response makes me amazing :D

betajaen

20-08-2007 12:59:22

No problem, I pratically sleep here; Jacmoe or Sinbad always throws me out at night but I always break in again.