mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 10:34:11 +02:00
entity reading wip
This commit is contained in:
parent
4320f2941c
commit
e90bc53852
11 changed files with 509 additions and 114 deletions
|
|
@ -1,5 +1,6 @@
|
|||
use bitstream_reader::{BitRead, BitSize};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
#[derive(BitRead, BitSize, Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq)]
|
||||
pub struct Vector {
|
||||
|
|
@ -8,8 +9,20 @@ pub struct Vector {
|
|||
pub z: f32,
|
||||
}
|
||||
|
||||
impl fmt::Display for Vector {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "({}, {}, {})", self.x, self.y, self.z)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(BitRead, BitSize, Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq)]
|
||||
pub struct VectorXY {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
}
|
||||
|
||||
impl fmt::Display for VectorXY {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "({}, {})", self.x, self.y)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue