pub struct Model { /* private fields */ }Expand description
A GLTF model loaded by the server.
Implementations§
Source§impl Model
impl Model
pub fn create( spatial_parent: &impl SpatialRefAspect, transform: Transform, model: &ResourceID, ) -> NodeResult<Self>
pub fn part(&self, relative_path: &str) -> NodeResult<ModelPart>
Source§impl Model
impl Model
pub fn as_spatial(self) -> Spatial
pub fn as_spatial_ref(self) -> SpatialRef
Trait Implementations§
Source§impl ModelAspect for Model
impl ModelAspect for Model
Source§fn bind_model_part(&self, id: u64, part_path: &str) -> NodeResult<ModelPart>
fn bind_model_part(&self, id: u64, part_path: &str) -> NodeResult<ModelPart>
Bind a model part to the node with the ID input.
Source§impl NodeType for Model
impl NodeType for Model
Source§impl OwnedAspect for Model
impl OwnedAspect for Model
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 Model
impl SpatialAspect for Model
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 Model
impl SpatialRefAspect for Model
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 Model
Auto Trait Implementations§
impl Freeze for Model
impl !RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl !UnwindSafe for Model
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