Collision Raycast question

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Collision Raycast question

Postby rattus » Fri Mar 11, 2011 12:55 pm

Hi,

I'm using NewtonWorldRayCast to check if my Ogre light is occluded and display / hide it.

I'm using the OgreNewt BasicRaycast that does this and i found that it does not find collision against ellipse collision body.

If i use mesh ( TreeCollision ) it works correctly and does find the hit.

I could not find information that world ray collision does not find convex collision bodies or something similar, also i've checked the notes on the wiki regarding worldraycast, but all those are fullfilled.

basically it's down to
col = new MogreNewt.CollisionPrimitives.Ellipsoid( world, new Vector3( 50, 40, 50 ), 667 );
vs
col = new MogreNewt.CollisionPrimitives.TreeCollisionSceneParser( world );
the rest of code is the same in both cases.

i have version 2.25, so i tried to recompile with 2.32 but it had exactly the same issue and in 2.32 even the mesh collision became buggy ( sometimes it did not detect any collision though the ray went through the mesh ).

Any suggestions or kicks in proper direction welcome :-)
Last edited by rattus on Mon Mar 14, 2011 12:27 pm, edited 1 time in total.
rattus
 
Posts: 7
Joined: Tue Aug 31, 2010 9:20 am

Re: Collision Raycas question

Postby Julio Jerez » Fri Mar 11, 2011 1:56 pm

the ray cast should work on all collision shapes in all version on Netwon.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Collision Raycas question

Postby rattus » Mon Mar 14, 2011 12:26 pm

i tested now 3 versions ( 2.25, 2.27 and latest 2.32 ).

the Ellipsoid does work only if i create sphere - if at least one dimension is other then others, the collisions do not hit. Seems there is no hit body at all, as all the angles do not detect hit. Debug showed properly created sphere/ellipsoid.

the mesh problem - seems to be present in all 3 versions for objects created from ogre models through TreeCollisionParser and ConvexHull parser of Ogre SceneNode. they occasionaly do not hit the mesh, mostly when the collision ray goes through edge between two triangles.

In both cases it could be because of mogrenewt or the fact that mogre i have is compiled with Ogre::Real = float so there is lot of warnings about double/float conversion when i compile the MogreNewt.

Do you have any suggestion for next steps ? i can live without the Ellipsoid but the convex collision problems are bad for me :-)
rattus
 
Posts: 7
Joined: Tue Aug 31, 2010 9:20 am

Re: Collision Raycast question

Postby Julio Jerez » Mon Mar 14, 2011 1:52 pm

Like I saiod ray cast should work on all collisions on all place of the collison and all the time, no exeption.

you need to produce a test so that I can see that.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Collision Raycast question

Postby rattus » Tue Mar 15, 2011 4:18 am

Yes i understand, but as i use Mogre + Mogrenewt in C# i can only produce test in that, and i think that's pretty useless for you.

I believe that problem is in the wrapper to c# as this kind of problem would be surely noticed by other users.

If you want i will produce the test, but i don't suppose you want to waste your time digging through somebody else's wrapper for your newton :-)

I will ask other Mogre users if they did have similar problems.
rattus
 
Posts: 7
Joined: Tue Aug 31, 2010 9:20 am

Re: Collision Raycast question

Postby Julio Jerez » Tue Mar 15, 2011 8:52 am

are you using the lastest version from SVN?

you can make the test in c#, jeus meak sure it allowe for debugging soem c# app are not debugable

I like to see those edge failures you'd mentioned, because as far as I know ray cast should be perfect, never ever fail.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron