pub struct ModelPart { /* private fields */ }Expand description
A graphical node in the GLTF hierarchy for the given model. Can be reparented and have material parameters set on.
Implementations§
Source§impl ModelPart
impl ModelPart
pub fn as_spatial(self) -> Spatial
pub fn as_spatial_ref(self) -> SpatialRef
Trait Implementations§
Source§impl ModelPartAspect for ModelPart
impl ModelPartAspect for ModelPart
Source§fn apply_holdout_material(&self) -> NodeResult<()>
fn apply_holdout_material(&self) -> NodeResult<()>
Set this model part’s material to one that cuts a hole in the world. Often used for overlays/passthrough where you want to show the background through an object.
Source§fn set_material_parameter(
&self,
parameter_name: &str,
value: MaterialParameter,
) -> NodeResult<()>
fn set_material_parameter( &self, parameter_name: &str, value: MaterialParameter, ) -> NodeResult<()>
Set the material parameter with
parameter_name to valueSource§impl NodeType for ModelPart
impl NodeType for ModelPart
Source§impl OwnedAspect for ModelPart
impl OwnedAspect for ModelPart
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 ModelPart
impl SpatialAspect for ModelPart
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 ModelPart
impl SpatialRefAspect for ModelPart
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 ModelPart
Auto Trait Implementations§
impl Freeze for ModelPart
impl !RefUnwindSafe for ModelPart
impl Send for ModelPart
impl Sync for ModelPart
impl Unpin for ModelPart
impl !UnwindSafe for ModelPart
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