Plane StructureDelta Engine Documentation
Plane struct represented by a normal vector and a distance from the origin. Details can be found at: http://en.wikipedia.org/wiki/Plane_%28geometry%29 View code on GitHub

Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public struct Plane : IEquatable<Plane>

The Plane type exposes the following members.

Constructors

  NameDescription
Public methodPlane(Vector3D, Vector3D)
Initializes a new instance of the Plane class
Public methodPlane(Vector3D, Single)
Initializes a new instance of the Plane class
Top
Methods

  NameDescription
Public methodEquals
Public methodIntersect
Top
Properties

  NameDescription
Public propertyDistance
Public propertyNormal
Top
Remarks

Tests: DeltaEngine.Tests.Datatypes.PlaneTests
Examples

6 unit tests call DeltaEngine.Datatypes.Plane
[Test]
public void EqualityOfPlanes()
{
    const float Distance = 4.0f;
    Assert.AreEqual(new Plane(Vector3D.UnitZ, Distance), new Plane(Vector3D.UnitZ, Distance));
    Assert.AreNotEqual(new Plane(Vector3D.UnitZ, Distance), new Plane(Vector3D.UnitZ, 1));
    Assert.AreNotEqual(new Plane(Vector3D.UnitZ, Distance), new Plane(Vector3D.UnitX, Distance));
}
[Test]
public void CreatePlaneFromDistance()
{
    var plane = new Plane(Vector3D.UnitY, 1.0f);
    Assert.AreEqual(Vector3D.UnitY, plane.Normal);
    Assert.AreEqual(1.0f, plane.Distance);
}
[Test]
public void CreatePlaneFromPointOnPlane()
{
    var plane = new Plane(Vector3D.UnitY, new Vector3D(0, 1, 0));
    Assert.AreEqual(Vector3D.UnitY, plane.Normal);
    Assert.AreEqual(-1.0f, plane.Distance);
}
See Also