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
DeltaEngine.Rendering2D SimplePhysics
Namespace: DeltaEngine.Rendering2D
Assembly: DeltaEngine.Rendering2D (in DeltaEngine.Rendering2D.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The SimplePhysics type exposes the following members.
Constructors
Name | Description | |
---|---|---|
SimplePhysics | Initializes a new instance of the SimplePhysics class |
Remarks
Examples
[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