pub struct FirstPerson {
pub mesh_annotations: Vec<MeshAnnotation>,
}Expand description
First-person visibility rules of the avatar.
Fields§
§mesh_annotations: Vec<MeshAnnotation>Explicit per-node mesh annotations from the VRM extension.
Implementations§
Source§impl FirstPerson
impl FirstPerson
Sourcepub fn flag_for(&self, node_index: u32) -> FirstPersonFlag
pub fn flag_for(&self, node_index: u32) -> FirstPersonFlag
Returns the first-person flag for a mesh node.
Meshes without an explicit annotation default to
FirstPersonFlag::Auto.
Sourcepub fn head_node_indices(&self, avatar: &Avatar) -> HashSet<u32>
pub fn head_node_indices(&self, avatar: &Avatar) -> HashSet<u32>
Collects the node indices of the head bone and all of its descendants.
These are the joints the FirstPersonFlag::Auto algorithm uses to
decide whether a vertex belongs to the head part.
Sourcepub fn auto_split(
&self,
avatar: &Avatar,
primitive: &RenderPrimitive,
) -> AutoSplit
pub fn auto_split( &self, avatar: &Avatar, primitive: &RenderPrimitive, ) -> AutoSplit
Applies the auto first-person split to primitive.
Every vertex is checked for a weight on the head bone (or a child of
the head bone). Triangles that contain at least one such vertex belong
to the head part (AutoSplit::third_person_only); the remaining
triangles form the both part.
Sourcepub fn visible_indices<'a>(
&self,
avatar: &Avatar,
primitive: &'a RenderPrimitive,
camera: CameraMode,
) -> Cow<'a, [u32]>
pub fn visible_indices<'a>( &self, avatar: &Avatar, primitive: &'a RenderPrimitive, camera: CameraMode, ) -> Cow<'a, [u32]>
Returns the indices visible to the selected camera.
Most modes borrow the primitive’s original index buffer. An auto
first-person triangle mesh returns an owned buffer with head-weighted
triangles removed.