Skip to main content

euv_core/game/algorithms/kinematics/
enum.rs

1use super::*;
2
3/// Convex 3D primitive or hull supported by `GjkEpaSolver3D`.
4#[derive(Clone, Debug, PartialEq)]
5pub enum ConvexShape3D {
6    /// Solid 3D sphere centered at `center` with `radius`.
7    Sphere {
8        /// World-space sphere center.
9        center: Vec3,
10        /// Positive sphere radius.
11        radius: f32,
12    },
13    /// Oriented 3D box (OBB) with center, local half-extents, and unit rotation quaternion.
14    Box {
15        /// World-space box center.
16        center: Vec3,
17        /// Positive local half-extents along X, Y, and Z.
18        half_extents: Vec3,
19        /// World orientation quaternion.
20        rotation: Quat,
21    },
22    /// Oriented 3D capsule aligned along its local Y axis `[-half_height, +half_height]`.
23    Capsule {
24        /// World-space capsule center.
25        center: Vec3,
26        /// Half-length of the internal cylindrical spine along local Y.
27        half_height: f32,
28        /// Hemispherical cap and barrel radius.
29        radius: f32,
30        /// World orientation quaternion.
31        rotation: Quat,
32    },
33    /// Oriented 3D cylinder aligned along its local Y axis `[-half_height, +half_height]`.
34    Cylinder {
35        /// World-space cylinder center.
36        center: Vec3,
37        /// Half-height along local Y.
38        half_height: f32,
39        /// Circular cross-section radius in local XZ.
40        radius: f32,
41        /// World orientation quaternion.
42        rotation: Quat,
43    },
44    /// Arbitrary convex polyhedron defined by local-space vertices and a world rigid transform.
45    ConvexHull {
46        /// Local-space convex hull vertices.
47        vertices: Vec<Vec3>,
48        /// World-space translation offset.
49        position: Vec3,
50        /// World-space rotation quaternion.
51        rotation: Quat,
52    },
53}
54
55/// Active tracking and cinematic mode of `CameraRig3D`.
56#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
57pub enum CameraRigMode {
58    /// Third-person damped spring-arm follow with obstacle pullback.
59    #[default]
60    SpringArm,
61    /// Smooth spherical yaw/pitch orbit around a target point.
62    Orbit,
63    /// First-person eye-mounted look controller.
64    FirstPerson,
65    /// Catmull-Rom cinematic spline rail camera.
66    SplineRail,
67}