aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2020-10-06 16:53:54 +0200
committerGitHub <noreply@github.com>2020-10-06 16:53:54 +0200
commit24a25f8ae7a62c5c5afa24825b063fbb1b603922 (patch)
tree5302f5282fe963b72dbd9e94f422994b6ab11eca /src/lib.rs
parent99f28ba4b4a14254b4160a191cbeb15211cdd2d2 (diff)
parent25b8486ebf8bdfa0d165300a30877293e9e40c51 (diff)
downloadrapier-24a25f8ae7a62c5c5afa24825b063fbb1b603922.tar.gz
rapier-24a25f8ae7a62c5c5afa24825b063fbb1b603922.tar.bz2
rapier-24a25f8ae7a62c5c5afa24825b063fbb1b603922.zip
Merge pull request #28 from dimforge/raycast
Add the QueryPipeline for ray-casting and other geometrical queries in the future
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 118ac23..3674717 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -44,7 +44,6 @@ macro_rules! enable_flush_to_zero(
}
);
-#[cfg(feature = "simd-is-enabled")]
macro_rules! array(
($callback: expr; SIMD_WIDTH) => {
{
@@ -139,7 +138,6 @@ pub mod utils;
#[cfg(feature = "dim2")]
/// Math primitives used throughout Rapier.
pub mod math {
- #[cfg(feature = "simd-is-enabled")]
pub use super::simd::*;
use na::{Isometry2, Matrix2, Point2, Translation2, UnitComplex, Vector2, Vector3, U1, U2};
@@ -182,7 +180,6 @@ pub mod math {
#[cfg(feature = "dim3")]
/// Math primitives used throughout Rapier.
pub mod math {
- #[cfg(feature = "simd-is-enabled")]
pub use super::simd::*;
use na::{Isometry3, Matrix3, Point3, Translation3, UnitQuaternion, Vector3, Vector6, U3};
@@ -220,6 +217,19 @@ pub mod math {
pub type SdpMatrix<N> = crate::utils::SdpMatrix3<N>;
}
+#[cfg(not(feature = "simd-is-enabled"))]
+mod simd {
+ use simba::simd::{AutoBoolx4, AutoF32x4};
+ /// The number of lanes of a SIMD number.
+ pub const SIMD_WIDTH: usize = 4;
+ /// SIMD_WIDTH - 1
+ pub const SIMD_LAST_INDEX: usize = 3;
+ /// A SIMD float with SIMD_WIDTH lanes.
+ pub type SimdFloat = AutoF32x4;
+ /// A SIMD bool with SIMD_WIDTH lanes.
+ pub type SimdBool = AutoBoolx4;
+}
+
#[cfg(feature = "simd-is-enabled")]
mod simd {
#[allow(unused_imports)]
@@ -233,16 +243,16 @@ mod simd {
/// SIMD_WIDTH - 1
pub const SIMD_LAST_INDEX: usize = 3;
#[cfg(not(feature = "simd-nightly"))]
- /// A SIMD float with SIMD_WIDTH lanes.
+ /// A SIMD float with SIMD_WIDTH lanes.
pub type SimdFloat = WideF32x4;
#[cfg(not(feature = "simd-nightly"))]
- /// A SIMD bool with SIMD_WIDTH lanes.
+ /// A SIMD bool with SIMD_WIDTH lanes.
pub type SimdBool = WideBoolF32x4;
#[cfg(feature = "simd-nightly")]
- /// A SIMD float with SIMD_WIDTH lanes.
+ /// A SIMD float with SIMD_WIDTH lanes.
pub type SimdFloat = f32x4;
#[cfg(feature = "simd-nightly")]
- /// A bool float with SIMD_WIDTH lanes.
+ /// A bool float with SIMD_WIDTH lanes.
pub type SimdBool = m32x4;
// pub const SIMD_WIDTH: usize = 8;