Ejemplo n.º 1
0
 public void RayCast(AGKVector3 rFrom, AGKVector3 rTo)
 {
     Agk.SetVector3(FromVectorNumber, rFrom.X, rFrom.Y, rFrom.Z);
     Agk.SetVector3(ToVectorNumber, rTo.X, rTo.Y, rTo.Z);
     Agk.RayCast3DPhysics(ResourceNumber, (int)FromVectorNumber, (int)ToVectorNumber, 1);
     HitObjectNumber = (uint)Agk.Get3DPhysicsRayCastObjectHit(ResourceNumber, Agk.Get3DPhysicsRayCastFraction(ResourceNumber));
     if (HitObjectNumber > 0)
     {
         Agk.Get3DPhysicsRayCastContactPosition(ResourceNumber, Agk.Get3DPhysicsRayCastFraction(ResourceNumber), (int)HitVectorNumber);
         HitPosition.X = Agk.GetVector3X(HitVectorNumber);
         HitPosition.Y = Agk.GetVector3Y(HitVectorNumber);
         HitPosition.Z = Agk.GetVector3Z(HitVectorNumber);
     }
 }