Invert() public method

public Invert ( ) : void
return void
Example #1
0
        public static void BuildFromVertices(Vector3D a, Vector3D b, Vector3D c, Plane outPlane)
        {
            Vector3D edgeA = c.SubtractedBy(a, tempVectorA);
            Vector3D edgeB = b.SubtractedBy(a, tempVectorB);
            Vector3D cross = edgeA.Cross(edgeB, tempVectorC);

            // !! Important: inverted to be valid in left-handed space
            // TODO: make this work in either handed-ness automatically
            cross.Invert();
            outPlane.Normal.Copy(cross);
            outPlane.Normal.Normalize();
            outPlane.D = outPlane.Normal.Dot(a);

            float padding = 0.15f;

            outPlane.PlaneBounds.min.X = Mathf.Min(a.X, b.X, c.X) - padding;
            outPlane.PlaneBounds.min.Y = Mathf.Min(a.Y, b.Y, c.Y) - padding;
            outPlane.PlaneBounds.min.Z = Mathf.Min(a.Z, b.Z, c.Z) - padding;

            outPlane.PlaneBounds.max.X = Mathf.Max(a.X, b.X, c.X) + padding;
            outPlane.PlaneBounds.max.Y = Mathf.Max(a.Y, b.Y, c.Y) + padding;
            outPlane.PlaneBounds.max.Z = Mathf.Max(a.Z, b.Z, c.Z) + padding;
        }
Example #2
0
 public void Invert()
 {
     Normal.Invert();
     D = -D;
 }
Example #3
0
 public void Invert()
 {
     Normal.Invert();
 }
Example #4
0
 public Vector3D Inverted(Vector3D outVector)
 {
     outVector.Copy(this);
     outVector.Invert();
     return(outVector);
 }
Example #5
0
 public Vector3D Inverted()
 {
     Vector3D inverted = new Vector3D(this);
     inverted.Invert ();
     return inverted;
 }