Expand description
euv-engine
A high-performance 2D and 3D game engine built on the euv framework for WebAssembly, featuring an ECS-style entity system, fixed-timestep game loop, canvas rendering, physics simulation, collision detection, sprite animation, scene management, asset loading, and Web Audio integration.
Structs§
- AABB3D
- A 3D axis-aligned bounding box defined by its minimum and maximum corners.
- Aabb
Collider - An axis-aligned bounding box collider wrapping a
Rect. - Aabb
Collider3D - A 3D axis-aligned bounding box collider wrapping an
AABB3D. - Animator
- Manages the playback state of sprite animations.
- Asset
Cache - A cache for storing loaded game assets, keyed by URL.
- Asset
Entry - An entry in the asset cache containing the loaded data and its state.
- Asset
Loader - An asynchronous asset loader that fetches resources over HTTP
and populates a shared
AssetCache. - Audio
Clip - An audio clip wrapping a decoded
AudioBufferwith playback control. - Camera2D
- A 2D camera that defines the viewport into the game world.
- Camera3D
- A 3D camera that defines the viewport into a 3D world using perspective or orthographic projection.
- Canvas
Renderer - A wrapper around
CanvasRenderingContext2dproviding convenience drawing methods and camera management for the game engine. - Circle
- A circle defined by its center point and radius.
- Circle
Collider - A circle collider wrapping a
Circle. - Collision
Result - The result of a collision check between two colliders, containing the contact normal and penetration depth if they overlap.
- Collision
Result3D - The result of a collision check between two 3D colliders, containing the contact normal and penetration depth if they overlap.
- Color
- A color represented by red, green, blue, and alpha channels in the range 0.0 to 1.0.
- Entity
- The fundamental entity in the engine, combining a transform with a collection of behavior-defining components.
- Event
Bus - A publish-subscribe event bus for decoupled inter-entity communication.
- Game
Audio Context - A wrapper around the Web Audio API
AudioContextproviding game engine audio playback and volume management. - Input
- A zero-sized namespace struct providing static input event extraction methods.
- Input
State - Tracks the current state of all input devices (keyboard, mouse, touch) for a single game frame. The state should be updated by event handlers and cleared of per-frame data at the end of each frame.
- Linear
Gradient - A linear gradient defined by two endpoints and a list of color stops.
- Matrix4x4
- A 4x4 matrix stored in column-major order, used for 3D transformations.
- Numeric
- A zero-sized namespace struct providing static math utility methods.
- Physics
Config - Configuration parameters for the physics world simulation.
- Physics
Config3D - Configuration parameters for the 3D physics world simulation.
- Physics
World2D - The physics world managing all rigid bodies and simulation steps.
- Physics
World3D - The 3D physics world managing all rigid bodies and simulation steps.
- Plane
- A 3D plane defined by a normal vector and a distance from the origin.
- Quaternion
- A quaternion representing a 3D rotation with
x,y,z, andwcomponents. - Radial
Gradient - A radial gradient defined by inner and outer circles and a list of color stops.
- Ray3D
- A 3D ray defined by an origin point and a direction vector.
- Rect
- An axis-aligned rectangle defined by its top-left corner and dimensions.
- Render
Layer - Represents the rendering priority layer for draw call ordering.
- Rigid
Body2D - A 2D rigid body participating in the physics simulation.
- Rigid
Body3D - A 3D rigid body participating in the physics simulation.
- Scene
Manager - Manages scene registration, transitions, and lifecycle.
- Scheduler
Config - Configuration parameters for the fixed-timestep scheduler.
- Scheduler
Handle - A handle to a running scheduler, allowing the caller to stop it later.
- Shadow
Config - Shadow rendering configuration for drop shadow effects on canvas primitives.
- Spatial
Hash Grid2D - A uniform-grid spatial hash for broad-phase collision culling in 2D.
- Spatial
Hash Grid3D - A uniform-grid spatial hash for broad-phase collision culling in 3D.
- Sphere
- A 3D sphere defined by its center point and radius.
- Sphere
Collider3D - A 3D sphere collider wrapping a
Sphere. - Sprite
Animation - A named sequence of frames that form an animation.
- Sprite
Frame - Defines a single frame in a sprite animation.
- Sprite
Sheet - Defines a sprite sheet with uniform frame grid dimensions.
- Ssaa
Canvas - A supersampling anti-aliasing (SSAA) canvas wrapper that renders at a higher resolution on an offscreen canvas and downscales to the display canvas for smoother polygon edges in software-rendered 3D scenes.
- Transform2D
- A 2D transform composed of position, rotation (in radians), and scale.
- Transform3D
- A 3D transform composed of position, rotation (as a quaternion), and scale.
- Vector2D
- A 2D vector with
xandycomponents represented asf64. - Vector3D
- A 3D vector with
x,y, andzcomponents represented asf64.
Enums§
- Animation
Mode - Defines how an animation behaves when it reaches the last frame.
- Animation
State - Represents the current playback state of an animation.
- Asset
State - Represents the loading state of an asset in the cache.
- Asset
Type - Categorizes the type of a game asset for appropriate loading and storage.
- Audio
Play State - Represents the playback state of an audio clip.
- Blend
Mode - Defines how new pixels are composited with existing pixels on the canvas.
- Body
Collider - Wraps the concrete collider shape data attached to a rigid body.
- Body
Collider3D - Wraps the concrete 3D collider shape data attached to a 3D rigid body.
- Body
Type - Defines how a rigid body participates in the physics simulation.
- Collider
Shape - Represents the geometric shape of a collider.
- Collider
Shape3D - Represents the geometric shape of a 3D collider.
- Entity
Event - Events that can be emitted by entities for inter-entity communication.
- Input
Action - Represents a high-level input action category.
- Mouse
Button - Represents a standard mouse button identifier.
Constants§
- DEG_
TO_ RAD - Conversion factor from degrees to radians.
- EPSILON
- A small epsilon value used for floating-point comparisons.
- HALF_PI
- Half of pi, a quarter circle angle in radians (~1.57079).
- PI
- The mathematical constant pi (~3.14159).
- RAD_
TO_ DEG - Conversion factor from radians to degrees.
- TWO_PI
- Two times pi, the full circle angle in radians (~6.28318).
Traits§
- Collider
- A trait for objects that can participate in collision detection.
- Collider3D
- A trait for 3D objects that can participate in collision detection.
- Component
- The base trait for all entity components.
- Interpolable
- A trait for types that support linear interpolation between two values.
- Render
Backend - An abstract rendering backend that decouples draw calls from the concrete canvas API, enabling future backends such as WebGL or WebGPU.
- Renderable
- A trait for objects that can be rendered onto a canvas.
- Scene
- The base trait for all game scenes.
- Tick
Handler - The trait that game implementations must fulfill to receive fixed-timestep update and interpolated render callbacks from the scheduler.
Type Aliases§
- Asset
Closures - A reference-counted, interior-mutable list of asset load callbacks.
- Cell
Entries - A list of body indices stored within a single grid cell.
- Cell
Key2D - A grid cell key for 2D spatial partitioning, combining x and y indices.
- Cell
Key3D - A grid cell key for 3D spatial partitioning, combining x, y, and z indices.
- Component
Rc - A reference-counted, interior-mutable handle to a
dyn Componenttrait object. - Entity
Rc - A reference-counted, interior-mutable handle to an
Entity. - Event
Handler - A handler function that processes an
EntityEvent. - Event
Handlers - A map from event name to the list of registered handler closures.
- KeyState
Set - A set of keyboard key code strings currently in a given state.
- RafClosure
Cell - A reference-counted closure cell used to keep the
requestAnimationFrameclosure alive. - SceneRc
- A reference-counted, interior-mutable scene trait object.
- Spatial
Cell Map2D - A hash map from 2D cell keys to lists of body indices.
- Spatial
Cell Map3D - A hash map from 3D cell keys to lists of body indices.
- Tick
Handler Rc - A reference-counted, interior-mutable tick handler.
- Touch
Point Map - A map from touch identifier to touch position.