1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 10:44:07 +02:00

change StaticPropLump angles field visibility to pub

This commit is contained in:
Quaternions 2025-02-28 14:21:34 -08:00 committed by Robin Appelman
commit bc6cf3157e
3 changed files with 3 additions and 11 deletions

View file

@ -1,5 +1,5 @@
use serde::Deserializer;
use serde::de::{Error, Unexpected}; use serde::de::{Error, Unexpected};
use serde::Deserializer;
use std::fmt; use std::fmt;
struct BoolVisitor; struct BoolVisitor;

View file

@ -2,7 +2,6 @@ use crate::error::UnsupportedLumpVersion;
use crate::{lzma_decompress_with_header, Angles, BspError, FixedString, Vector}; use crate::{lzma_decompress_with_header, Angles, BspError, FixedString, Vector};
use binrw::{BinRead, BinReaderExt, BinResult, Endian}; use binrw::{BinRead, BinReaderExt, BinResult, Endian};
use bitflags::bitflags; use bitflags::bitflags;
use cgmath::Quaternion;
use std::borrow::Cow; use std::borrow::Cow;
use std::io::{Cursor, Read, Seek}; use std::io::{Cursor, Read, Seek};
@ -120,7 +119,7 @@ pub struct StaticPropLumps {
#[derive(Debug, Clone, Default)] #[derive(Debug, Clone, Default)]
pub struct StaticPropLump { pub struct StaticPropLump {
pub origin: Vector, pub origin: Vector,
angles: Angles, pub angles: Angles,
pub prop_type: u16, pub prop_type: u16,
pub first_leaf: u16, pub first_leaf: u16,
pub leaf_count: u16, pub leaf_count: u16,
@ -136,13 +135,6 @@ pub struct StaticPropLump {
pub lightmap_resolution: [u16; 2], pub lightmap_resolution: [u16; 2],
} }
impl StaticPropLump {
/// Get the rotation of the prop as quaternion
pub fn rotation(&self) -> Quaternion<f32> {
self.angles.as_quaternion()
}
}
impl BinRead for StaticPropLump { impl BinRead for StaticPropLump {
type Args<'a> = (u16,); type Args<'a> = (u16,);

View file

@ -5,7 +5,7 @@ impl<'a> AsPropPlacement<'a> for Handle<'a, StaticPropLump> {
fn as_prop_placement(&self) -> PropPlacement<'a> { fn as_prop_placement(&self) -> PropPlacement<'a> {
PropPlacement { PropPlacement {
model: self.model(), model: self.model(),
rotation: self.rotation(), rotation: self.angles.as_quaternion(),
scale: 1.0, scale: 1.0,
origin: self.origin, origin: self.origin,
skin: self.skin, skin: self.skin,