1define_api_id!(0x1df7_daa6_26c6_0ecc, "world-v1");
2
3pub use crate::world_v0::ComponentType;
4pub use crate::world_v0::EntityHandle;
5pub use crate::world_v0::ValueType;
6use bytemuck::CheckedBitPattern;
7use bytemuck::NoUninit;
8use bytemuck::Pod;
9use bytemuck::Zeroable;
10
11pub type DataHandle = u64;
12
13#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
17#[repr(u32)]
18#[non_exhaustive]
19pub enum ParameterSemantic {
20 Unspecified = 0,
21 EntityHandle = 1,
22 Position = 3,
25 Scale = 4,
26 Rotation = 5,
27 Color = 6,
28 MeshStyleFlags = 7,
29 DynamicLockFlags = 8,
30 CharacterCollisionFlags = 9,
31 JointType = 10,
32 JointLimitType = 11,
33 NormalizedDirection = 12,
34 Direction = 13,
35 Bitmask = 15,
36 CameraProjectionMode = 16,
37 AngleDegrees = 17,
38 DataHandle = 18,
39 Count = 19,
40}
41
42#[derive(Debug, Copy, Clone)]
44#[repr(C)]
45pub struct ParameterMetaDataEntry {
46 pub parameter_id: u32,
47 pub name: DataHandle, pub value_type: ValueType,
49
50 pub semantic: ParameterSemantic,
51 pub size_semantic_data_entry: u32,
53 pub semantic_data: DataHandle,
54}
55
56#[derive(Debug, Copy, Clone)]
58#[repr(C)]
59pub struct ComponentMetaDataEntry {
60 pub component_type: ComponentType,
61 pub name: DataHandle, pub size_parameter_entry: u32, pub parameters: DataHandle,
64}
65
66#[derive(Debug, Copy, Clone)]
68#[repr(C)]
69pub struct ComponentsMetaDataEntry {
70 pub size_component_entry: u32, pub components: DataHandle,
72}
73
74#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq, NoUninit, CheckedBitPattern)]
76#[repr(u32)]
77#[non_exhaustive]
78pub enum WorldEntityQueryType {
79 AllEntities = 0,
80 TransformChildren = 1,
81 TransformDescendants = 2,
82 AllEntitiesNoLayerFilter = 3,
83 TransformChildrenNoLayerFilter = 4,
84 TransformDescendantsNoLayerFilter = 5,
85}
86
87#[derive(Debug, Copy, Clone, NoUninit, CheckedBitPattern)]
93#[repr(C)]
94pub struct WorldEntityQuery {
95 pub layer_mask: u64,
97
98 pub num_include_tags: u8,
100
101 pub num_exclude_tags: u8,
103
104 pub _pad0: [u8; 6],
105
106 pub include_tags: [u64; 16],
108
109 pub exclude_tags: [u64; 16],
111
112 pub query_type: WorldEntityQueryType,
113
114 pub _pad1: u32,
115
116 pub root_entity: EntityHandle,
117}
118
119#[derive(Debug, Copy, Clone, Pod, Zeroable)]
120#[repr(C)]
121pub struct PhysicsShapeBox {
122 pub center: [f32; 3],
123 pub half_size: [f32; 3],
124 pub rotation: [f32; 4],
125}
126
127#[derive(Debug, Copy, Clone, Pod, Zeroable)]
128#[repr(C)]
129pub struct PhysicsShapeSphere {
130 pub center: [f32; 3],
131 pub radius: f32,
132}
133
134#[derive(Debug, Copy, Clone, Pod, Zeroable)]
135#[repr(C)]
136pub struct PhysicsShapeCapsule {
137 pub pos0: [f32; 3],
138 pub pos1: [f32; 3],
139 pub radius: f32,
140}
141
142#[derive(Debug, Copy, Clone, Pod, Zeroable)]
143#[repr(C)]
144pub struct CompoundPhysicsShape {
145 pub num_boxes: u32,
146 pub boxes_ptr: u32,
147 pub num_spheres: u32,
148 pub spheres_ptr: u32,
149 pub num_capsules: u32,
150 pub capsules_ptr: u32,
151}