Module ambient_api::global
source · Expand description
Global functions and types for your convenience.
Modules
- glam
- Serde
Structs
- A 2D affine transform, which can represent translation, rotation, scaling and shear.
- A 3D affine transform, which can represent translation, rotation, scaling and shear.
- A
Duration
type to represent a span of time, typically used for system timeouts. - An identifier for an entity in the world.
- A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- A 2x2 column major matrix.
- A 3x3 column major matrix.
- A 3x3 column major matrix.
- A 4x4 column major matrix.
- Represents the current state of the keyboard modifiers
- Procedural storage handle type
- Procedural storage handle type
- Procedural storage handle type
- Procedural storage handle type
- A quaternion representing an orientation.
- Ray represented by an origin and a direction
- A wrapper for
Arc<RwLock<T>>
to simplify passing complex state around callbacks. - A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- A Ulid is a unique 128-bit lexicographically sortable identifier
- A 2-dimensional vector.
- A 3-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
Enums
- Describes the appearance of the mouse cursor.
- Symbolic name for a keyboard key.
Constants
- The default “happy path” value for an ResultEmpty. You can return this from a handler to signal that there are no issues.
Traits
- A trait that abstracts over return types so that you can return an ResultEmpty or nothing.
- A future represents an asynchronous computation obtained by use of
async
. - An extension trait for
Future
s that provides a variety of convenient adapters.
Functions
- Stops execution of this function until the provided
condition
is true. Useful for waiting for something to happen in the game world. - Helper function that returns the Default for the type
T
. Most useful with struct update syntax, or with initializing components. - The length of the previous frame, in seconds.
- The time, relative to Jan 1, 1970. Not guaranteed to be monotonic. Use game_time for most applications.
- Runs
callback
at most everydt
. The actual time taken is passed tocallback
. - The time, relative to the start of the game. Guaranteed to be monotonic.
- Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Lerp (linear-interpolate) between any two values that support addition and multiplication.
- Creates a 2x2 matrix from two column vectors.
- Creates a 3x3 matrix from three column vectors.
- Creates a 3x3 matrix from three column vectors.
- Creates a 4x4 matrix from four column vectors.
- Creates a quaternion from
x
,y
,z
andw
values. - Runs the given async block (
future
). This lets your module set up behaviour to run concurrently, like a long-running task. It can return either a ResultEmpty or nothing. - Stops execution of this function until
seconds
has passed. - Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Stops execution of this function until one of the given
RuntimeMessage
sare received. Theis_relevant
functions are used to filter out messages that are not relevant. - Stops execution of this function until the given
RuntimeMessage
is received. Theis_relevant
function is used to filter out messages that are not relevant.
Type Aliases
- In Rust, functions that can fail are expected to return a Result type. ResultEmpty is a Result type that has no value and can accept any kind of error through the question-mark operator
?
.