www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: neo187 on January 03, 2012, 10:19:53 pm

Title: checkForCollision and concave/hollow objects
Post by: neo187 on January 03, 2012, 10:19:53 pm
Hi Egon

I have only tried this with checkForCollisionEllipsoid, but basically I have the mesh for the four walls of a room and its pavement (all one mesh). If I place the character inside it the check always registers a collision, basically making the character never move. I tried putting the character at different positions inside the room mesh and always no movement. If however I import each of the four walls as distinct objects then the collisions works as expected...

Just checking, is this meant to happen? I am setting each object to CHECK_OTHERS and the character to CHECK_SELF, I have tried with different dimensions for the ellipsoid, from (1, 1, 1) to (10, 10, 10), always same result....


Thank you very much
Title: Re: checkForCollision and concave/hollow objects
Post by: EgonOlsen on January 03, 2012, 10:30:47 pm
No, this isn't meant to happen and i never experienced anything like that except when the character starts of in the ground. Ellipsoid collision detection is vor collision avoidance, which means that it can't resolve existing collisions that are already present when you call the method, i.e. if the center of the ellipsoid lies in the ground plane (for example), nothing will happen (in most cases...). Maybe this is the problem here? If not, i need the model an a simple test case to see what's happening here.
Title: Re: checkForCollision and concave/hollow objects
Post by: neo187 on January 04, 2012, 04:02:43 pm
Right, it turns out to be the ellipsoid size.... Not being able to see it I guess can easily induce the mistake of making it too big, which results in the problem above...

Thank you for your prompt reply!