Skip to main content

Crate euv_engine

Crate euv_engine 

Source
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.
AabbCollider
An axis-aligned bounding box collider wrapping a Rect.
AabbCollider3D
A 3D axis-aligned bounding box collider wrapping an AABB3D.
Animator
Manages the playback state of sprite animations.
AssetCache
A cache for storing loaded game assets, keyed by URL.
AssetEntry
An entry in the asset cache containing the loaded data and its state.
AssetLoader
An asynchronous asset loader that fetches resources over HTTP and populates a shared AssetCache.
AudioClip
An audio clip wrapping a decoded AudioBuffer with 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.
CanvasRenderer
A wrapper around CanvasRenderingContext2d providing convenience drawing methods and camera management for the game engine.
Circle
A circle defined by its center point and radius.
CircleCollider
A circle collider wrapping a Circle.
CollisionResult
The result of a collision check between two colliders, containing the contact normal and penetration depth if they overlap.
CollisionResult3D
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.
EventBus
A publish-subscribe event bus for decoupled inter-entity communication.
GameAudioContext
A wrapper around the Web Audio API AudioContext providing game engine audio playback and volume management.
Input
A zero-sized namespace struct providing static input event extraction methods.
InputState
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.
LinearGradient
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.
PhysicsConfig
Configuration parameters for the physics world simulation.
PhysicsConfig3D
Configuration parameters for the 3D physics world simulation.
PhysicsWorld2D
The physics world managing all rigid bodies and simulation steps.
PhysicsWorld3D
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, and w components.
RadialGradient
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.
RenderLayer
Represents the rendering priority layer for draw call ordering.
RigidBody2D
A 2D rigid body participating in the physics simulation.
RigidBody3D
A 3D rigid body participating in the physics simulation.
SceneManager
Manages scene registration, transitions, and lifecycle.
SchedulerConfig
Configuration parameters for the fixed-timestep scheduler.
SchedulerHandle
A handle to a running scheduler, allowing the caller to stop it later.
ShadowConfig
Shadow rendering configuration for drop shadow effects on canvas primitives.
SpatialHashGrid2D
A uniform-grid spatial hash for broad-phase collision culling in 2D.
SpatialHashGrid3D
A uniform-grid spatial hash for broad-phase collision culling in 3D.
Sphere
A 3D sphere defined by its center point and radius.
SphereCollider3D
A 3D sphere collider wrapping a Sphere.
SpriteAnimation
A named sequence of frames that form an animation.
SpriteFrame
Defines a single frame in a sprite animation.
SpriteSheet
Defines a sprite sheet with uniform frame grid dimensions.
SsaaCanvas
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 x and y components represented as f64.
Vector3D
A 3D vector with x, y, and z components represented as f64.

Enums§

AnimationMode
Defines how an animation behaves when it reaches the last frame.
AnimationState
Represents the current playback state of an animation.
AssetState
Represents the loading state of an asset in the cache.
AssetType
Categorizes the type of a game asset for appropriate loading and storage.
AudioPlayState
Represents the playback state of an audio clip.
BlendMode
Defines how new pixels are composited with existing pixels on the canvas.
BodyCollider
Wraps the concrete collider shape data attached to a rigid body.
BodyCollider3D
Wraps the concrete 3D collider shape data attached to a 3D rigid body.
BodyType
Defines how a rigid body participates in the physics simulation.
ColliderShape
Represents the geometric shape of a collider.
ColliderShape3D
Represents the geometric shape of a 3D collider.
EntityEvent
Events that can be emitted by entities for inter-entity communication.
InputAction
Represents a high-level input action category.
MouseButton
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.
RenderBackend
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.
TickHandler
The trait that game implementations must fulfill to receive fixed-timestep update and interpolated render callbacks from the scheduler.

Type Aliases§

AssetClosures
A reference-counted, interior-mutable list of asset load callbacks.
CellEntries
A list of body indices stored within a single grid cell.
CellKey2D
A grid cell key for 2D spatial partitioning, combining x and y indices.
CellKey3D
A grid cell key for 3D spatial partitioning, combining x, y, and z indices.
ComponentRc
A reference-counted, interior-mutable handle to a dyn Component trait object.
EntityRc
A reference-counted, interior-mutable handle to an Entity.
EventHandler
A handler function that processes an EntityEvent.
EventHandlers
A map from event name to the list of registered handler closures.
KeyStateSet
A set of keyboard key code strings currently in a given state.
RafClosureCell
A reference-counted closure cell used to keep the requestAnimationFrame closure alive.
SceneRc
A reference-counted, interior-mutable scene trait object.
SpatialCellMap2D
A hash map from 2D cell keys to lists of body indices.
SpatialCellMap3D
A hash map from 3D cell keys to lists of body indices.
TickHandlerRc
A reference-counted, interior-mutable tick handler.
TouchPointMap
A map from touch identifier to touch position.