mirror of
https://github.com/lcdr/lu_packets.git
synced 2025-12-30 16:24:22 -06:00
Implement Default for Vector3 and Quaternion
This commit is contained in:
@@ -31,12 +31,19 @@ impl<U> From<ConnectionRequestAccepted> for Message<U> {
|
||||
Message::ConnectionRequestAccepted(msg)
|
||||
}
|
||||
}
|
||||
|
||||
impl<U> From<ReplicaConstruction> for Message<U> {
|
||||
fn from(msg: ReplicaConstruction) -> Self {
|
||||
Message::ReplicaConstruction(msg)
|
||||
}
|
||||
}
|
||||
|
||||
impl<U> From<ReplicaSerialization> for Message<U> {
|
||||
fn from(msg: ReplicaSerialization) -> Self {
|
||||
Message::ReplicaSerialization(msg)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, PartialEq, Serialize)]
|
||||
pub struct ConnectedPong {
|
||||
pub ping_send_time: u32,
|
||||
|
||||
@@ -32,7 +32,7 @@ impl ZoneId {
|
||||
const INVALID: Self = Self { map_id: 0, instance_id: 0, clone_id: 0 };
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, GmParam)]
|
||||
#[derive(Copy, Clone, Debug, Default, Deserialize, Serialize, PartialEq, GmParam)]
|
||||
pub struct Vector3 {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
@@ -43,7 +43,7 @@ impl Vector3 {
|
||||
pub const ZERO: Self = Self { x: 0.0, y: 0.0, z: 0.0 };
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, GmParam)]
|
||||
#[derive(Copy, Clone, Debug, Default, Deserialize, Serialize, PartialEq, GmParam)]
|
||||
pub struct Quaternion {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
@@ -52,5 +52,5 @@ pub struct Quaternion {
|
||||
}
|
||||
|
||||
impl Quaternion {
|
||||
const IDENTITY: Self = Self { x: 0.0, y: 0.0, z: 0.0, w: 0.0 };
|
||||
pub const IDENTITY: Self = Self { x: 0.0, y: 0.0, z: 0.0, w: 0.0 };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user