SimplePhysics ClassDelta Engine Documentation
Groups various simple "physics" effects that can be applied to Entities. These do neither use actual physics functionality nor provide interaction to objects that do, but can prove to be a more efficient solution if just aiming for plain movement of sprites. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Rendering2D SimplePhysics

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

public class SimplePhysics

The SimplePhysics type exposes the following members.

Constructors

  NameDescription
Public methodSimplePhysics
Initializes a new instance of the SimplePhysics class
Top
Remarks

Tests: DeltaEngine.Rendering2D.Tests.SimplePhysicsTests
Examples

12 unit tests call DeltaEngine.Rendering2D.SimplePhysics
[Test, CloseAfterFirstFrame]
public void FallingEffectIsRemovedAfterOneSecond()
{
    var sprite = CreateFallingSpriteWhichExpires();
    CheckFallingEffectStateAfterOneSecond(sprite);
}
[Test]
public void RenderSlowlyFallingLogo()
{
    var sprite = new Sprite(new Material(ShaderFlags.Position2DTextured, "DeltaEngineLogo"),
        screenCenter);
    sprite.Add(new SimplePhysics.Data
    {
        Velocity = new Vector2D(0.0f, -0.3f),
        RotationSpeed = 100.0f,
        Gravity = new Vector2D(0.0f, 0.1f),
    });
    sprite.Color = Color.Red;
    sprite.Start<SimplePhysics.Move>();
}
[Test]
public void RenderFallingCircle()
{
    var ellipse = new Ellipse(Vector2D.Half, 0.1f, 0.1f, Color.Blue);
    ellipse.Add(new SimplePhysics.Data
    {
        Velocity = new Vector2D(0.1f, -0.1f),
        Gravity = new Vector2D(0.0f, 0.1f)
    });
    ellipse.Start<SimplePhysics.Move>();
}
See Also