pub struct Field { /* private fields */ }Expand description
A signed distance field with adjustable shape. Replaces colliders.
Implementations§
Source§impl Field
impl Field
pub fn create( spatial_parent: &impl SpatialRefAspect, transform: Transform, shape: Shape, ) -> NodeResult<Self>
Source§impl Field
impl Field
pub fn as_field_ref(self) -> FieldRef
pub fn as_spatial_ref(self) -> SpatialRef
pub fn as_spatial(self) -> Spatial
Trait Implementations§
Source§impl FieldAspect for Field
impl FieldAspect for Field
Source§fn set_shape(&self, shape: Shape) -> NodeResult<()>
fn set_shape(&self, shape: Shape) -> NodeResult<()>
Set the shape of this field (and its parameters)
Source§async fn export_field(&self) -> NodeResult<u64>
async fn export_field(&self) -> NodeResult<u64>
Return a UUID representing this node’s FieldRef that you can send to other clients
Source§impl FieldRefAspect for Field
impl FieldRefAspect for Field
Source§async fn distance(
&self,
space: &impl SpatialRefAspect,
point: impl Into<Vector3<f32>>,
) -> NodeResult<f32>
async fn distance( &self, space: &impl SpatialRefAspect, point: impl Into<Vector3<f32>>, ) -> NodeResult<f32>
Get the distance to the surface of this field relative to the
point in spaceSource§async fn normal(
&self,
space: &impl SpatialRefAspect,
point: impl Into<Vector3<f32>>,
) -> NodeResult<Vector3<f32>>
async fn normal( &self, space: &impl SpatialRefAspect, point: impl Into<Vector3<f32>>, ) -> NodeResult<Vector3<f32>>
Get a vector pointing away from surface of this field relative to the
point in spaceSource§async fn closest_point(
&self,
space: &impl SpatialRefAspect,
point: impl Into<Vector3<f32>>,
) -> NodeResult<Vector3<f32>>
async fn closest_point( &self, space: &impl SpatialRefAspect, point: impl Into<Vector3<f32>>, ) -> NodeResult<Vector3<f32>>
Get the closest point on the surface of this field relative to the
point in spaceSource§async fn ray_march(
&self,
space: &impl SpatialRefAspect,
ray_origin: impl Into<Vector3<f32>>,
ray_direction: impl Into<Vector3<f32>>,
) -> NodeResult<RayMarchResult>
async fn ray_march( &self, space: &impl SpatialRefAspect, ray_origin: impl Into<Vector3<f32>>, ray_direction: impl Into<Vector3<f32>>, ) -> NodeResult<RayMarchResult>
Get information from the server raymarching the given ray in
space through this field such as steps, closest/deepest distance, etc.Source§impl NodeType for Field
impl NodeType for Field
Source§impl OwnedAspect for Field
impl OwnedAspect for Field
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 Field
impl SpatialAspect for Field
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 Field
impl SpatialRefAspect for Field
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 Field
Auto Trait Implementations§
impl Freeze for Field
impl !RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl !UnwindSafe for Field
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