Esempio n. 1
0
 public static ArkCrossEngine.RaycastHit RayCastHitFromUnity(CrossEngineImpl.RaycastHit hit)
 {
     ArkCrossEngine.RaycastHit retHit = new ArkCrossEngine.RaycastHit();
     retHit.normal = Vec3FromUnity(hit.normal);
     retHit.point  = Vec3FromUnity(hit.point);
     return(retHit);
 }
Esempio n. 2
0
        public static bool Raycast(ArkCrossEngine.Ray ray, out ArkCrossEngine.RaycastHit hit)
        {
            CrossEngineImpl.RaycastHit uhit = new CrossEngineImpl.RaycastHit();
            bool castResult = CrossEngineImpl.Physics.Raycast(Helper.RayToUnity(ray), out uhit);

            hit = Helper.RayCastHitFromUnity(uhit);
            return(castResult);
        }
Esempio n. 3
0
 public static ArkCrossEngine.RaycastHit[] RaycastAll(ArkCrossEngine.Ray ray, float distance, int layerMask)
 {
     CrossEngineImpl.RaycastHit[] hits    = CrossEngineImpl.Physics.RaycastAll(Helper.RayToUnity(ray), distance, layerMask);
     ArkCrossEngine.RaycastHit[]  retHits = new ArkCrossEngine.RaycastHit[hits.Length];
     for (int i = 0; i < hits.Length; ++i)
     {
         retHits[i] = Helper.RayCastHitFromUnity(hits[i]);
     }
     return(retHits);
 }
Esempio n. 4
0
        public static bool Linecast(ArkCrossEngine.Vector3 start, ArkCrossEngine.Vector3 end, out ArkCrossEngine.RaycastHit hitInfo, int layerMask)
        {
            CrossEngineImpl.RaycastHit uhit = new CrossEngineImpl.RaycastHit();
            bool castResult = CrossEngineImpl.Physics.Linecast(Helper.Vec3ToUnity(start), Helper.Vec3ToUnity(end), out uhit, layerMask);

            hitInfo = Helper.RayCastHitFromUnity(uhit);
            return(castResult);
        }
Esempio n. 5
0
        public static bool Raycast(ArkCrossEngine.Vector3 origin, ArkCrossEngine.Vector3 direction, out ArkCrossEngine.RaycastHit hitInfo, float distance, int layerMask)
        {
            CrossEngineImpl.RaycastHit uhit = new CrossEngineImpl.RaycastHit();
            bool castResult = CrossEngineImpl.Physics.Raycast(Helper.Vec3ToUnity(origin), Helper.Vec3ToUnity(direction), out uhit, distance, layerMask);

            hitInfo = Helper.RayCastHitFromUnity(uhit);
            return(castResult);
        }