omp_gdk/scripting/checkpoints/
mod.rs

1use crate::types::vector::Vector3;
2
3pub mod events;
4pub mod functions;
5
6pub use functions::load_functions;
7
8/// Types Of Race Checkpoints
9#[repr(C)]
10#[derive(PartialEq, Clone, Copy, Debug)]
11pub enum RaceCheckpointType {
12    /// Normal, must have nextPosition, else it shows as RACE_FINISH
13    Normal = 0,
14    /// Finish checkpoint, must have no nextPosition, else it shows as RACE_NORMAL
15    Finish,
16    /// Nothing (Only the checkpoint without anything on it)     
17    Nothing,
18    /// Normal Air Checkpoint
19    AirNormal,
20    /// Air Finish Checkpoint
21    AirFinish,
22    /// Air (rotates and stops)
23    AirOne,
24    /// Air (increases, decreases and disappears)
25    AirTwo,
26    /// Air (swings down and up)
27    AirThree,
28    /// Air (swings up and down)
29    AirFour,
30    /// None
31    None,
32}
33
34/// Player race checkpoint information
35pub struct PlayerRaceCheckPointData {
36    /// position of checkpoint
37    pub center_pos: Vector3,
38    /// coordinates of next checkpoint, also used for arrow direction
39    pub next_pos: Vector3,
40    /// radius of the checkpoint
41    pub radius: f32,
42}
43
44impl PlayerRaceCheckPointData {
45    pub fn new(center_pos: Vector3, next_pos: Vector3, radius: f32) -> Self {
46        Self {
47            center_pos,
48            next_pos,
49            radius,
50        }
51    }
52}
53
54/// Player checkpoint information
55#[derive(PartialEq, Clone, Copy, Debug)]
56pub struct PlayerCheckPointData {
57    /// position of checkpoint
58    pub center_pos: Vector3,
59    /// radius of the checkpoint
60    pub radius: f32,
61}
62
63impl PlayerCheckPointData {
64    pub fn new(center_pos: Vector3, radius: f32) -> Self {
65        Self { center_pos, radius }
66    }
67}