Visibility cleanups.

This commit is contained in:
Bill Thiede 2018-09-08 19:58:12 -07:00
parent 577fa32b2d
commit e1199611f0

View File

@ -1,4 +1,3 @@
use std::f32::consts::PI;
use std::fmt; use std::fmt;
use std::num::ParseFloatError; use std::num::ParseFloatError;
use std::ops::Add; use std::ops::Add;
@ -15,7 +14,7 @@ pub struct Vec3 {
z: f32, z: f32,
} }
fn cross(v1: Vec3, v2: Vec3) -> Vec3 { pub fn cross(v1: Vec3, v2: Vec3) -> Vec3 {
Vec3 { Vec3 {
x: v1.y * v2.z - v1.z * v2.y, x: v1.y * v2.z - v1.z * v2.y,
y: v1.x * v2.z - v1.z * v2.x, y: v1.x * v2.z - v1.z * v2.x,
@ -23,7 +22,7 @@ fn cross(v1: Vec3, v2: Vec3) -> Vec3 {
} }
} }
fn dot(v1: Vec3, v2: Vec3) -> f32 { pub fn dot(v1: Vec3, v2: Vec3) -> f32 {
v1.x * v2.x + v1.y * v2.y + v1.z * v2.z v1.x * v2.x + v1.y * v2.y + v1.z * v2.z
} }
@ -146,6 +145,7 @@ impl Sub for Vec3 {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use std::f32::consts::PI;
use std::str::FromStr; use std::str::FromStr;
use super::*; use super::*;