Skip to content

Commit

Permalink
Private anything in mikktspace that doesn't need to be public
Browse files Browse the repository at this point in the history
  • Loading branch information
LaylBongers committed Jul 16, 2023
1 parent 06cc57c commit df7e724
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions crates/bevy_mikktspace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn generate_tangents<G: Geometry>(geometry: &mut G) -> bool {
generate_tangents_with(geometry, 180.0)
}

pub fn generate_tangents_with<G: Geometry>(geometry: &mut G, angular_threshold: f32) -> bool {
fn generate_tangents_with<G: Geometry>(geometry: &mut G, angular_threshold: f32) -> bool {
// count triangles on supported faces
let mut triangles_count = 0;
for face in 0..geometry.num_faces() {
Expand Down Expand Up @@ -185,19 +185,19 @@ pub fn generate_tangents_with<G: Geometry>(geometry: &mut G, angular_threshold:

#[derive(Copy, Clone)]
struct TriangleInfo {
pub face_neighbors: [i32; 3],
pub assigned_group: [usize; 3],
pub os: Vec3,
pub ot: Vec3,
pub mag_s: f32,
pub mag_t: f32,
face_neighbors: [i32; 3],
assigned_group: [usize; 3],
os: Vec3,
ot: Vec3,
mag_s: f32,
mag_t: f32,
/// Index of the face this triangle maps to, in the original faces.
pub original_face_index: i32,
pub flags: TriangleFlags,
original_face_index: i32,
flags: TriangleFlags,
/// Offset of the first vertex of this triangle, in the original vertices.
pub vertex_offset: i32,
vertex_offset: i32,
/// Offsets of the vertices of this triangle, relative to the triangle index, last always 0.
pub vertex_indices: [u8; 4],
vertex_indices: [u8; 4],
}

bitflags! {
Expand All @@ -211,7 +211,7 @@ bitflags! {
}

impl TriangleInfo {
pub fn zero() -> Self {
fn zero() -> Self {
Self {
face_neighbors: [0, 0, 0],
assigned_group: [usize::MAX, usize::MAX, usize::MAX],
Expand Down Expand Up @@ -360,17 +360,17 @@ fn get_normal<G: Geometry>(geometry: &mut G, index: usize) -> Vec3 {
}

#[derive(Copy, Clone)]
pub struct TSpace {
pub os: Vec3,
pub mag_s: f32,
pub ot: Vec3,
pub mag_t: f32,
pub counter: i32,
pub orient: bool,
struct TSpace {
os: Vec3,
mag_s: f32,
ot: Vec3,
mag_t: f32,
counter: i32,
orient: bool,
}

impl TSpace {
pub fn zero() -> Self {
fn zero() -> Self {
Self {
os: Default::default(),
mag_s: 0.0,
Expand Down Expand Up @@ -414,12 +414,12 @@ impl TSpace {
// internal structure

#[derive(Copy, Clone)]
pub struct Group {
pub face_indices_len: usize,
struct Group {
face_indices_len: usize,
/// Index of the first face index in the buffer.
pub face_indices_index: usize,
pub vertex_representative: i32,
pub orient_preservering: bool,
face_indices_index: usize,
vertex_representative: i32,
orient_preservering: bool,
}

impl Group {
Expand All @@ -434,9 +434,9 @@ impl Group {
}

#[derive(Clone)]
pub struct SubGroup {
pub faces_count: i32,
pub tri_members: Vec<i32>,
struct SubGroup {
faces_count: i32,
tri_members: Vec<i32>,
}

impl SubGroup {
Expand All @@ -449,10 +449,10 @@ impl SubGroup {
}

#[derive(Copy, Clone)]
pub struct Edge {
pub i0: i32,
pub i1: i32,
pub f: i32,
struct Edge {
i0: i32,
i1: i32,
f: i32,
}

impl Edge {
Expand All @@ -466,9 +466,9 @@ impl Edge {
}

#[derive(Copy, Clone)]
pub struct TmpVert {
pub vert: [f32; 3],
pub index: i32,
struct TmpVert {
vert: [f32; 3],
index: i32,
}

impl TmpVert {
Expand Down

0 comments on commit df7e724

Please sign in to comment.