Raycast ignores close planes.

Raycast ignores close planes.

Hello there! 

I've got an issue where my hkpWorld->castRay(input,output) function ignores rigidbody planes that are close to the origin of the ray. When I gain some distance from any of these planes it does intersect (which is good)... Just when I'm about 1m away it gets ignored. 

My hkpWorldRayCastInput struct's filterInfo is defaulted to 0 - I am not ignoring any object manually. 

This does not happen on rigidbodies that aren't planes. Aren't you allowed to have rigidbodies that are planes or what have I done wrong? 

Feed back would be much appreciated. Thanks in advance! 

EDIT: Actually, my theory of being close up to a plane is not the only problem. It apparently gets ignored when shooting at a plane that is at a very small angle to the ray as well. The attachment shows 2 cases where the ray works and the other being a case where it doesn't work as intended.

AttachmentSize
Download havokraycast.jpg569.37 KB
4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi raibina,

How do you calculate the raycast input? It looks like it starts near a character controller (I'm assuming that is the capsule in the pictures). Does the ray start inside the character controller? Does the raycast still have problems if it is cast using the same values when the character controller isn't there?

If you can, could you send us a snapshot of the world in those pictures? See the Physics\Api\Dynamics\World\WorldSnapshot demo for an example of this. (It makes reproducing & fixing strange behaviour like this much easier :) )

Amy Developer Support Engineer Havok www.havok.com

Hello Amy!

Yes, the ray actually starts inside the hkpCharacterRigidBody (the player). I should try to exclude that rigidbody via the rayInputs filterinfo probably, to see if the problem still occurs. I haven't tried to remove the player either, but should do that too. 

I'll see if I can reproduce a snapshot for you if my test fail. The advice is really good though, so I'll get to it asap. :) 

Thanks!

Hi raibina,

If possible, try removing the character from the scene entirely first (I'd like to make sure that the character isn't effecting the raycast before adding in extra complexity and variables into the equation due to collision filtering). If the raycasting is still wrong try sending us a snapshot(preferable) or how you've set up your plane shape & raycast so we can recreate and debug the problem here.

If one of the things you try fixes your problem, please post what you did to fix it so anyone else who comes across the same problem can fix it too.

Thanks

Amy Developer Support Engineer Havok www.havok.com

Leave a Comment

Please sign in to add a comment. Not a member? Join today