1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
use crate as bevy_reflect;
use crate::{ReflectDeserialize, ReflectSerialize};
use bevy_math::{primitives::*, Vec3};
use bevy_reflect_derive::{impl_reflect, impl_reflect_value};

impl_reflect_value!(::bevy_math::primitives::Direction3d(
    Debug,
    PartialEq,
    Serialize,
    Deserialize
));

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Sphere {
        radius: f32,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Plane3d {
        normal: Direction3d,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Line3d {
        direction: Direction3d,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Segment3d {
        direction: Direction3d,
        half_length: f32,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq)]
    #[type_path = "bevy_math::primitives"]
    struct Polyline3d<const N: usize> {
        vertices: [Vec3; N],
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Cuboid {
        half_size: Vec3,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Cylinder {
        radius: f32,
        half_height: f32,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Capsule3d {
        radius: f32,
        half_length: f32,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Cone {
        radius: f32,
        height: f32,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct ConicalFrustum {
        radius_top: f32,
        radius_bottom: f32,
        height: f32,
    }
);

impl_reflect!(
    #[reflect(Debug, PartialEq, Serialize, Deserialize)]
    #[type_path = "bevy_math::primitives"]
    struct Torus {
        minor_radius: f32,
        major_radius: f32,
    }
);