glam_det 2.0.0-beta.2

A simple and fast 3D math library for games and graphics.
// 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 uvec2;
mod uvec3;
mod uvec4;

pub use uvec2::{uvec2, UVec2};
pub use uvec3::{uvec3, UVec3};
pub use uvec4::{uvec4, UVec4};

mod upoint2;
mod upoint3;
mod upoint4;

pub use upoint2::{upoint2, UPoint2};
pub use upoint3::{upoint3, UPoint3};
pub use upoint4::{upoint4, UPoint4};

#[cfg(not(target_arch = "spirv"))]
mod test {
    use super::*;
    mod const_test_uvec2 {
        #[cfg(not(feature = "cuda"))]
        const_assert_eq!(
            core::mem::align_of::<u32>(),
            core::mem::align_of::<super::UVec2>()
        );
        #[cfg(feature = "cuda")]
        const_assert_eq!(8, core::mem::align_of::<super::UVec2>());
        const_assert_eq!(8, core::mem::size_of::<super::UVec2>());
    }

    mod const_test_uvec3 {
        const_assert_eq!(
            core::mem::align_of::<u32>(),
            core::mem::align_of::<super::UVec3>()
        );
        const_assert_eq!(12, core::mem::size_of::<super::UVec3>());
    }

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

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

    mod const_test_upoint3 {
        const_assert_eq!(
            core::mem::align_of::<u32>(),
            core::mem::align_of::<super::UPoint3>()
        );
        const_assert_eq!(12, core::mem::size_of::<super::UPoint3>());
    }

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