Skip to content

Commit

Permalink
update dependencies & refactor
Browse files Browse the repository at this point in the history
- bump float_eq & paste.
- new `wip` module for WIP work, & exclude it from the crate.
- update .gitignore
- update docs.
  • Loading branch information
joseluis committed Dec 14, 2021
1 parent c9c6b33 commit aa77b98
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/target
Cargo.lock
*.swp
*.swo
_*
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ repository = "https://github.com/andamira/fisica"
documentation = "https://docs.rs/fisica"
license = "MIT/Apache-2.0"
include = [
"src/**/*.rs",
"Cargo.toml",
"LICENSE*",
"README.md",
"/src/",
"!/src/wip/",
"/Cargo.toml",
"/LICENSE*",
"/README.md",
]
categories = [ "science" ]
keywords = [ "physics" ]

[dependencies]
paste = "1.0.5"
glam = "^0.20"
paste = "^1.0"
# twofloat = "^0.4"

# itoa = "1.0.1"
# dtoa = "1.0.1"
# ryu = "1.0.9"
# pretty_dtoa = "0.3.0"
# num = "0.4.0"
# num = "^0.4"
# ryu = "^1.0"
# pretty_dtoa = "^0.3"

[dev-dependencies]
float_eq = "0.6.0"
# approx = "*"
float_eq = "^0.7"
# approx = "^0.5"

[build-dependencies]

Expand Down
14 changes: 0 additions & 14 deletions src/engine/body.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
mod auto_impls;

pub mod constants;
// pub mod engine;
pub mod math;
pub mod units;

#[doc(inline)]
pub use math::{Direction, Magnitude, Orientation, Position};
2 changes: 1 addition & 1 deletion src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ pub(crate) type V3 = glam::DVec3;
/// Orientation
pub type Orientation = glam::DQuat;

/// Rotatation Matrix
/// Rotation Matrix
pub type Matrix = glam::DMat3;
9 changes: 3 additions & 6 deletions src/math/vectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ use super::{Magnitude, V3};

/// `Direction` is a vector quantity that represents a change in [`Position`].
///
/// Position and Direction are two sides of the same coin.
/// `Position` and `Direction` are two sides of the same coin.
/// We can also think of any position as a change of position from the
/// origin (Position::ZERO) to the target location.
//
// https://docs.rs/glam/*/glam/f64/struct.DVec3.html
/// origin (`Position::ZERO`) to the target location.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Default, PartialEq)]
pub struct Direction {
v: V3,
}

/// A vector quantity representing a unique location in space.
///
/// Being equal to [`Direction`], it has a different name for semantic purposes.
/// Semantic alias of [`Direction`].
pub type Position = Direction;

/// # Methods
Expand Down
27 changes: 27 additions & 0 deletions src/wip/engine/body.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//!
use crate::{
engine::Shape,
{Orientation, Position},
};

/// A physical body
#[derive(Debug, Default)]
pub struct Body {
pub pos: Position,
pub orien: Orientation,
pub shape: Shape,
}

// WIP
// impl Body {
// pub fn new() -> Self {
// Self {
// pos: Position::ZERO,
// orien: Orientation::IDENTITY,
// shape: Shape::Sphere {
// radius: Length::new(0.0),
// },
// }
// }
// }
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions src/engine/shape.rs → src/wip/engine/shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ impl Default for Shape {
}
}
}

// RETHINK
// impl Shape {
// pub fn new() -> Self {
// }
// }

0 comments on commit aa77b98

Please sign in to comment.