Convex casting problem?

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Convex casting problem?

Postby jareko » Tue Jul 21, 2015 4:04 pm

Hi, currently I am working on kinematic character controller (using the latest version of Newton - 3.14).
My world is oriented on the plane XY, up axis is positive Z.
Character (kinematic body) uses a collision of the capsule, (rotated using a offset matrix, around the Y axis by 90 degrees), to match the orientation of the world.
Obstacles (background) have been added to the world with the preferred tree collision (NewtonCreateTreeCollision).
Collision detection method (when moving and falling) is based mainly on 'NewtonWorldConvexCast' (CCD is currently not enabled).
All the errors listed below, have occurred regardless of on or off mesh optimization - the second parameter of the function 'NewtonTreeCollisionEndBuild'.

1) If the center of the capsule is half-height or above, calculated collisions are unstable (bouncing or penetration which does not result from calculations),
but if the center is less than half the height, everything is ok.
Currently (as bypassing the problem) I placed the center of the capsule (using the offset matrix) in the center of the lower hemisphere of the capsule.
2) If the height of the capsule is twice (or more) than an obstacle, there is no collision detection (or it occurs very rarely).
It is interesting, if I calculate collisions at low level (check what objects are in AABB and then perform NewtonCollisionCollide with my character), collisions are properly detected.
jareko
 
Posts: 3
Joined: Tue Jul 21, 2015 2:06 pm

Re: Convex casting problem?

Postby Julio Jerez » Tue Jul 21, 2015 5:10 pm

implement the debug display so that you can se what is gong on.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Convex casting problem?

Postby jareko » Tue Jul 21, 2015 5:57 pm

The first thing I did was to implement debug drawing (capsule, AABB, box, contact points with normal, etc.). That's why I decided to report the potential problem.
jareko
 
Posts: 3
Joined: Tue Jul 21, 2015 2:06 pm

Re: Convex casting problem?

Postby Julio Jerez » Tue Jul 21, 2015 6:51 pm

can you show me a screen shot of how it looks?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Convex casting problem?

Postby jareko » Tue Jul 21, 2015 8:38 pm

http://hq.damos.pl:7480/jareko/pic1.png
http://hq.damos.pl:7480/jareko/pic2.png
http://hq.damos.pl:7480/jareko/pic3.png

I made a simple visualization of the second error (no collision detection).
The first link shows the scene and my capsule (orientation axes and AABB).
The second link shows the correctly calculated collision (capsule and the wall are 2 meters high).
The third link for wrong situation, when the capsule is greater than the wall (capsule is 6 meters in height, the wall 2 meters - as before). The capsule passes through the wall "unnoticed".
Tomorrow I will try to post visualize the first error.

I respect your work and time, but I do not understand where I made a mistake and therefore I ask for help.

Greetings
Jareko
jareko
 
Posts: 3
Joined: Tue Jul 21, 2015 2:06 pm

Re: Convex casting problem?

Postby aitzolmuelas » Wed Jul 22, 2015 4:43 am

To clarify a bit, convex cast in Newton is more of a convex sweep: if you convex cast a shape with no offset it will not collide with anything, amongst other particularities. Eventually I've had to use the NewtonCollisionCollide on objects within an AABB, instead of convex sweeps, to get my character controller to work properly (the functionality achieved by the CustomCharacterController included in the Joints library wouldn't do for the project I am working on, in fact it is quite hard to accomplish with convex sweeps, but easier wit collide tests). That may not be the case for everyone, and there may be some bug in 3.14 (I'm still using the last stable 3.13), but I thought I should give my two cents on the subject :P
aitzolmuelas
 
Posts: 78
Joined: Wed Mar 25, 2015 1:10 pm


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 7 guests

cron