Skip to main content

PhysicsShape

Struct PhysicsShape 

Source
pub struct PhysicsShape { /* private fields */ }
Expand description

One collision shape reference — SHAP/SHP2. Points at an entry of the box/capsule/sphere/polytope array named by @ref shapeType.

Implementations§

Source§

impl PhysicsShape

Source

pub fn new() -> Self

§Panics

Panics if the native allocation fails.

Source

pub fn shape_type(&self) -> PhysicsShapeType

Source

pub fn set_shape_type(&mut self, value: PhysicsShapeType)

Source

pub fn shape_index(&self) -> i16

Source

pub fn set_shape_index(&mut self, value: i16)

Source

pub fn padding_04(&self) -> u32

Zero in every corpus shape.

Source

pub fn set_padding_04(&mut self, value: u32)

Source

pub fn friction(&self) -> f32

Source

pub fn set_friction(&mut self, value: f32)

Source

pub fn restitution(&self) -> f32

Source

pub fn set_restitution(&mut self, value: f32)

Source

pub fn density(&self) -> f32

Source

pub fn set_density(&mut self, value: f32)

Source

pub fn unknown_14(&self) -> f32

SHP2+. Unidentified, but a float: only 0, 0.01, 0.8 and 1.0 occur. The one dmFixtureDef float the rest of this struct does not account for is m_rollingResistance.

Source

pub fn set_unknown_14(&mut self, value: f32)

Source

pub fn scale(&self) -> f32

SHP2+. 1.0 in 3229 of 3230 shapes, matching the m_scaleOrRadius the client hands every fixture.

Source

pub fn set_scale(&mut self, value: f32)

Source

pub fn unknown_1c(&self) -> u16

SHP2+. Zero in every corpus shape.

Source

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

Source

pub fn padding_1e(&self) -> u16

SHP2+. Uninitialised on disk; kept so writes match.

Source

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

Trait Implementations§

Source§

impl Debug for PhysicsShape

Source§

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

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

impl Default for PhysicsShape

Source§

fn default() -> Self

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

impl Drop for PhysicsShape

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 PhysicsShape

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.