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.

use glam_det::nums::f32x4;
use glam_det::{UnitQuatx4, Vec3x4};
use paste::paste;
use test::Bencher;

use crate::collision_tasks::benches::common::{BenchShapePairTest, WithContainer};
use crate::collision_tasks::tests::common::TestInput;
use crate::collision_tasks::ShapeWideTester;
use crate::convex_contact_manifold::Convex4ContactManifoldWide;
use crate::shapes::{CuboidWide, CylinderWide};
use crate::traits::PairWideTest;
use crate::{Cuboid, Cylinder, ShapeContainer};

struct CuboidCylinderBench;
impl_bench!(
    CuboidCylinderBench,
    CuboidWide,
    CylinderWide,
    Convex4ContactManifoldWide,
    4
);

//cargo +nightly bench  --features serde,unstable  --package phys_collision --lib
// collision_tasks::benches::cuboid_cylinder
type InputType = TestInput<Cuboid, Cylinder>;
bench!(InputType,CuboidCylinderBench,"cuboid_cylinder/",
    <0,000_same_center_same_aabb>,
    <0,001_cuboid_in_cylinder>,
    <0,002_cylinder_in_cuboid>,
    <0,003_cylinder_cap_full_penetrate_in_cuboid_one_face>,
    <0,004_cylinder_cap_part_penetrate_in_cuboid_one_face_1>,
    <0,005_cylinder_cap_part_penetrate_in_cuboid_one_face_2>,
    <0,006_cylinder_cap_part_penetrate_in_cuboid_one_face_3>,
    <0,007_cylinder_side_cross_cuboid_symmetric_two_face_vertical>,
    <0,008_cylinder_side_cross_cuboid_symmetric_two_face_with_rotation>,
    <0,009_cylinder_cap_cross_cuboid_symmetric_two_face_vertical>,
    <0,010_cylinder_cap_cross_cuboid_symmetric_two_face_with_rotation>,
    <0,011_cylinder_cap_and_side_cross_cuboid_symmetric_two_face>,
    <0,012_cylinder_cap_penetrate_in_cuboid_corner>,
    <0,013_cylinder_cap_penetrate_in_cuboid_edge>,
    <0,014_cylinder_cap_penetrate_in_cuboid_two_corner>,
    <0,015_cylinder_cap_penetrate_in_cuboid_two_edge>,
    <0,016_cylinder_side_penetrate_in_cuboid_corner>,
    <0,017_cylinder_side_penetrate_in_cuboid_edge>,
    <0,018_cylinder_side_penetrate_in_cuboid_two_corner>,
    <0,019_cylinder_side_penetrate_in_cuboid_two_edge>,
    <0,020_complex_collide_case_1>,
    <0,021_complex_collide_case_2>,
    <0,022_complex_collide_case_3>,
    <0,023_cylinder_cap_tangent_with_cuboid_face>,
    <0,024_cylinder_cap_tangent_with_cuboid_edge>,
    <0,025_cylinder_cap_tangent_with_cylinder_corner>,
    <0,026_cylinder_side_tangent_with_cuboid_face>,
    <0,027_cylinder_side_tangent_with_cuboid_edge>,
    <0,028_cylinder_side_tangent_with_cuboid_corner>,
    <0,029_cylinder_cap_circle_tangent_with_cuboid_face>,
    <0,030_cylinder_cap_close_to_cuboid_face>,
    <0,031_cylinder_cap_close_to_cuboid_edge>,
    <0,032_cylinder_cap_close_to_cuboid_corner>,
    <0,033_cylinder_side_close_to_cuboid_face>,
    <0,034_cylinder_side_close_to_cuboid_edge>,
    <0,035_cylinder_side_close_to_cuboid_corner>,
    <0,036_cylinder_side_close_to_cuboid_corner_and_hit_in_specular>
);