Page 1 of 1
can i convert an entry to an entity
Posted: Thu Sep 08, 2011 5:49 am
by tako.ya
I'm using the space.reycast, all the objects in my space are entities, but the rayCastResult returns the entry the ray hits. I want to know which entity the ray hits so i can deal with it
Or
Is there any way easy to know which entity the ray hits?
Re: can i convert an entry to an entity
Posted: Thu Sep 08, 2011 5:52 am
by Norbo
Every entity has a CollisionInformation property, which returns an EntityCollidable object. The EntityCollidable object is the entity's proxy in the broad phase and collision detection pipeline. The EntityCollidable is a BroadPhaseEntry.
So, you can attempt to cast the BroadPhaseEntry retrieved from a ray cast to an EntityCollidable. If it succeeds, you can check the EntityCollidable's Entity property to get the entity that owns the collidable.
Re: can i convert an entry to an entity
Posted: Thu Sep 08, 2011 6:03 am
by tako.ya
thank you, that helps a lot