Skip to main content

PhysState

Struct PhysState 

Source
pub struct PhysState {
    pub pos: Vec3A,
    pub rot_mat: Mat3A,
    pub vel: Vec3A,
    pub ang_vel: Vec3A,
}
Expand description

Rigid-body pose + velocity shared by balls and cars.

All values are in Unreal units (uu): pos/vel in uu and uu/s, ang_vel in rad/s, rot_mat columns are forward (x), right (y), up (z).

There is deliberately no Default: use crate::BallState::DEFAULT or crate::CarState::DEFAULT so the spawn height is correct.

Fields§

§pos: Vec3A§rot_mat: Mat3A§vel: Vec3A§ang_vel: Vec3A

Implementations§

Source§

impl PhysState

Source

pub fn flip_y(self) -> Self

Flip across the field center (rotate 180° about Z).

Used to mirror Blue spawns to Orange and vice versa.

Source

pub fn mirror_x(self) -> Self

Mirror across the YZ plane (x -> -x), including rotation/ang-vel.

Source

pub fn mirror_y(self) -> Self

Mirror across the XZ plane (y -> -y), including rotation/ang-vel.

Source

pub const fn get_forward_dir(&self) -> Vec3A

Car/ball forward axis (rot_mat.x_axis).

Source

pub const fn get_right_dir(&self) -> Vec3A

Car/ball right axis (rot_mat.y_axis).

Source

pub const fn get_up_dir(&self) -> Vec3A

Car/ball up axis (rot_mat.z_axis).

Trait Implementations§

Source§

impl Clone for PhysState

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PhysState

Source§

impl Debug for PhysState

Source§

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

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

impl Display for PhysState

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.