Inheritance Hierarchy
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
The Projectile type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | Projectile(Actor3D, Actor3D, HierarchyObject3D) | Initializes a new instance of the Projectile class |
![]() | Projectile(Vector3D, Vector3D, HierarchyObject3D, Single, Single, Action) | Initializes a new instance of the Projectile class |
Methods
Fields
Name | Description | |
---|---|---|
![]() | components | (Inherited from Entity.) |
![]() | lastOrientation | (Inherited from Entity3D.) |
![]() | lastPosition | (Inherited from Entity3D.) |
![]() | lastTickLerpComponents |
Each element can either be a Lerp, a Lerp List or an array of Lerp objects.
View code on GitHub (Inherited from DrawableEntity.) |
Properties
Name | Description | |
---|---|---|
![]() | Children | (Inherited from HierarchyEntity3D.) |
![]() | Elapsed | (Inherited from PhysicalEntity3D.) |
![]() | IsActive | (Inherited from HierarchyEntity3D.) |
![]() | IsPauseable | (Inherited from Entity.) |
![]() | IsVisible | (Inherited from DrawableEntity.) |
![]() | LifeTime | (Inherited from PhysicalEntity3D.) |
![]() | Mass | (Inherited from PhysicalEntity3D.) |
![]() | Missile | |
![]() | NumberOfComponents | (Inherited from Entity.) |
![]() | Orientation | (Inherited from Entity3D.) |
![]() | Owner | |
![]() | Parent | (Inherited from HierarchyEntity3D.) |
![]() | PhysicsBody | (Inherited from PhysicalEntity3D.) |
![]() | Position | (Inherited from Entity3D.) |
![]() | RelativeOrientation | (Inherited from HierarchyEntity3D.) |
![]() | RelativePosition | (Inherited from HierarchyEntity3D.) |
![]() | RenderLayer | (Inherited from DrawableEntity.) |
![]() | RotationAxis | (Inherited from PhysicalEntity3D.) |
![]() | RotationSpeed | (Inherited from PhysicalEntity3D.) |
![]() | Scale | (Inherited from Entity3D.) |
![]() | Target | |
![]() | UpdatePriority | (Inherited from Entity.) |
![]() | Velocity | (Inherited from PhysicalEntity3D.) |
Events
Name | Description | |
---|---|---|
![]() | OnLifeTimeExceeded | (Inherited from PhysicalEntity3D.) |
Remarks
Examples
[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