Shape penetration

Netskate

17-09-2008 20:14:42

Hi, maybe someone can explain this:



I use:
ogre sdk 1.4.9
nxogre bleeding

the shape of cube (its a body) fall through my heightfield generated with flour. it penetrates the terrain for 0.5 units I think, then it stops.

(Note: they penetrate each other in visual remote debugger, so there isn't a problem of position of the rendered terrain)

I tried to set skin of each cube and heightfield to 0.0 with no result. I also tried to substitute a cube (as plane) to the heightfield, but the small cube penetrate the big cube I use as plane in the same way...

some code, small cube that fall:
NodeRenderableParams vp;
vp.setToDefault();
vp.mIdentifier = "cubo_prova";
//vp.mIdentifierUsage = vp.IU_Create;
vp.mGraphicsModel = "cube.mesh";
vp.mGraphicsModelScale = NxVec3(0.1, 0.1, 0.1);
vp.mGraphicsModelMaterial = "Examples/Rocky";



gBody = gScene->createBody("cubo_prova", new Cube(0.1), Vector3(600,200,600), vp, "mass: 1000000000");


big cube used as plane:

gScene->createActor("piano", new Cube(2400.0,100.0,2400.0),Vector3(1200.0,0.0,1200.0), "static: yes");

some idea?

Netskate

17-09-2008 20:51:59

if I change this:

vp.mGraphicsModelScale = NxVec3(0.1, 0.1, 0.1);
gBody = gScene->createBody("cubo_prova", new Cube(0.1), Vector3(200,150,50), vp, "mass: 1000000000");


to this:
vp.mGraphicsModelScale = NxVec3(1, 1, 1);
gBody = gScene->createBody("cubo_prova", new Cube(100), Vector3(200,150,50), vp, "mass: 1000000000");


I don't have penetration and all seems to work, someone can explain the reason? thanks

betajaen

17-09-2008 21:03:19

It's to do with the size of the shape (it's freakin' tiny), since I imagine it's moving faster than wet paint, it's going to fall through the heightfield.

I would suggest turning on CCD; but me being me - I haven't implemented it yet; try increasing the size to 0.2 or 0.4 and see what you get. Also try increasing the thickness of the heightfield and see if that helps.

Prophet

17-09-2008 21:06:16

But shouldn't it fall right through? I thought of that first, but then I thought "all or nothing". It seems to get stuck at exactly the same height. What happens if you raise it 1/4 of the height upwards. Still get stuck half-way? (But probably betajaen is right as usual)

xadh00m

17-09-2008 21:33:56

I remember situation where PhysX lifted objects which get partly stuck in another body.

Netskate

17-09-2008 21:36:13

now, I return to use heightfield instead of floor, or big cube. But, my heightmap and heightfield don't be the same, I'm completely stucked from 3 days on this...



:(

Prophet

17-09-2008 21:42:58

Nice MSN-picture. ;)
I guess you have made sure the common mesh-displacement error?

Netskate

17-09-2008 21:44:46

thanks 8)

sorry but I don't know that, can you tell me about it?

Prophet

17-09-2008 21:52:05

I think you mentioned it in your first post. I just added it to the unofficial FAQ.

Netskate

17-09-2008 21:58:47

sorry but I don't understand the FAQ. My problem is that my terrain.png and my terrain.xhf (created with flour from the terrain.png -> terrain.raw image) don't be the same.

How can you see in the screenshot, there is a complete mountain in the heightfieldmap that doesn't exist in terrain.png.

:(

Prophet

17-09-2008 22:15:57

Ah, sorry, I missed that.

Netskate

17-09-2008 22:17:07

So, I think I can't get out of this without your help.

Here what happend:




take the cube as reference, on the left the same mountain, then the mountain in red, is in another position O_o

under the violet line, there is a flat area that doesn't exist in original heightmap. I don't know what happend :?:

Netskate

17-09-2008 23:24:55

SOLVED:

90° clockwise + horizontal flip