pub struct PhysicsData { /* private fields */ }Expand description
A whole .phys file — Blizzard’s Domino rigid-body setup for a model, either a .phys sibling or an M2’s inline PFDC chunk.
Bodies attach to bones and are linked by joints; each body owns a run of @ref shapes, and each shape indexes the array its type names.
Implementations§
Source§impl PhysicsData
impl PhysicsData
Sourcepub fn version(&self) -> u16
pub fn version(&self) -> u16
0 (MoP) through 6. Decides which layout each chunk is written in — see the per-field version notes on the structs above.
pub fn set_version(&mut self, value: u16)
pub fn bodies_len(&self) -> usize
Sourcepub fn bodies(&self, index: usize) -> Option<Ref<'_, PhysicsBody>>
pub fn bodies(&self, index: usize) -> Option<Ref<'_, PhysicsBody>>
Borrows element index in place. None when out of range.
pub fn bodies_mut(&mut self, index: usize) -> Option<RefMut<'_, PhysicsBody>>
Sourcepub fn bodies_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsBody>>
pub fn bodies_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsBody>>
Iterate the elements, borrowing each in turn.
pub fn resize_bodies(&mut self, count: usize)
pub fn shapes_len(&self) -> usize
Sourcepub fn shapes(&self, index: usize) -> Option<Ref<'_, PhysicsShape>>
pub fn shapes(&self, index: usize) -> Option<Ref<'_, PhysicsShape>>
Borrows element index in place. None when out of range.
pub fn shapes_mut(&mut self, index: usize) -> Option<RefMut<'_, PhysicsShape>>
Sourcepub fn shapes_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsShape>>
pub fn shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsShape>>
Iterate the elements, borrowing each in turn.
pub fn resize_shapes(&mut self, count: usize)
pub fn box_shapes_len(&self) -> usize
Sourcepub fn box_shapes(&self, index: usize) -> Option<Ref<'_, BoxShape>>
pub fn box_shapes(&self, index: usize) -> Option<Ref<'_, BoxShape>>
Borrows element index in place. None when out of range.
pub fn box_shapes_mut(&mut self, index: usize) -> Option<RefMut<'_, BoxShape>>
Sourcepub fn box_shapes_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, BoxShape>>
pub fn box_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, BoxShape>>
Iterate the elements, borrowing each in turn.
pub fn resize_box_shapes(&mut self, count: usize)
pub fn capsule_shapes_len(&self) -> usize
Sourcepub fn capsule_shapes(&self, index: usize) -> Option<Ref<'_, CapsuleShape>>
pub fn capsule_shapes(&self, index: usize) -> Option<Ref<'_, CapsuleShape>>
Borrows element index in place. None when out of range.
pub fn capsule_shapes_mut( &mut self, index: usize, ) -> Option<RefMut<'_, CapsuleShape>>
Sourcepub fn capsule_shapes_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, CapsuleShape>>
pub fn capsule_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, CapsuleShape>>
Iterate the elements, borrowing each in turn.
pub fn resize_capsule_shapes(&mut self, count: usize)
pub fn sphere_shapes_len(&self) -> usize
Sourcepub fn sphere_shapes(&self, index: usize) -> Option<Ref<'_, SphereShape>>
pub fn sphere_shapes(&self, index: usize) -> Option<Ref<'_, SphereShape>>
Borrows element index in place. None when out of range.
pub fn sphere_shapes_mut( &mut self, index: usize, ) -> Option<RefMut<'_, SphereShape>>
Sourcepub fn sphere_shapes_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, SphereShape>>
pub fn sphere_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, SphereShape>>
Iterate the elements, borrowing each in turn.
pub fn resize_sphere_shapes(&mut self, count: usize)
pub fn polytope_shapes_len(&self) -> usize
Sourcepub fn polytope_shapes(&self, index: usize) -> Option<Ref<'_, PolytopeShape>>
pub fn polytope_shapes(&self, index: usize) -> Option<Ref<'_, PolytopeShape>>
Borrows element index in place. None when out of range.
pub fn polytope_shapes_mut( &mut self, index: usize, ) -> Option<RefMut<'_, PolytopeShape>>
Sourcepub fn polytope_shapes_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, PolytopeShape>>
pub fn polytope_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PolytopeShape>>
Iterate the elements, borrowing each in turn.
pub fn resize_polytope_shapes(&mut self, count: usize)
pub fn joints_len(&self) -> usize
Sourcepub fn joints(&self, index: usize) -> Option<Ref<'_, PhysicsJoint>>
pub fn joints(&self, index: usize) -> Option<Ref<'_, PhysicsJoint>>
Borrows element index in place. None when out of range.
pub fn joints_mut(&mut self, index: usize) -> Option<RefMut<'_, PhysicsJoint>>
Sourcepub fn joints_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsJoint>>
pub fn joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsJoint>>
Iterate the elements, borrowing each in turn.
pub fn resize_joints(&mut self, count: usize)
pub fn weld_joints_len(&self) -> usize
Sourcepub fn weld_joints(&self, index: usize) -> Option<Ref<'_, WeldJoint>>
pub fn weld_joints(&self, index: usize) -> Option<Ref<'_, WeldJoint>>
Borrows element index in place. None when out of range.
pub fn weld_joints_mut(&mut self, index: usize) -> Option<RefMut<'_, WeldJoint>>
Sourcepub fn weld_joints_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, WeldJoint>>
pub fn weld_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, WeldJoint>>
Iterate the elements, borrowing each in turn.
pub fn resize_weld_joints(&mut self, count: usize)
pub fn spherical_joints_len(&self) -> usize
Sourcepub fn spherical_joints(&self, index: usize) -> Option<Ref<'_, SphericalJoint>>
pub fn spherical_joints(&self, index: usize) -> Option<Ref<'_, SphericalJoint>>
Borrows element index in place. None when out of range.
pub fn spherical_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, SphericalJoint>>
Sourcepub fn spherical_joints_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, SphericalJoint>>
pub fn spherical_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, SphericalJoint>>
Iterate the elements, borrowing each in turn.
pub fn resize_spherical_joints(&mut self, count: usize)
pub fn shoulder_joints_len(&self) -> usize
Sourcepub fn shoulder_joints(&self, index: usize) -> Option<Ref<'_, ShoulderJoint>>
pub fn shoulder_joints(&self, index: usize) -> Option<Ref<'_, ShoulderJoint>>
Borrows element index in place. None when out of range.
pub fn shoulder_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, ShoulderJoint>>
Sourcepub fn shoulder_joints_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, ShoulderJoint>>
pub fn shoulder_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, ShoulderJoint>>
Iterate the elements, borrowing each in turn.
pub fn resize_shoulder_joints(&mut self, count: usize)
pub fn prismatic_joints_len(&self) -> usize
Sourcepub fn prismatic_joints(&self, index: usize) -> Option<Ref<'_, PrismaticJoint>>
pub fn prismatic_joints(&self, index: usize) -> Option<Ref<'_, PrismaticJoint>>
Borrows element index in place. None when out of range.
pub fn prismatic_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, PrismaticJoint>>
Sourcepub fn prismatic_joints_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, PrismaticJoint>>
pub fn prismatic_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PrismaticJoint>>
Iterate the elements, borrowing each in turn.
pub fn resize_prismatic_joints(&mut self, count: usize)
pub fn revolute_joints_len(&self) -> usize
Sourcepub fn revolute_joints(&self, index: usize) -> Option<Ref<'_, RevoluteJoint>>
pub fn revolute_joints(&self, index: usize) -> Option<Ref<'_, RevoluteJoint>>
Borrows element index in place. None when out of range.
pub fn revolute_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, RevoluteJoint>>
Sourcepub fn revolute_joints_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, RevoluteJoint>>
pub fn revolute_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, RevoluteJoint>>
Iterate the elements, borrowing each in turn.
pub fn resize_revolute_joints(&mut self, count: usize)
pub fn distance_joints_len(&self) -> usize
Sourcepub fn distance_joints(&self, index: usize) -> Option<Ref<'_, DistanceJoint>>
pub fn distance_joints(&self, index: usize) -> Option<Ref<'_, DistanceJoint>>
Borrows element index in place. None when out of range.
pub fn distance_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, DistanceJoint>>
Sourcepub fn distance_joints_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, DistanceJoint>>
pub fn distance_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, DistanceJoint>>
Iterate the elements, borrowing each in turn.
pub fn resize_distance_joints(&mut self, count: usize)
Sourcepub fn tuning_len(&self) -> usize
pub fn tuning_len(&self) -> usize
PHYV. A file that has one carries nothing else.
Sourcepub fn tuning(&self, index: usize) -> Option<Ref<'_, PhysicsTuning>>
pub fn tuning(&self, index: usize) -> Option<Ref<'_, PhysicsTuning>>
Borrows element index in place. None when out of range.
pub fn tuning_mut(&mut self, index: usize) -> Option<RefMut<'_, PhysicsTuning>>
Sourcepub fn tuning_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsTuning>>
pub fn tuning_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsTuning>>
Iterate the elements, borrowing each in turn.