Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
MovementState.cs
1using System.Numerics;
3
5
11public struct MovementState
12{
19 public MovementSpace MovementSpace { get; private set; }
20
24 public Vector2 Velocity { get; internal set; }
25
29 public Vector2 Acceleration { get; internal set; }
30
34 public float? MaxSpeed { get; internal set; }
35
41 public float LinearDamping { get; internal set; }
42
46 public readonly bool HasMotion => Acceleration != Vector2.Zero || Velocity != Vector2.Zero;
47
52 internal ScriptedMovement Script;
53
60 internal static MovementState ForSceneLayer(float linearDampening = 0f) => new()
61 {
63 LinearDamping = linearDampening
64 };
65
73 internal static MovementState ForPixel(float linearDampening = 0f) => new()
74 {
76 LinearDamping = linearDampening
77 };
78}
MovementSpace
Specifies the coordinate system used for movement calculations and updates.
Represents the current motion state of an IMovable object, including velocity, acceleration,...
Vector2 Velocity
Velocity in current MotionSpace units per second.
Vector2 Acceleration
Acceleration in current MotionSpace units per second^2.
MovementSpace MovementSpace
What unit system these values are expressed in. Grid = tile units; Pixel = screen pixels....
float LinearDamping
Linear damping per second in [0..1]. 0 = no damping. Apply as v *= (1 - LinearDamping * dt) in the co...
float? MaxSpeed
Max speed in current MotionSpace units per second (null = no cap).
readonly bool HasMotion
Gets a value indicating whether the object is in motion.
Represents the state and parameters of a scripted movement operation applied to an object....