Esempio n. 1
0
        public static bool Fire(Vector3 origin, Vector3 direction, float distance)
        {
            physXOrigin.FromVector(origin);
            physXDirection.FromVector(direction);
            if (defaultPhysXRaycastHit == IntPtr.Zero)
            {
                defaultPhysXRaycastHit = PhysXLib.CreateRaycastHit();
            }

            return(PhysXSceneManager.FireRaycast(physXOrigin, physXDirection, distance, defaultPhysXRaycastHit));
        }
Esempio n. 2
0
        public static bool Fire(Vector3 origin, Vector3 direction, PhysXRaycastHit raycastHit, float distance)
        {
            physXOrigin.FromVector(origin);
            physXDirection.FromVector(direction);
            bool hit = PhysXSceneManager.FireRaycast(physXOrigin, physXDirection, distance, raycastHit.physXRaycastHit);

            if (hit)
            {
                raycastHit.PopulateFields();
            }
            return(hit);
        }