Skip to content

Commit

Permalink
fix duplicate niplane definition
Browse files Browse the repository at this point in the history
  • Loading branch information
amPerl committed Nov 26, 2023
1 parent 21fd8f8 commit 6e4c14a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
8 changes: 1 addition & 7 deletions src/blocks/ni_main/ni_collision_data.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::ni_collision_object::NiCollisionObject;
use crate::common::Vector3;
use crate::common::{NiPlane, Vector3};

use binrw::{
io::{Read, Seek},
Expand Down Expand Up @@ -60,12 +60,6 @@ pub struct CapsuleBV {
pub radius: f32,
}

#[derive(Debug, PartialEq, BinRead)]
pub struct NiPlane {
pub normal: Vector3,
pub constant: f32,
}

#[derive(Debug, PartialEq, BinRead)]
pub struct HalfSpaceBV {
pub plane: NiPlane,
Expand Down
8 changes: 1 addition & 7 deletions src/blocks/ni_main/ni_texture_effect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use binrw::{
};

use super::{NiDynamicEffect, TexClampMode, TexFilterMode};
use crate::common::{BlockRef, Matrix33, Vector3};
use crate::common::{BlockRef, Matrix33, NiPlane, Vector3};

#[derive(Debug, PartialEq, BinRead)]
pub struct NiTextureEffect {
Expand All @@ -20,12 +20,6 @@ pub struct NiTextureEffect {
pub plane: NiPlane,
}

#[derive(Debug, PartialEq, BinRead)]
pub struct NiPlane {
pub normal: Vector3,
pub constant: f32,
}

impl NiTextureEffect {
pub fn parse<R: Read + Seek>(reader: &mut R) -> anyhow::Result<Self> {
Ok(reader.read_le()?)
Expand Down
2 changes: 2 additions & 0 deletions src/common/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
pub mod color;
pub mod key_group;
pub mod matrix;
pub mod ni_plane;
pub mod quaternion;
pub mod refs;
pub mod vector;

pub use color::*;
pub use key_group::*;
pub use matrix::*;
pub use ni_plane::*;
pub use quaternion::*;
pub use refs::*;
pub use vector::*;
9 changes: 9 additions & 0 deletions src/common/ni_plane.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use binrw::BinRead;

use crate::common::Vector3;

#[derive(Debug, PartialEq, BinRead)]
pub struct NiPlane {
pub normal: Vector3,
pub constant: f32,
}

0 comments on commit 6e4c14a

Please sign in to comment.