From 4159a214dabe26514d59307d67089859e2b3c675 Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Fri, 12 Jul 2013 12:20:11 +1000 Subject: [PATCH] Add skeleton structs and impls for noise types --- src/noise/noise.rs | 3 +++ src/noise/perlin.rs | 22 +++++++++++++++++++++- src/noise/simplex.rs | 23 ++++++++++++++++++++++- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/noise/noise.rs b/src/noise/noise.rs index 1fb9c35..f6ec73d 100644 --- a/src/noise/noise.rs +++ b/src/noise/noise.rs @@ -15,5 +15,8 @@ //! Procedural noise generation utility types +pub use self::perlin::Perlin; +pub use self::simplex::Simplex; + pub mod perlin; pub mod simplex; diff --git a/src/noise/perlin.rs b/src/noise/perlin.rs index 36a588b..6f26a41 100644 --- a/src/noise/perlin.rs +++ b/src/noise/perlin.rs @@ -13,4 +13,24 @@ // See the License for the specific language governing permissions and // limitations under the License. -// TODO +use geom::{Point2, Point3}; + +pub struct Perlin; + +impl Perlin { + pub fn new() -> Perlin { + fail!("Not yet implemented!") + } + + pub fn noise1(&self, _x: T) -> T { + fail!("Not yet implemented!") + } + + pub fn noise2(&self, _pos: Point2) -> T { + fail!("Not yet implemented!") + } + + pub fn noise3(&self, _pos: Point3) -> T { + fail!("Not yet implemented!") + } +} diff --git a/src/noise/simplex.rs b/src/noise/simplex.rs index 36a588b..3aea7bc 100644 --- a/src/noise/simplex.rs +++ b/src/noise/simplex.rs @@ -13,4 +13,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -// TODO +use core::Vec4; +use geom::{Point2, Point3}; + +pub struct Simplex; + +impl Simplex { + pub fn new() -> Simplex { + fail!("Not yet implemented!") + } + + pub fn noise2(&self, _pos: Point2) -> T { + fail!("Not yet implemented!") + } + + pub fn noise3(&self, _pos: Point3) -> T { + fail!("Not yet implemented!") + } + + pub fn noise4(&self, _vec: Vec4) -> T { + fail!("Not yet implemented!") + } +}