pub struct Spatial { /* private fields */ }Expand description
A node with spatial attributes (position, rotation, scale) that can be manipulated by zones if zoneable.
Equivalent to a Transform in Unity, Spatial in Godot, etc.
Implementations§
Source§impl Spatial
impl Spatial
pub fn as_spatial_ref(self) -> SpatialRef
Source§impl Spatial
impl Spatial
pub fn create( spatial_parent: &impl SpatialRefAspect, transform: Transform, zoneable: bool, ) -> NodeResult<Self>
Trait Implementations§
Source§impl NodeType for Spatial
impl NodeType for Spatial
Source§impl OwnedAspect for Spatial
impl OwnedAspect for Spatial
Source§fn set_enabled(&self, enabled: bool) -> NodeResult<()>
fn set_enabled(&self, enabled: bool) -> NodeResult<()>
Set if this node is enabled or not. Disabled drawables won’t render, input handlers won’t receive input, etc.
Source§fn destroy(&self) -> NodeResult<()>
fn destroy(&self) -> NodeResult<()>
Destroy this node immediately. Not all nodes will have this method, those that don’t can be dropped client-side without issue.
Source§impl SpatialAspect for Spatial
impl SpatialAspect for Spatial
Source§fn set_local_transform(&self, transform: Transform) -> NodeResult<()>
fn set_local_transform(&self, transform: Transform) -> NodeResult<()>
Set the transform of this spatial relative to its spatial parent.
Source§fn set_relative_transform(
&self,
relative_to: &impl SpatialRefAspect,
transform: Transform,
) -> NodeResult<()>
fn set_relative_transform( &self, relative_to: &impl SpatialRefAspect, transform: Transform, ) -> NodeResult<()>
Set the transform of this spatial relative to another node.
Source§fn set_spatial_parent(&self, parent: &impl SpatialRefAspect) -> NodeResult<()>
fn set_spatial_parent(&self, parent: &impl SpatialRefAspect) -> NodeResult<()>
Set the spatial parent with its local transform remaining the same.
It will silently error and not set the spatial parent if it is to a child of itself.
Source§fn set_spatial_parent_in_place(
&self,
parent: &impl SpatialRefAspect,
) -> NodeResult<()>
fn set_spatial_parent_in_place( &self, parent: &impl SpatialRefAspect, ) -> NodeResult<()>
Set the spatial parent with its “global” transform remaining the same.
It will silently error and not set the spatial parent if it is to a child of itself.
Source§fn set_zoneable(&self, zoneable: bool) -> NodeResult<()>
fn set_zoneable(&self, zoneable: bool) -> NodeResult<()>
Set if this spatial is zoneable or not.
You may want to set this to false when being grabbed or interacted with, then back to true when it’s floating inert in space.
Source§async fn export_spatial(&self) -> NodeResult<u64>
async fn export_spatial(&self) -> NodeResult<u64>
Return a UUID representing this node’s SpatialRef that you can send to other clients
Source§impl SpatialRefAspect for Spatial
impl SpatialRefAspect for Spatial
Source§async 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
Source§async 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
Source§async 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.
impl Eq for Spatial
Auto Trait Implementations§
impl Freeze for Spatial
impl !RefUnwindSafe for Spatial
impl Send for Spatial
impl Sync for Spatial
impl Unpin for Spatial
impl !UnwindSafe for Spatial
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more