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.

#![deny(warnings)]
//#![deny(clippy::pedantic)]
// Following lints are indicated by clippy::pedantic.
// We commented out some of them now because we have not fixed them yet.
// After we fixed them, we will uncomment them.
// Finally, we will uncomment clippy::pedantic.
#![deny(clippy::bool_to_int_with_if)]
#![deny(clippy::borrow_as_ptr)]
#![deny(clippy::case_sensitive_file_extension_comparisons)]
#![deny(clippy::cast_lossless)]
//#![deny(clippy::cast_possible_truncation)]
#![deny(clippy::cast_possible_wrap)]
//#![deny(clippy::cast_precision_loss)]
#![deny(clippy::cast_ptr_alignment)]
#![deny(clippy::cast_sign_loss)]
#![deny(clippy::checked_conversions)]
#![deny(clippy::cloned_instead_of_copied)]
#![deny(clippy::default_trait_access)]
#![deny(clippy::doc_link_with_quotes)]
#![deny(clippy::doc_markdown)]
#![deny(clippy::empty_enum)]
#![deny(clippy::enum_glob_use)]
#![deny(clippy::expl_impl_clone_on_copy)]
#![deny(clippy::explicit_deref_methods)]
#![deny(clippy::explicit_into_iter_loop)]
#![deny(clippy::explicit_iter_loop)]
#![deny(clippy::filter_map_next)]
#![deny(clippy::flat_map_option)]
#![deny(clippy::float_cmp)]
#![deny(clippy::fn_params_excessive_bools)]
#![deny(clippy::from_iter_instead_of_collect)]
#![deny(clippy::if_not_else)]
#![deny(clippy::implicit_clone)]
#![deny(clippy::implicit_hasher)]
#![deny(clippy::inconsistent_struct_constructor)]
#![deny(clippy::index_refutable_slice)]
#![deny(clippy::inefficient_to_string)]
//#![deny(clippy::inline_always)]
#![deny(clippy::invalid_upcast_comparisons)]
#![deny(clippy::items_after_statements)]
#![deny(clippy::iter_not_returning_iterator)]
#![deny(clippy::large_digit_groups)]
#![deny(clippy::large_stack_arrays)]
#![deny(clippy::linkedlist)]
#![deny(clippy::macro_use_imports)]
#![deny(clippy::manual_assert)]
#![deny(clippy::manual_instant_elapsed)]
// This is in rust 1.67, we can enable this after we upgrade rust.
//#![deny(clippy::manual_let_else)]
#![deny(clippy::manual_ok_or)]
#![deny(clippy::manual_string_new)]
#![deny(clippy::many_single_char_names)]
#![deny(clippy::map_unwrap_or)]
#![deny(clippy::match_bool)]
#![deny(clippy::match_on_vec_items)]
#![deny(clippy::match_same_arms)]
#![deny(clippy::match_wild_err_arm)]
#![deny(clippy::match_wildcard_for_single_variants)]
#![deny(clippy::maybe_infinite_iter)]
#![deny(clippy::mismatching_type_param_order)]
#![deny(clippy::missing_errors_doc)]
//#![deny(clippy::missing_panics_doc)] // This is enabled in physics crate.
//#![deny(clippy::module_name_repetitions)]
#![deny(clippy::must_use_candidate)]
#![deny(clippy::mut_mut)]
#![deny(clippy::naive_bytecount)]
#![deny(clippy::needless_bitwise_bool)]
#![deny(clippy::needless_continue)]
#![deny(clippy::needless_for_each)]
#![deny(clippy::needless_pass_by_value)]
#![deny(clippy::no_effect_underscore_binding)]
#![deny(clippy::option_option)]
#![deny(clippy::ptr_as_ptr)]
#![deny(clippy::range_minus_one)]
#![deny(clippy::range_plus_one)]
#![deny(clippy::redundant_closure_for_method_calls)]
#![deny(clippy::redundant_else)]
#![deny(clippy::ref_binding_to_reference)]
#![deny(clippy::ref_option_ref)]
#![deny(clippy::return_self_not_must_use)]
#![deny(clippy::same_functions_in_if_condition)]
#![deny(clippy::semicolon_if_nothing_returned)]
//#![deny(clippy::similar_names)]
#![deny(clippy::single_match_else)]
#![deny(clippy::stable_sort_primitive)]
#![deny(clippy::string_add_assign)]
#![deny(clippy::struct_excessive_bools)]
//#![deny(clippy::too_many_lines)]
#![deny(clippy::transmute_ptr_to_ptr)]
#![deny(clippy::trivially_copy_pass_by_ref)]
// This is in rust 1.67, we can enable this after we upgrade rust.
//#![deny(clippy::unchecked_duration_subtraction)]
#![deny(clippy::unicode_not_nfc)]
#![deny(clippy::uninlined_format_args)]
#![deny(clippy::unnecessary_join)]
#![deny(clippy::unnecessary_wraps)]
#![deny(clippy::unnested_or_patterns)]
#![allow(clippy::unreadable_literal)] // This is annoying.
#![deny(clippy::unsafe_derive_deserialize)]
#![deny(clippy::unused_async)]
#![deny(clippy::unused_self)]
#![deny(clippy::used_underscore_binding)]
#![deny(clippy::verbose_bit_mask)]
//#![deny(clippy::wildcard_imports)]
#![deny(clippy::zero_sized_map_values)]
#![allow(clippy::missing_panics_doc)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(feature = "unstable", feature(test))]
#[cfg(feature = "unstable")]
extern crate test;

pub extern crate glam_det as glam;
pub use chull_adapt::{ConvexHullConstructError, ConvexHullConstructState};
pub use collision_plugin::{CollisionShapePlugin, PairGenerateContext, PluginContainer};
pub use collision_tasks::pairs::{
    SphereIncludingPair, SphereIncludingPairWide, StandardPair, StandardPairBatch, StandardPairWide,
};
pub use collision_tasks::{
    Batches, BatchesReductionContext, CandidateScalarsReducer, Candidates, CollisionTask,
    ContactContext, IterContext, ManifoldCandidateScalarSmallVec, ReduceContext, ReductionId,
    ShapeBatches, ShapeTester, ShapeWideTester, TransformWide,
};
pub use convex_contact_manifold::{
    Convex4ContactManifoldWide, ConvexContactManifold, Face, ManifoldCandidate,
    ManifoldCandidateWide, ManifoldRef, OneContact,
};
pub use ray::{Ray, Raycast, RaycastHitResult};
pub use shapes::{
    Capsule, CapsuleWide, ComplexShapeId, ComplexShapeTrait, ComputeVolume, ConvexHull,
    ConvexHullId, ConvexHullPointsIter, ConvexHullTriangleIndexIter, ConvexHullTriangleIter,
    ConvexHullWide, ConvexMesh, Cuboid, CuboidExt, CuboidWide, Cylinder, CylinderWide,
    InfinitePlane, MeshId, Shape, ShapeContainer, ShapePlugin, ShapeRef, Sphere, SphereWide,
    Triangle, TriangleWide,
};
pub use traits::{
    Aabb3, ArrayGetter, BaseShapeWide, CollisionCallBack, ComputeAabb3,
    ContactContext as ContactContextTester, ContactManifold, ContactManifoldWide, ContainsPoint,
    ContainsResult, ConvexShape, CreateShapeWide, Expansion, MinkowskiSupportResultWide,
    MinkowskiSupportWide, PairBatch, PairTest, PairWideTest, SignedDistanceToPoint,
};
pub use volume::aabb2::Aabb2;
pub use volume::OrientedBoundingBox3;
pub mod ray;
mod shapes;
pub mod volume;

mod collision_tasks;
mod convex_contact_manifold;
mod geometric_tools;
pub mod minkowski;
pub mod overlap;

mod collision_plugin;
#[cfg(feature = "contact_debug")]
pub mod debug;
mod traits;