Raycast fails on small object?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Raycast fails on small object?

Postby Spek » Thu Dec 10, 2009 8:34 pm

Hi,

Any idea why a newtonRaycast misses a particular object? Just like all other objects in my scenario, this body has a convex collision. It's not different from any other body/collider I made, except that this object is smaller (a doorknob). If I scale the pointcloud larger, it seems to work again.

I'm using NewtonWorldRayCast. No fancy filters, just trying to get the object with the closest distance. However, my small object does not even occur in the callback. It's present in the world though, other bodies can collide with it.... Using Newton 1.5 by the way.

Regards,
Rick
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Raycast fails on small object?

Postby Julio Jerez » Thu Dec 10, 2009 8:47 pm

maybe using newton 2.12 :wink:
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Raycast fails on small object?

Postby JernejL » Fri Dec 11, 2009 4:54 am

Depending on internal scale of your objects, the CPU floating point unit's precision may be making too great errors (happens mostly at very low and very big fpu numbers) and you'll have to scale your world differently to make better use of useable floating point range.

How many units in size is the doorknob?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Raycast fails on small object?

Postby Spek » Fri Dec 11, 2009 4:57 am

I'm trying to move over Newton2 (thanks Stucuk for your Delphi headers!). But just wanted to be sure I'm not doing something wrong, so could it be true that the older Newton skips small objects with its raycast check?

Talking about Newton2, and especially in combination with Delphi, how much "backward compatible" is it? I don't mind changing a few function calls, but I'm always afraid with migration. Ow, and does the Delphi also support "Player character" physics already? I tried to copy the C++ Character demo to Delphi, but I found a few functions missing or different.

@Delfi
The numbers shouldn't be that small. The doorknob is small relative to other objects, but in matters of size numbers, it would have a radius of 0.1 (32 bit float). So I wouldn't expect the numbers to be too small. And as said, other bodies still collide correctly with this small knob. It's only the raycast that seems to miss.

Greetings
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Raycast fails on small object?

Postby Stucuk » Fri Dec 11, 2009 8:38 am

Spek wrote:Talking about Newton2, and especially in combination with Delphi, how much "backward compatible" is it?


The main changes are that the Contact Process's are different. In 1.53 you have Begin, Process and End. In 2.0 you have an AABBCallback and a ContactProcess callback. You can nolonger freeze/unfreeze objects manualy as they are automatically unfrozen when you apply any force to an object. You have to set a world size, can't remember if you had to do that with 1.53 . Can't think of any others... been ages since i used 1.53 .

Spek wrote:Ow, and does the Delphi also support "Player character" physics already? I tried to copy the C++ Character demo to Delphi, but I found a few functions missing or different.


Since i have only had a need for the actual Newton.dll and not the JointLibrary.dll i havn't done any header translations for it. Executor however did submit a translated header on 5th of September which is included in the latest distributions of the Delphi Headers but i havn't kept it upto date (Since i don't need it currently). I also never tested Executor's header(Since i don't have anything to test it with :P).

Note that 2.08 or 2.09 was the latest version of Newton around the 5th of September. So if you update the Delphi header for the Joint Library you should find a Diff application(As in an app that shows you the difference between 2 files) and compare 2.08's Joint Library header to the latest one.
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: Raycast fails on small object?

Postby Spek » Fri Dec 11, 2009 7:03 pm

Hmmm.... that shouldn't be too much problems, although the contact-end callback is handy for stopping looped (scratch) sounds or other effects. I suppose the AABBcallback is somewhat the same as contact-begin, when 2 objects are about to collide (and eventually tell them not to collide)? Auto unfreeze sounds good. I had problems with that quite many times, forgetting it.

Thanks for the tips
Spek
 
Posts: 66
Joined: Sat Oct 04, 2008 8:54 am

Re: Raycast fails on small object?

Postby JernejL » Sat Dec 12, 2009 8:59 am

http://newtondynamics.com/wiki/index.ph ... 53_and_2.0

Includes delphi code for cnverting collision callbacks, will be useful for you.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron