Actor InterfaceDelta Engine Documentation
Any game object you want to handle in a game should use this interface. It can be an Entity2D, Entity3D or any other class deriving from Entity. You can access all actors in the world via GetEntitiesOfType T  View code on GitHub

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

public interface Actor

The Actor type exposes the following members.

Methods

  NameDescription
Public methodGetBoundingBox
Public methodGetBoundingSphere
Public methodGetDrawArea
Public methodIs2D
Public methodIsColliding
Public methodRenderModel
Top
Properties

  NameDescription
Public propertyRotationZ
Public propertyScale
Public propertyScaleFactor
Top
Events

  NameDescription
Public eventOrientationChanged
Public eventPositionChanged
Public eventScaleChanged
Top
Remarks

Tests: DeltaEngine.GameLogic.Tests.ActorTests
Examples

10 unit tests call DeltaEngine.GameLogic.Actor
[Test]
public void TestActorSpawnDespawnNotChangeAnything()
{
    var actor = new MockActor(Vector3D.One, 1.0f);
    actor.RenderModel();
    Assert.IsFalse(actor.Is2D());
    Assert.AreEqual(Vector3D.One, actor.Position);
}
[Test]
public void CheckChangePosition()
{
    var actor = new MockActor(Vector3D.One, 1.0f);
    actor.PositionChanged += () => { CheckPositionHasChanged(actor); };
    actor.Position = new Vector3D(2, 2, 2);
}
[Test]
public void CheckChangeScale()
{
    var actor = new MockActor(Vector3D.One, 1.0f);
    actor.ScaleChanged += () => { CheckScaleHasChanged(actor); };
    actor.Scale = new Vector3D(2, 2, 2);
}
See Also