phys-collision 2.0.1-beta.0

Provides collision detection ability
// Copyright (C) 2020-2025 phys-collision 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.

#![cfg(test)]
use glam_det::{UnitQuat, Vec3};

use super::traits::OverlapTest;
use crate::ShapeContainer;
pub(super) fn test_overlap_test<T1, T2>(
    a: &T1,
    b: &T2,
    offset_b_to_a: Vec3,
    orientation_a: UnitQuat,
    orientation_b: UnitQuat,
    container: Option<&ShapeContainer>,
) -> bool
where
    T1: OverlapTest<T2>,
    T2: OverlapTest<T1>,
{
    a.overlap_test(b, offset_b_to_a, orientation_a, orientation_b, container)
        && b.overlap_test(a, -offset_b_to_a, orientation_b, orientation_a, container)
}