blueprint setShapeAsBox

odyeiop

16-02-2007 22:03:32

hey hey,
I'm having a slight problem with this. As I understand it, the 3 values that you put in when you call setShapeAsBox(a,b,c) are
a width
b height
c depth

which should create a literal box collision. I do this, but the collision stays to, what seems like, one point in the center of the character. I'm assuming that an input of 1 = 1 meter? If so, then I really have no idea why this isn't working properly. I pass in (0.5,1.8,0.5) and the characters pivot can go right up to anything.

I was going to switch to using setShapeAsCapsule, but if you press forward he leaks through walls, or doesn't collide with the floor at all and just falls into space. I tried changing the skin widths, but to no avail.

ocrim74

18-02-2007 14:34:12

Hi,

did you change the desc.skinWidth like I described in the folling topic with the subject mSkinWidth vs. SkinWidth?

http://www.ogre3d.org/phpBB2addons/view ... 2&start=15

I am using a capsule shape and the change of the mSkinWidth had no effect. I changed the desc.SkinWidth, then it was working for me.

Cheers,

ocrim74

odyeiop

18-02-2007 22:58:12

yeah, in the nxOgre_character.h there is now

void setSkinWidth(Ogre::Real _skin) {
[][]mSkinWidth = _skin;
}

Still can seep through the walls (I set the skin width pretty high to.. I've had it anywhere from 0.2 to 2).

ocrim74

18-02-2007 23:09:18

Hi again,

did you try to change the value of desc.skinWidth in the nxOgre_character.cpp to 0.0125 or higher?

The problem is that the member mSkinWidth of the header file is not used in the code to set the skinWidth.

Cheers,

ocrim74

odyeiop

19-02-2007 13:21:51

Yeah, I tried that to.

I think the problem isn't in the blueprint so much as it is in the static bodies created through the physics scene.
It collides fine with all of the dynamic objects, but it seems that once I make a static object it doesn't collide at all.

odyeiop

19-02-2007 21:43:28

Hmm.. after a bit of fiddling, I find that I can't pass through any dynamic objects, but static objects I just seem to cut through. Is their any fix for this at all?

betajaen

19-02-2007 21:49:46

Are you sure it's just static objects, or the mesh shape implemented in the static objects?

odyeiop

19-02-2007 22:06:54

The mesh shapes I'm using are fairly simple. For the the level, it's just a bunch of planes placed where the walls are supposed to be. The collision is fine with the box shape (except that it isn't a box shape as per my original post), it's just with the capsule shape for the character that I end up leaking through the walls.

As a side note, is there a way to set the force that is applied through the character::(movement). I have some objects with a fairly high density, and the player just manages to plow through them, tossing them across the level sometimes, or just rolling them around. Would I have to make contact triggers for everything? Or is there some way to set it so that the character has a density?

betajaen

19-02-2007 22:55:19

The character doesn't have any mass at all; it's a kinematic NxActor.

There is some collision code which I wrote which is in the character class, I wrote it (or stole it from the Ageia Samples). I've tweaked it enough so it gives enough force without making the boxes fly across the world, but you can certainly tone it down; character::onShapeHit.

odyeiop

28-02-2007 14:01:13

I managed to fix the setShapeAsBox so that it is an actual box and not just a point.

I also started some work on the onShapeHit, but that doesn't seem to be going quite as well as I had hoped. Is their anywhere I can get more detailed information on this? I set it up so you can set the players mass and push strength, and tried using these in the onShapeHit, where if the players mass*push strength > Actor.mass, it's pushable, and apply a force based upon some formulas. Is their a better way to do this?

Also, I'm still having the same problem with the physicscene dying on reinitialization as mentioned in this thread.

Any help and/or information would be very appreciated.