SpatialRefAspect

Trait SpatialRefAspect 

Source
pub trait SpatialRefAspect: NodeType + Debug {
    // Provided methods
    async fn get_local_bounding_box(&self) -> NodeResult<BoundingBox> { ... }
    async fn get_relative_bounding_box(
        &self,
        relative_to: &impl SpatialRefAspect,
    ) -> NodeResult<BoundingBox> { ... }
    async fn get_transform(
        &self,
        relative_to: &impl SpatialRefAspect,
    ) -> NodeResult<Transform> { ... }
}
Expand description

A reference to a node with spatial attributes (position, rotation, scale).

Equivalent to a Transform in Unity, Spatial in Godot, etc.

Provided Methods§

Source

async fn get_local_bounding_box(&self) -> NodeResult<BoundingBox>

Get the bounding box of this spatial and its children relative to another spatial

Source

async fn get_relative_bounding_box( &self, relative_to: &impl SpatialRefAspect, ) -> NodeResult<BoundingBox>

Get the bounding box of this spatial and its children relative to itself

Source

async fn get_transform( &self, relative_to: &impl SpatialRefAspect, ) -> NodeResult<Transform>

Get the transform relative to some other spatial node.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§