Create space module

This commit is contained in:
Brendan Zabarauskas 2013-07-12 09:17:37 +10:00
parent 6300d4b539
commit e6bb9362ed
8 changed files with 51 additions and 13 deletions

View file

@ -22,7 +22,7 @@ SRC_CRATE = $(TARGET).rs
EXTERN_DIR = $(ROOT_DIR)/extern EXTERN_DIR = $(ROOT_DIR)/extern
BUILD_DIR = $(ROOT_DIR)/lib BUILD_DIR = $(ROOT_DIR)/lib
CFG = --cfg=color --cfg=geom --cfg=noise --cfg=transform CFG = --cfg=color --cfg=geom --cfg=noise --cfg=transform --cfg=space
TEST = $(TARGET) TEST = $(TARGET)
TEST_BUILD_DIR = $(ROOT_DIR)/test TEST_BUILD_DIR = $(ROOT_DIR)/test

View file

@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// Core datatypes and conversion traits for 3D mathematics //! Core datatypes and conversion traits for 3D mathematics
pub use self::dim::Dimensional; pub use self::dim::Dimensional;
pub use self::swap::Swap; pub use self::swap::Swap;

View file

@ -13,18 +13,12 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
//! Types and traits for geometric intersections and transformations
pub use self::frustum::{Frustum, FrustumPoints}; pub use self::frustum::{Frustum, FrustumPoints};
pub use self::plane::Plane3; pub use self::plane::Plane3;
pub use self::point::{Point, Point2, Point3}; pub use self::point::{Point, Point2, Point3};
pub use self::ray::Ray3; pub use self::ray::Ray3;
pub mod frustum;
pub mod plane; pub mod plane;
pub mod point; pub mod point;
pub mod ray; pub mod ray;
pub mod frustum;
pub mod octree;
pub mod quadtree;

View file

@ -41,3 +41,7 @@ pub mod noise;
#[cfg(transform)] #[cfg(transform)]
#[path = "transform/transform.rs"] #[path = "transform/transform.rs"]
pub mod transform; pub mod transform;
#[cfg(space)]
#[path = "space/space.rs"]
pub mod space;

16
src/space/bsp.rs Normal file
View file

@ -0,0 +1,16 @@
// Copyright 2013 The Lmath Developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
pub struct BSP;

View file

@ -13,6 +13,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// TODO
// http://gameprogrammingpatterns.com/spatial-partition.html // http://gameprogrammingpatterns.com/spatial-partition.html
pub struct Octree;

View file

@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// TODO
// http://gameprogrammingpatterns.com/spatial-partition.html // http://gameprogrammingpatterns.com/spatial-partition.html
// http://github.com/mozilla/servo/blob/master/src/components/main/compositing/quadtree.rs // http://github.com/mozilla/servo/blob/master/src/components/main/compositing/quadtree.rs
pub struct Quadtree;

24
src/space/space.rs Normal file
View file

@ -0,0 +1,24 @@
// Copyright 2013 The Lmath Developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Various data structures for space partitioning and visibility determination
pub use self::bsp::BSP;
pub use self::octree::Octree;
pub use self::quadtree::Quadtree;
pub mod bsp;
pub mod octree;
pub mod quadtree;