Projectile ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    DeltaEngine.Entities DrawableEntity
      DeltaEngine.Rendering3D Entity3D
        DeltaEngine.Rendering3D HierarchyEntity3D
          DeltaEngine.Physics3D PhysicalEntity3D
            DeltaEngine.GameLogic Projectile

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

public class Projectile : PhysicalEntity3D

The Projectile type exposes the following members.

Constructors

  NameDescription
Public methodProjectile(Actor3D, Actor3D, HierarchyObject3D)
Initializes a new instance of the Projectile class
Public methodProjectile(Vector3D, Vector3D, HierarchyObject3D, Single, Single, Action)
Initializes a new instance of the Projectile class
Top
Methods

  NameDescription
Public methodAdd(HierarchyObject3D) (Inherited from HierarchyEntity3D.)
Public methodAdd T (T) (Inherited from Entity3D.)
Public methodAddTag (Inherited from Entity.)
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity3D.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from PhysicalEntity3D.)
Public methodGet T  (Inherited from Entity3D.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Protected methodGetComponentsForSaving (Inherited from Entity3D.)
Protected methodGetDrawBehaviors (Inherited from DrawableEntity.)
Public methodGetFirstChildOfType T  (Inherited from HierarchyEntity3D.)
Public methodGetInterpolatedArray T  (Inherited from DrawableEntity.)
Public methodGetInterpolatedList T  (Inherited from DrawableEntity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Protected methodNextUpdateStarted (Inherited from Entity3D.)
Public methodOnDraw T  (Inherited from DrawableEntity.)
Protected methodOnOrientationChanged (Inherited from HierarchyEntity3D.)
Protected methodOnPositionChanged (Inherited from HierarchyEntity3D.)
Protected methodOnScaleChanged (Inherited from HierarchyEntity3D.)
Public methodRemove(HierarchyObject3D) (Inherited from HierarchyEntity3D.)
Public methodRemove T   (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodSet (Inherited from Entity3D.)
Public methodSetComponents (Inherited from Entity.)
Public methodSetWithoutInterpolation T  (Inherited from Entity3D.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToggleVisibility (Inherited from DrawableEntity.)
Public methodToString (Inherited from Entity.)
Public methodUpdate (Inherited from PhysicalEntity3D.)
Public methodUpdateGlobalsFromParent (Inherited from HierarchyEntity3D.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Protected fieldlastOrientation (Inherited from Entity3D.)
Protected fieldlastPosition (Inherited from Entity3D.)
Protected fieldlastTickLerpComponents
Each element can either be a Lerp, a Lerp List or an array of Lerp objects. View code on GitHub
(Inherited from DrawableEntity.)
Top
Properties

  NameDescription
Public propertyChildren (Inherited from HierarchyEntity3D.)
Public propertyElapsed (Inherited from PhysicalEntity3D.)
Public propertyIsActive (Inherited from HierarchyEntity3D.)
Public propertyIsPauseable (Inherited from Entity.)
Public propertyIsVisible (Inherited from DrawableEntity.)
Public propertyLifeTime (Inherited from PhysicalEntity3D.)
Public propertyMass (Inherited from PhysicalEntity3D.)
Public propertyMissile
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyOrientation (Inherited from Entity3D.)
Public propertyOwner
Public propertyParent (Inherited from HierarchyEntity3D.)
Public propertyPhysicsBody (Inherited from PhysicalEntity3D.)
Public propertyPosition (Inherited from Entity3D.)
Public propertyRelativeOrientation (Inherited from HierarchyEntity3D.)
Public propertyRelativePosition (Inherited from HierarchyEntity3D.)
Public propertyRenderLayer (Inherited from DrawableEntity.)
Public propertyRotationAxis (Inherited from PhysicalEntity3D.)
Public propertyRotationSpeed (Inherited from PhysicalEntity3D.)
Public propertyScale (Inherited from Entity3D.)
Public propertyTarget
Public propertyUpdatePriority (Inherited from Entity.)
Public propertyVelocity (Inherited from PhysicalEntity3D.)
Top
Events

  NameDescription
Public eventOnLifeTimeExceeded (Inherited from PhysicalEntity3D.)
Top
Remarks

Tests: DeltaEngine.GameLogic.Tests.ProjectileTests
Examples

7 unit tests call DeltaEngine.GameLogic.Projectile
[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);
}
[Test, CloseAfterFirstFrame]
public void RotatePhysicsProjectileWithSpeed()
{
    projectile.RotationAxis = Vector3D.UnitZ;
    projectile.RotationSpeed = 60.0f;
    AdvanceTimeAndUpdateEntities();
    var expectedRotation = Quaternion.FromAxisAngle(Vector3D.UnitZ,
        60.0f / Settings.Current.UpdatesPerSecond);
    Assert.AreEqual(expectedRotation.W, projectile.Orientation.W, 0.001f);
    Assert.AreEqual(expectedRotation.X, projectile.Orientation.X, 0.001f);
    Assert.AreEqual(expectedRotation.Y, projectile.Orientation.Y, 0.001f);
    Assert.AreEqual(expectedRotation.Z, projectile.Orientation.Z, 0.01f);
}
See Also