コード例 #1
0
        //Good Game
        //public override Vector3 ClosestPointOnNode (Vector3 p) {
        public override VInt3 ClosestPointOnNode(VInt3 p)
        {
            VInt3 a, b, c;

            GetVertices(out a, out b, out c);
            //Good Game
            //return Pathfinding.Polygon.ClosestPointOnTriangle((Vector3)a, (Vector3)b, (Vector3)c, p);
            //VInt3 closestVInt3 = (VInt3) Polygon.ClosestPointOnTriangle((Vector3) a, (Vector3) b, (Vector3) c, (Vector3) p);
            VInt3 closestVInt3 = IntMath.ClosestPointOnTriangle(a, b, c, p);

            //VInt3 closestVInt3 = ClosestPointOnTriangleXZ(a, b, c, p);
            //VInt3 closestVInt3 = (VInt3) ClosestPointOnNodeXZ(a, b, c, (Vector3) p);
            //PathDebug.LogError(4, "--ClosestPointOnNodeXZ--" + closestVInt3);
            //return (VInt3)Pathfinding.Polygon.ClosestPointOnTriangle((Vector3)a, (Vector3)b, (Vector3)c, (Vector3)p);
            //return ClosestPointOnTriangleXZ(a, b, c, p);
            return(closestVInt3);
        }