Skip to main content

PhysicsData

Struct PhysicsData 

Source
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

Source

pub fn new() -> Self

§Panics

Panics if the native allocation fails.

Source

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.

Source

pub fn set_version(&mut self, value: u16)

Source

pub fn bodies_len(&self) -> usize

Source

pub fn bodies(&self, index: usize) -> Option<Ref<'_, PhysicsBody>>

Borrows element index in place. None when out of range.

Source

pub fn bodies_mut(&mut self, index: usize) -> Option<RefMut<'_, PhysicsBody>>

Source

pub fn bodies_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsBody>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_bodies(&mut self, count: usize)

Source

pub fn shapes_len(&self) -> usize

Source

pub fn shapes(&self, index: usize) -> Option<Ref<'_, PhysicsShape>>

Borrows element index in place. None when out of range.

Source

pub fn shapes_mut(&mut self, index: usize) -> Option<RefMut<'_, PhysicsShape>>

Source

pub fn shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsShape>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_shapes(&mut self, count: usize)

Source

pub fn box_shapes_len(&self) -> usize

Source

pub fn box_shapes(&self, index: usize) -> Option<Ref<'_, BoxShape>>

Borrows element index in place. None when out of range.

Source

pub fn box_shapes_mut(&mut self, index: usize) -> Option<RefMut<'_, BoxShape>>

Source

pub fn box_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, BoxShape>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_box_shapes(&mut self, count: usize)

Source

pub fn capsule_shapes_len(&self) -> usize

Source

pub fn capsule_shapes(&self, index: usize) -> Option<Ref<'_, CapsuleShape>>

Borrows element index in place. None when out of range.

Source

pub fn capsule_shapes_mut( &mut self, index: usize, ) -> Option<RefMut<'_, CapsuleShape>>

Source

pub fn capsule_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, CapsuleShape>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_capsule_shapes(&mut self, count: usize)

Source

pub fn sphere_shapes_len(&self) -> usize

Source

pub fn sphere_shapes(&self, index: usize) -> Option<Ref<'_, SphereShape>>

Borrows element index in place. None when out of range.

Source

pub fn sphere_shapes_mut( &mut self, index: usize, ) -> Option<RefMut<'_, SphereShape>>

Source

pub fn sphere_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, SphereShape>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_sphere_shapes(&mut self, count: usize)

Source

pub fn polytope_shapes_len(&self) -> usize

Source

pub fn polytope_shapes(&self, index: usize) -> Option<Ref<'_, PolytopeShape>>

Borrows element index in place. None when out of range.

Source

pub fn polytope_shapes_mut( &mut self, index: usize, ) -> Option<RefMut<'_, PolytopeShape>>

Source

pub fn polytope_shapes_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PolytopeShape>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_polytope_shapes(&mut self, count: usize)

Source

pub fn joints_len(&self) -> usize

Source

pub fn joints(&self, index: usize) -> Option<Ref<'_, PhysicsJoint>>

Borrows element index in place. None when out of range.

Source

pub fn joints_mut(&mut self, index: usize) -> Option<RefMut<'_, PhysicsJoint>>

Source

pub fn joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsJoint>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_joints(&mut self, count: usize)

Source

pub fn weld_joints_len(&self) -> usize

Source

pub fn weld_joints(&self, index: usize) -> Option<Ref<'_, WeldJoint>>

Borrows element index in place. None when out of range.

Source

pub fn weld_joints_mut(&mut self, index: usize) -> Option<RefMut<'_, WeldJoint>>

Source

pub fn weld_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, WeldJoint>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_weld_joints(&mut self, count: usize)

Source

pub fn spherical_joints_len(&self) -> usize

Source

pub fn spherical_joints(&self, index: usize) -> Option<Ref<'_, SphericalJoint>>

Borrows element index in place. None when out of range.

Source

pub fn spherical_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, SphericalJoint>>

Source

pub fn spherical_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, SphericalJoint>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_spherical_joints(&mut self, count: usize)

Source

pub fn shoulder_joints_len(&self) -> usize

Source

pub fn shoulder_joints(&self, index: usize) -> Option<Ref<'_, ShoulderJoint>>

Borrows element index in place. None when out of range.

Source

pub fn shoulder_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, ShoulderJoint>>

Source

pub fn shoulder_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, ShoulderJoint>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_shoulder_joints(&mut self, count: usize)

Source

pub fn prismatic_joints_len(&self) -> usize

Source

pub fn prismatic_joints(&self, index: usize) -> Option<Ref<'_, PrismaticJoint>>

Borrows element index in place. None when out of range.

Source

pub fn prismatic_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, PrismaticJoint>>

Source

pub fn prismatic_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PrismaticJoint>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_prismatic_joints(&mut self, count: usize)

Source

pub fn revolute_joints_len(&self) -> usize

Source

pub fn revolute_joints(&self, index: usize) -> Option<Ref<'_, RevoluteJoint>>

Borrows element index in place. None when out of range.

Source

pub fn revolute_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, RevoluteJoint>>

Source

pub fn revolute_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, RevoluteJoint>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_revolute_joints(&mut self, count: usize)

Source

pub fn distance_joints_len(&self) -> usize

Source

pub fn distance_joints(&self, index: usize) -> Option<Ref<'_, DistanceJoint>>

Borrows element index in place. None when out of range.

Source

pub fn distance_joints_mut( &mut self, index: usize, ) -> Option<RefMut<'_, DistanceJoint>>

Source

pub fn distance_joints_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, DistanceJoint>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_distance_joints(&mut self, count: usize)

Source

pub fn tuning_len(&self) -> usize

PHYV. A file that has one carries nothing else.

Source

pub fn tuning(&self, index: usize) -> Option<Ref<'_, PhysicsTuning>>

Borrows element index in place. None when out of range.

Source

pub fn tuning_mut(&mut self, index: usize) -> Option<RefMut<'_, PhysicsTuning>>

Source

pub fn tuning_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsTuning>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_tuning(&mut self, count: usize)

Trait Implementations§

Source§

impl Debug for PhysicsData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PhysicsData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for PhysicsData

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for PhysicsData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.