コード例 #1
0
        static void TestTriangleMeshRayCast(RigidBody triMeshObject)
        {
            Vector3 rayFromWorld = triMeshObject.WorldTransform.Origin + new Vector3(0, 0, -2);
            Vector3 rayToWorld   = triMeshObject.WorldTransform.Origin + new Vector3(0, 0, 2);
            var     cb           = new TriangleMeshRayCastCallback(ref rayFromWorld, ref rayToWorld);

            world.RayTestRef(ref rayFromWorld, ref rayToWorld, cb);
            if (!cb.Success)
            {
                Console.WriteLine("Triangle mesh raycast fail!");
            }
        }
コード例 #2
0
 static void TestTriangleMeshRayCast(RigidBody triMeshObject)
 {
     Vector3 rayFromWorld = triMeshObject.WorldTransform.Origin + new Vector3(0, 0, -2);
     Vector3 rayToWorld = triMeshObject.WorldTransform.Origin + new Vector3(0, 0, 2);
     var cb = new TriangleMeshRayCastCallback(ref rayFromWorld, ref rayToWorld);
     world.RayTestRef(ref rayFromWorld, ref rayToWorld, cb);
     if (!cb.Success)
     {
         Console.WriteLine("Triangle mesh raycast fail!");
     }
 }