nightshade 0.13.3

A cross-platform data-oriented game engine.
Documentation
//! Physics simulation using Rapier3D.
//!
//! Provides rigid body dynamics, collision detection, and character controllers:
//!
//! - [`RigidBodyComponent`]: Dynamic, kinematic, or static physics body
//! - [`ColliderComponent`]: Collision shape with physical material properties
//! - [`ColliderShape`]: Ball, cuboid, capsule, cylinder, cone, convex mesh, trimesh, heightfield
//! - [`CharacterControllerComponent`]: First-person kinematic character with walking, jumping, crouching
//! - [`PhysicsInterpolation`]: Smooth rendering between fixed timestep physics updates
//!
//! The physics feature is optional. Component types are always available for serialization,
//! but simulation requires the `physics` feature flag to be enabled.
//!
//! # First-Person Character Controller
//!
//! The easiest way to add player movement is with the built-in first-person controller:
//!
//! ```ignore
//! let player = spawn_first_person_player(
//!     world,
//!     Vec3::new(0.0, 2.0, 0.0),  // spawn position
//!     1.8,                        // height in meters
//!     0.3,                        // capsule radius
//! );
//! world.resources.active_camera = Some(player);
//! ```
//!
//! Then run the controller system each frame:
//!
//! ```ignore
//! fn run_systems(&mut self, world: &mut World) {
//!     first_person_controller_system(world);
//! }
//! ```
//!
//! # Dynamic Rigid Bodies
//!
//! Create objects affected by gravity and collisions:
//!
//! ```ignore
//! let entity = spawn_cube_at(world, Vec3::new(0.0, 5.0, 0.0));
//! world.core.add_rigid_body(entity);
//! world.core.set_rigid_body(entity, RigidBodyComponent::new_dynamic()
//!     .with_mass(10.0));
//! world.core.add_collider(entity);
//! world.core.set_collider(entity, ColliderComponent::new_cuboid(0.5, 0.5, 0.5)
//!     .with_restitution(0.3));
//! ```
//!
//! # Static Colliders
//!
//! Create immovable collision geometry (floors, walls):
//!
//! ```ignore
//! let floor = spawn_plane_at(world, Vec3::zeros());
//! world.core.add_rigid_body(floor);
//! world.core.set_rigid_body(floor, RigidBodyComponent::new_static());
//! world.core.add_collider(floor);
//! world.core.set_collider(floor, ColliderComponent::new_cuboid(50.0, 0.1, 50.0));
//! ```
//!
//! # Trigger Volumes (Sensors)
//!
//! Create colliders that detect overlaps without physical response:
//!
//! ```ignore
//! world.core.set_collider(entity, ColliderComponent::new_ball(2.0).as_sensor());
//! ```
//!
//! # Physics World Access
//!
//! For advanced queries and direct Rapier access:
//!
//! ```ignore
//! let physics = &world.resources.physics;
//! // Ray casting, overlap queries, etc. via physics.rigid_body_set, physics.collider_set
//! ```
//!
//! # Fixed Timestep
//!
//! Physics runs at a fixed 60 Hz timestep with interpolation for smooth rendering.
//! Configure via `world.resources.physics.timestep`.

pub mod components;
pub mod types;

#[cfg(feature = "physics")]
pub mod character_controller;
#[cfg(feature = "physics")]
pub mod commands;
#[cfg(feature = "physics")]
pub mod debug;
#[cfg(feature = "physics")]
pub mod events;
#[cfg(feature = "physics")]
pub mod grab;
#[cfg(feature = "physics")]
pub mod joints;
#[cfg(feature = "physics")]
pub mod resources;
#[cfg(feature = "physics")]
pub mod systems;

pub use components::*;
pub use types::*;

#[cfg(feature = "physics")]
pub use character_controller::*;
#[cfg(feature = "physics")]
pub use commands::*;
#[cfg(feature = "physics")]
pub use debug::*;
#[cfg(feature = "physics")]
pub use events::*;
#[cfg(feature = "physics")]
pub use joints::*;
#[cfg(feature = "physics")]
pub use resources::*;
#[cfg(feature = "physics")]
pub use systems::*;