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.DatatypesAssembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Plane type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Plane(Vector3D, Vector3D) | Initializes a new instance of the Plane class | |
Plane(Vector3D, Single) | Initializes a new instance of the Plane class |
Methods
Name | Description | |
---|---|---|
Equals | ||
Intersect |
Properties
Name | Description | |
---|---|---|
Distance | ||
Normal |
Remarks
Examples
[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