Entity3D Orientation Property Delta Engine Documentation

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

public Quaternion Orientation { get; set; }

Property Value

Type: Quaternion
Remarks

Tests: DeltaEngine.GameLogic.Tests.ProjectileTests
Examples

2 unit tests call DeltaEngine.Rendering3D.Entity3D.Orientation
[Test, CloseAfterFirstFrame]
public void PositionAndRotationOfProjectileAlsoModifiesParticleSystem()
{
    projectile.Children[0].RelativePosition = Vector3D.UnitX;
    projectile.Orientation = Quaternion.FromAxisAngle(-Vector3D.UnitZ, 90);
    projectile.Position = Vector3D.UnitY;
    Assert.AreEqual(Quaternion.FromAxisAngle(-Vector3D.UnitZ, 90),
        projectile.Children[0].Orientation);
    Assert.AreEqual(0, projectile.Children[0].Position.X, 0.0001f);
    Assert.AreEqual(0, projectile.Children[0].Position.Y, 0.0001f);
    Assert.AreEqual(0, projectile.Children[0].Position.Z, 0.0001f);
}
[Test, CloseAfterFirstFrame]
public void WithoutParentLocalEqualsGlobal()
{
    projectile.UpdateGlobalsFromParent(null);
    projectile.RelativeOrientation = Quaternion.Identity;
    Assert.AreEqual(Quaternion.Identity, projectile.Orientation);
    Assert.AreEqual(projectile.RelativePosition, projectile.Position);
}
See Also