Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Rendering3D.Shapes.Tests Line3DTests
Namespace: DeltaEngine.Rendering3D.Shapes.Tests
Assembly: DeltaEngine.Rendering3D.Shapes.Tests (in DeltaEngine.Rendering3D.Shapes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Line3DTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Line3DTests | Initializes a new instance of the Line3DTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CreateLine3D | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
RenderCoordinateSystemCross | ||
RenderGrid | ||
RenderingHiddenLineDoesNotThrowException | ||
RenderRedLine | ||
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SetLine3DPointList | ||
SetLine3DPoints |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void RenderCoordinateSystemCross() { CreateLookAtCamera(Vector3D.One * 4.0f, Vector3D.Zero); new Line3D(-Vector3D.UnitX, Vector3D.UnitX * 3, Color.Red); new Line3D(-Vector3D.UnitY, Vector3D.UnitY * 3, Color.Green); new Line3D(-Vector3D.UnitZ, Vector3D.UnitZ * 3, Color.Blue); }
[Test] public void RenderGrid() { const int GridSize = 10; const float GridScale = 0.5f; const float HalfGridSize = GridSize * 0.5f; var axisXz = new Vector2D(-HalfGridSize, -HalfGridSize); CreateLookAtCamera(Vector3D.One * 4.0f, Vector3D.Zero); for (int i = 0; i <= GridSize; i++, axisXz.X += 1, axisXz.Y += 1) { new Line3D(new Vector3D(-HalfGridSize * GridScale, axisXz.Y * GridScale, 0.0f), new Vector3D(HalfGridSize * GridScale, axisXz.Y * GridScale, 0.0f), Color.White); new Line3D(new Vector3D(axisXz.X * GridScale, -HalfGridSize * GridScale, 0.0f), new Vector3D(axisXz.X * GridScale, HalfGridSize * GridScale, 0.0f), Color.White); } }
[Test] public void RenderRedLine() { CreateLookAtCamera(Vector3D.UnitY, Vector3D.Zero); new Line3D(-Vector3D.UnitX, Vector3D.UnitX, Color.Red); }
[Test, CloseAfterFirstFrame] public void CreateLine3D() { CreateLookAtCamera(Vector3D.One * 4.0f, Vector3D.Zero); var entity = new Line3D(Vector3D.Zero, Vector3D.One, Color.Red); Assert.AreEqual(Vector3D.Zero, entity.StartPoint); Assert.AreEqual(Vector3D.One, entity.EndPoint); }
[Test, CloseAfterFirstFrame] public void SetLine3DPoints() { CreateLookAtCamera(Vector3D.One * 4.0f, Vector3D.Zero); var entity = new Line3D(Vector3D.Zero, Vector3D.Zero, Color.Red) { StartPoint = Vector3D.UnitX, EndPoint = Vector3D.UnitY }; Assert.AreEqual(Vector3D.UnitX, entity.StartPoint); Assert.AreEqual(Vector3D.UnitY, entity.EndPoint); }
[Test, CloseAfterFirstFrame] public void SetLine3DPointList() { CreateLookAtCamera(Vector3D.One * 4.0f, Vector3D.Zero); var entity = new Line3D(Vector3D.Zero, Vector3D.Zero, Color.Red) { Points = new List<Vector3D> { Vector3D.UnitZ, Vector3D.UnitY } };
[Test, CloseAfterFirstFrame] public void RenderingHiddenLineDoesNotThrowException() { Camera.Current.Position = Vector3D.UnitZ; new Line3D(-Vector3D.UnitX, Vector3D.UnitX, Color.Red) { IsVisible = false }; Assert.DoesNotThrow(() => AdvanceTimeAndUpdateEntities()); }
See Also