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::CylinderWide;
use crate::traits::PairWideTest;
use crate::{Cylinder, ShapeContainer};

struct CylinderCylinderBench;

impl_bench!(
    CylinderCylinderBench,
    CylinderWide,
    CylinderWide,
    Convex4ContactManifoldWide,
    4
);

//cargo +nightly bench  --features serde,unstable  --package phys_collision --lib
// collision_tasks::benches::cylinder_cylinder

type InputType = TestInput<Cylinder, Cylinder>;
bench!(InputType ,CylinderCylinderBench,"cylinder_cylinder/",
    <0,000_duplicate>,
    <0,001_cylinder_a_in_cylinder_b>,
    <0,002_cylinder_b_in_cylinder_a>,
    <0,003_cylinder_a_cap_in_cylinder_b_side>,
    <0,004_cylinder_a_cap_part_in_cylinder_b_side>,
    <0,005_cylinder_a_cap_full_in_cylinder_b_cap_same_radius>,
    <0,006_cylinder_a_cap_full_in_cylinder_b_cap_diff_radius>,
    <0,007_cylinder_a_side_cross_cylinder_b_side_parallel>,
    <0,008_cylinder_a_side_cross_cylinder_b_side_rotation>,
    <0,009_cylinder_a_side_cross_cylinder_b_side_perpendicular>,
    <0,010_cylinder_a_cap_cross_cylinder_b_cap>,
    <0,011_cylinder_a_cross_cylinder_b_both_side_and_cap>,
    <0,012_cylinder_a_cap_and_side_part_in_cylinder_b_side>,
    <0,013_cylinder_a_cap_and_side_part_in_cylinder_b_cap>,
    <0,014_cylinder_a_side_tangent_with_cylinder_b_side_parallel>,
    <0,015_cylinder_a_side_tangent_with_cylinder_b_side_one_point>,
    <0,016_cylinder_a_side_tangent_with_cylinder_b_cap_parallel>,
    <0,017_cylinder_a_side_tangent_with_cylinder_b_cap_circle>,
    <0,018_cylinder_a_circle_tangent_with_cylinder_b_circle>,
    <0,019_cylinder_a_cap_tangent_with_cylinder_b_cap_full>,
    <0,020_cylinder_a_cap_tangent_with_cylinder_b_cap_part>,
    <0,021_cylinder_a_cap_close_to_cylinder_b_cap_parallel>,
    <0,022_cylinder_a_cap_close_to_cylinder_b_cap_perpendicular>,
    <0,023_cylinder_a_cap_close_to_cylinder_b_side_parallel>,
    <0,024_cylinder_a_cap_close_to_cylinder_b_side_with_rotation>,
    <0,025_cylinder_a_side_close_to_cylinder_b_side_parallel>,
    <0,026_cylinder_a_far_away_to_cylinder_b>
);