示例#1
0
        public GodotVector3 Xform(GodotVector3 v)
        {
            GodotVector3 vector3 = this[0];
            float        num1    = vector3.Dot(v);

            vector3 = this[1];
            float num2 = vector3.Dot(v);

            vector3 = this[2];
            float num3 = vector3.Dot(v);

            return(new GodotVector3(num1, num2, num3));
        }
示例#2
0
        public GodotBasis Orthonormalized()
        {
            GodotVector3 axis1 = GetAxis(0);
            GodotVector3 axis2 = GetAxis(1);
            GodotVector3 axis3 = GetAxis(2);

            axis1.Normalize();
            GodotVector3 yAxis = axis2 - (axis1 * axis1.Dot(axis2));

            yAxis.Normalize();
            GodotVector3 zAxis = axis3 - (axis1 * axis1.Dot(axis3)) - (yAxis * yAxis.Dot(axis3));

            zAxis.Normalize();
            return(CreateFromAxes(axis1, yAxis, zAxis));
        }
示例#3
0
 public float DistanceTo(GodotVector3 point)
 {
     return(normal.Dot(point) - d);
 }
示例#4
0
 public GodotPlane(GodotVector3 v1, GodotVector3 v2, GodotVector3 v3)
 {
     normal = (v1 - v3).Cross(v1 - v2);
     normal.Normalize();
     d = normal.Dot(v1);
 }