glam_det 2.0.0

A simple and fast 3D math library for games and graphics.
Documentation
// Copyright (C) 2020-2025 glam-det authors. All Rights Reserved.
//
// 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.

mod ivec2;
mod ivec3;
mod ivec4;

pub use ivec2::{ivec2, IVec2};
pub use ivec3::{ivec3, IVec3};
pub use ivec4::{ivec4, IVec4};

mod ipoint2;
mod ipoint3;
mod ipoint4;

pub use ipoint2::{ipoint2, IPoint2};
pub use ipoint3::{ipoint3, IPoint3};
pub use ipoint4::{ipoint4, IPoint4};

#[cfg(not(target_arch = "spirv"))]
mod test {
    use super::*;

    mod const_test_ivec2 {
        #[cfg(not(feature = "cuda"))]
        const_assert_eq!(
            core::mem::align_of::<i32>(),
            core::mem::align_of::<super::IVec2>()
        );
        #[cfg(feature = "cuda")]
        const_assert_eq!(8, core::mem::align_of::<super::IVec2>());
        const_assert_eq!(8, core::mem::size_of::<super::IVec2>());
    }

    mod const_test_ivec3 {
        const_assert_eq!(
            core::mem::align_of::<i32>(),
            core::mem::align_of::<super::IVec3>()
        );
        const_assert_eq!(12, core::mem::size_of::<super::IVec3>());
    }

    mod const_test_ivec4 {
        #[cfg(not(feature = "cuda"))]
        const_assert_eq!(
            core::mem::align_of::<i32>(),
            core::mem::align_of::<super::IVec4>()
        );
        #[cfg(feature = "cuda")]
        const_assert_eq!(16, core::mem::align_of::<super::IVec4>());
        const_assert_eq!(16, core::mem::size_of::<super::IVec4>());
    }

    mod const_test_ipoint2 {
        #[cfg(not(feature = "cuda"))]
        const_assert_eq!(
            core::mem::align_of::<i32>(),
            core::mem::align_of::<super::IPoint2>()
        );
        #[cfg(feature = "cuda")]
        const_assert_eq!(8, core::mem::align_of::<super::IPoint2>());
        const_assert_eq!(8, core::mem::size_of::<super::IPoint2>());
    }

    mod const_test_ipoint3 {
        const_assert_eq!(
            core::mem::align_of::<i32>(),
            core::mem::align_of::<super::IPoint3>()
        );
        const_assert_eq!(12, core::mem::size_of::<super::IPoint3>());
    }

    mod const_test_ipoint4 {
        #[cfg(not(feature = "cuda"))]
        const_assert_eq!(
            core::mem::align_of::<i32>(),
            core::mem::align_of::<super::IPoint4>()
        );
        #[cfg(feature = "cuda")]
        const_assert_eq!(16, core::mem::align_of::<super::IPoint4>());
        const_assert_eq!(16, core::mem::size_of::<super::IPoint4>());
    }
}