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: Vec3AImplementations§
Source§impl PhysState
impl PhysState
Sourcepub fn flip_y(self) -> Self
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.
Sourcepub fn mirror_x(self) -> Self
pub fn mirror_x(self) -> Self
Mirror across the YZ plane (x -> -x), including rotation/ang-vel.
Sourcepub fn mirror_y(self) -> Self
pub fn mirror_y(self) -> Self
Mirror across the XZ plane (y -> -y), including rotation/ang-vel.
Sourcepub const fn get_forward_dir(&self) -> Vec3A
pub const fn get_forward_dir(&self) -> Vec3A
Car/ball forward axis (rot_mat.x_axis).
Sourcepub const fn get_right_dir(&self) -> Vec3A
pub const fn get_right_dir(&self) -> Vec3A
Car/ball right axis (rot_mat.y_axis).
Sourcepub const fn get_up_dir(&self) -> Vec3A
pub const fn get_up_dir(&self) -> Vec3A
Car/ball up axis (rot_mat.z_axis).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PhysState
impl RefUnwindSafe for PhysState
impl Send for PhysState
impl Sync for PhysState
impl Unpin for PhysState
impl UnsafeUnpin for PhysState
impl UnwindSafe for PhysState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more