Namespace: DeltaEngine.Datatypes
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Tests.Datatypes.PlaneTests
3 unit tests call DeltaEngine.Datatypes.Plane.Intersect(DeltaEngine.Datatypes.Ray)
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- ray
- Type: DeltaEngine.Datatypes Ray
Return Value
Type: Nullable Vector3DRemarks
Examples
[Test] public void RayPlaneIntersect() { VerifyIntersectPoint(new Ray(Vector3D.UnitZ, -Vector3D.UnitZ), new Plane(Vector3D.UnitZ, 3.0f), -Vector3D.UnitZ * 3.0f); VerifyIntersectPoint(new Ray(3 * Vector3D.One, -Vector3D.One), new Plane(Vector3D.UnitY, Vector3D.One), Vector3D.One); }
[Test] public void RayPointingAwayFromPlaneDoesntIntersect() { var ray = new Ray(3 * Vector3D.One, Vector3D.One); var plane = new Plane(Vector3D.UnitY, Vector3D.One); Assert.IsNull(plane.Intersect(ray)); }
[Test] public void RayParallelToPlaneDoesntIntersect() { var ray = new Ray(Vector3D.One, Vector3D.UnitZ); var plane = new Plane(Vector3D.UnitY, Vector3D.Zero); Assert.IsNull(plane.Intersect(ray)); }
See Also