This commit is contained in:
Quaternions 2024-02-05 19:50:27 -08:00
parent cbee156c2f
commit 6f0c579601
2 changed files with 7 additions and 7 deletions

View File

@ -56,7 +56,7 @@ pub enum SetTrajectory{
Velocity(Planar64Vec3),//SetVelocity Velocity(Planar64Vec3),//SetVelocity
} }
impl SetTrajectory{ impl SetTrajectory{
fn is_velocity(&self)->bool{ pub const fn is_velocity(&self)->bool{
match self{ match self{
SetTrajectory::AirTime(_) SetTrajectory::AirTime(_)
|SetTrajectory::Height(_) |SetTrajectory::Height(_)
@ -90,7 +90,7 @@ pub struct GeneralAttributes{
pub accelerator:Option<Accelerator>, pub accelerator:Option<Accelerator>,
} }
impl GeneralAttributes{ impl GeneralAttributes{
pub fn any(&self)->bool{ pub const fn any(&self)->bool{
self.booster.is_some() self.booster.is_some()
||self.trajectory.is_some() ||self.trajectory.is_some()
||self.wormhole.is_some() ||self.wormhole.is_some()
@ -119,7 +119,7 @@ pub struct ContactingAttributes{
pub contact_behaviour:Option<ContactingBehaviour>, pub contact_behaviour:Option<ContactingBehaviour>,
} }
impl ContactingAttributes{ impl ContactingAttributes{
pub fn any(&self)->bool{ pub const fn any(&self)->bool{
self.contact_behaviour.is_some() self.contact_behaviour.is_some()
} }
} }
@ -128,14 +128,14 @@ pub struct IntersectingAttributes{
pub water:Option<IntersectingWater>, pub water:Option<IntersectingWater>,
} }
impl IntersectingAttributes{ impl IntersectingAttributes{
pub fn any(&self)->bool{ pub const fn any(&self)->bool{
self.water.is_some() self.water.is_some()
} }
} }
#[derive(Clone,Copy)] #[derive(Clone,Copy)]
pub struct CollisionAttributesId(u32); pub struct CollisionAttributesId(u32);
impl CollisionAttributesId{ impl CollisionAttributesId{
pub fn id(id:u32)->Self{ pub const fn id(id:u32)->Self{
Self(id) Self(id)
} }
} }

View File

@ -411,7 +411,7 @@ impl TryFrom<[f32;3]> for Unit32Vec3{
*/ */
///[-1.0,1.0] = [-2^32,2^32] ///[-1.0,1.0] = [-2^32,2^32]
#[derive(Clone,Copy,Hash,Eq,Ord,PartialEq,PartialOrd)] #[derive(Clone,Copy,Debug,Hash,Eq,Ord,PartialEq,PartialOrd)]
pub struct Planar64(i64); pub struct Planar64(i64);
impl Planar64{ impl Planar64{
pub const ZERO:Self=Self(0); pub const ZERO:Self=Self(0);
@ -579,7 +579,7 @@ impl std::ops::Div<Planar64> for Planar64{
///[-1.0,1.0] = [-2^32,2^32] ///[-1.0,1.0] = [-2^32,2^32]
#[derive(Clone,Copy,Default,Hash,Eq,PartialEq)] #[derive(Clone,Copy,Debug,Default,Hash,Eq,PartialEq)]
pub struct Planar64Vec3(glam::I64Vec3); pub struct Planar64Vec3(glam::I64Vec3);
impl Planar64Vec3{ impl Planar64Vec3{
pub const ZERO:Self=Planar64Vec3(glam::I64Vec3::ZERO); pub const ZERO:Self=Planar64Vec3(glam::I64Vec3::ZERO);