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§
Sourceasync fn get_local_bounding_box(&self) -> NodeResult<BoundingBox>
async fn get_local_bounding_box(&self) -> NodeResult<BoundingBox>
Get the bounding box of this spatial and its children relative to another spatial
Sourceasync fn get_relative_bounding_box(
&self,
relative_to: &impl SpatialRefAspect,
) -> NodeResult<BoundingBox>
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
Sourceasync fn get_transform(
&self,
relative_to: &impl SpatialRefAspect,
) -> NodeResult<Transform>
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.