pub struct PhysicsShape { /* private fields */ }Expand description
PHSH — Physics shape (v0–v3, 132–300 bytes)
The 300-byte v3 layout is a three-part union. Bytes 0–79 are the common header. Bytes 80–103 hold shape dimensions for simple shapes (0–3) or are zero for complex shapes. Bytes 80–183 form the convex hull section (shapeType 4); bytes 184–299 form the mesh section (shapeType 5).
Implementations§
Source§impl PhysicsShape
impl PhysicsShape
Sourcepub fn collision_margin(&self) -> f32
pub fn collision_margin(&self) -> f32
Havok convex radius (v1 only, ≈ 0.019685)
pub fn set_collision_margin(&mut self, value: f32)
Sourcepub fn shape_type(&self) -> PhysicsShapeType
pub fn shape_type(&self) -> PhysicsShapeType
Shape type (box/sphere/capsule/cylinder/hull/mesh)
pub fn set_shape_type(&mut self, value: PhysicsShapeType)
pub fn set_old_sizes(&mut self, value: Vector3f)
Sourcepub fn shape_dimensions(&self) -> Vector3f
pub fn shape_dimensions(&self) -> Vector3f
Shape dimensions (v2+, zero for complex shapes)
pub fn set_shape_dimensions(&mut self, value: Vector3f)
Sourcepub fn hull_face_normals(&self) -> &[Vector3f]
pub fn hull_face_normals(&self) -> &[Vector3f]
Per-face unit normals (VEC3)
Zero-copy view of the underlying std::vector.
Sourcepub fn hull_face_normals_mut(&mut self) -> &mut [Vector3f]
pub fn hull_face_normals_mut(&mut self) -> &mut [Vector3f]
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_hull_face_normals(&mut self, values: &[Vector3f])
pub fn resize_hull_face_normals(&mut self, count: usize)
Sourcepub fn hull_vertex_positions(&self) -> &[Vector4f]
pub fn hull_vertex_positions(&self) -> &[Vector4f]
Vertex positions, w=0 (VEC4)
Zero-copy view of the underlying std::vector.
Sourcepub fn hull_vertex_positions_mut(&mut self) -> &mut [Vector4f]
pub fn hull_vertex_positions_mut(&mut self) -> &mut [Vector4f]
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_hull_vertex_positions(&mut self, values: &[Vector4f])
pub fn resize_hull_vertex_positions(&mut self, count: usize)
Sourcepub fn hull_half_edges_len(&self) -> usize
pub fn hull_half_edges_len(&self) -> usize
Half-edge table (DMSE)
Sourcepub fn hull_half_edges(
&self,
index: usize,
) -> Option<Ref<'_, ConvexHullHalfEdge>>
pub fn hull_half_edges( &self, index: usize, ) -> Option<Ref<'_, ConvexHullHalfEdge>>
Borrows element index in place. None when out of range.
pub fn hull_half_edges_mut( &mut self, index: usize, ) -> Option<RefMut<'_, ConvexHullHalfEdge>>
Sourcepub fn hull_half_edges_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, ConvexHullHalfEdge>>
pub fn hull_half_edges_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, ConvexHullHalfEdge>>
Iterate the elements, borrowing each in turn.
pub fn resize_hull_half_edges(&mut self, count: usize)
Sourcepub fn hull_vertex_face_indices(&self) -> &[u8] ⓘ
pub fn hull_vertex_face_indices(&self) -> &[u8] ⓘ
One face index per vertex (U8__)
Zero-copy view of the underlying std::vector.
Sourcepub fn hull_vertex_face_indices_mut(&mut self) -> &mut [u8] ⓘ
pub fn hull_vertex_face_indices_mut(&mut self) -> &mut [u8] ⓘ
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_hull_vertex_face_indices(&mut self, values: &[u8])
pub fn resize_hull_vertex_face_indices(&mut self, count: usize)
Sourcepub fn hull_center(&self) -> Vector3f
pub fn hull_center(&self) -> Vector3f
Hull centroid
pub fn set_hull_center(&mut self, value: Vector3f)
Sourcepub fn hull_face_normal_count(&self) -> u32
pub fn hull_face_normal_count(&self) -> u32
Number of face normals
pub fn set_hull_face_normal_count(&mut self, value: u32)
Sourcepub fn hull_vertex_count(&self) -> u32
pub fn hull_vertex_count(&self) -> u32
Number of vertices
pub fn set_hull_vertex_count(&mut self, value: u32)
Sourcepub fn hull_half_edge_count(&self) -> u32
pub fn hull_half_edge_count(&self) -> u32
Number of half-edges
pub fn set_hull_half_edge_count(&mut self, value: u32)
Sourcepub fn hull_unknown_0(&self) -> f32
pub fn hull_unknown_0(&self) -> f32
Unknown hull parameter 0
pub fn set_hull_unknown_0(&mut self, value: f32)
Sourcepub fn hull_unknown_1(&self) -> f32
pub fn hull_unknown_1(&self) -> f32
Unknown hull parameter 1
pub fn set_hull_unknown_1(&mut self, value: f32)
Sourcepub fn mesh_bvh_nodes_len(&self) -> usize
pub fn mesh_bvh_nodes_len(&self) -> usize
BVH tree nodes (DMMN)
Sourcepub fn mesh_bvh_nodes(
&self,
index: usize,
) -> Option<Ref<'_, PhysicsMeshBvhNode>>
pub fn mesh_bvh_nodes( &self, index: usize, ) -> Option<Ref<'_, PhysicsMeshBvhNode>>
Borrows element index in place. None when out of range.
pub fn mesh_bvh_nodes_mut( &mut self, index: usize, ) -> Option<RefMut<'_, PhysicsMeshBvhNode>>
Sourcepub fn mesh_bvh_nodes_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsMeshBvhNode>>
pub fn mesh_bvh_nodes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsMeshBvhNode>>
Iterate the elements, borrowing each in turn.
pub fn resize_mesh_bvh_nodes(&mut self, count: usize)
Sourcepub fn mesh_vertex_positions(&self) -> &[Vector4f]
pub fn mesh_vertex_positions(&self) -> &[Vector4f]
Vertex positions, w=0 (VEC4)
Zero-copy view of the underlying std::vector.
Sourcepub fn mesh_vertex_positions_mut(&mut self) -> &mut [Vector4f]
pub fn mesh_vertex_positions_mut(&mut self) -> &mut [Vector4f]
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_mesh_vertex_positions(&mut self, values: &[Vector4f])
pub fn resize_mesh_vertex_positions(&mut self, count: usize)
Sourcepub fn mesh_bounds_center(&self) -> Vector3f
pub fn mesh_bounds_center(&self) -> Vector3f
AABB center in model space (quantization grid origin)
pub fn set_mesh_bounds_center(&mut self, value: Vector3f)
Sourcepub fn mesh_bounds_extent(&self) -> Vector3f
pub fn mesh_bounds_extent(&self) -> Vector3f
AABB half-extents (quantization range: tolerance = extent / 32767)
pub fn set_mesh_bounds_extent(&mut self, value: Vector3f)
Sourcepub fn mesh_tolerance(&self) -> Vector3f
pub fn mesh_tolerance(&self) -> Vector3f
Per-axis quantization step (= extent / 32767)
pub fn set_mesh_tolerance(&mut self, value: Vector3f)
Sourcepub fn mesh_normal_count(&self) -> u32
pub fn mesh_normal_count(&self) -> u32
Number of mesh normals
pub fn set_mesh_normal_count(&mut self, value: u32)
Sourcepub fn mesh_vertex_count(&self) -> u32
pub fn mesh_vertex_count(&self) -> u32
Number of mesh vertices
pub fn set_mesh_vertex_count(&mut self, value: u32)
Sourcepub fn mesh_face_index_16_count(&self) -> u32
pub fn mesh_face_index_16_count(&self) -> u32
MT16 face count (0 when MT32)
pub fn set_mesh_face_index_16_count(&mut self, value: u32)
Sourcepub fn mesh_face_index_32_count(&self) -> u32
pub fn mesh_face_index_32_count(&self) -> u32
MT32 face count (0 when MT16)
pub fn set_mesh_face_index_32_count(&mut self, value: u32)
Sourcepub fn mesh_unknown_1(&self) -> u32
pub fn mesh_unknown_1(&self) -> u32
Unknown mesh parameter
pub fn set_mesh_unknown_1(&mut self, value: u32)
Sourcepub fn mesh_reserved(&self) -> u32
pub fn mesh_reserved(&self) -> u32
Reserved (always 0)
pub fn set_mesh_reserved(&mut self, value: u32)
Sourcepub fn mesh_tree_depth(&self) -> u32
pub fn mesh_tree_depth(&self) -> u32
BVH tree height (root-to-leaf path length, 1–12)
pub fn set_mesh_tree_depth(&mut self, value: u32)
Sourcepub fn mesh_collision_margin(&self) -> f32
pub fn mesh_collision_margin(&self) -> f32
Collision margin (MT16: small float; MT32: 0.0)