Repository navigation
Expand file tree
/
Copy pathcollision_shape2d.rs
More file actions
63 lines (60 loc) · 1.92 KB
/
Copy pathcollision_shape2d.rs
File metadata and controls
63 lines (60 loc) · 1.92 KB
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
// SPDX-License-Identifier: MIT OR Apache-2.0
//! CollisionShape2D: geometric collider attached to a physics body or area.
use crate::schema::{DefaultPropVal, NodeTypeSchema, PropHint, PropSchema};
pub static SCHEMA: NodeTypeSchema = NodeTypeSchema {
type_name: "CollisionShape2D",
description: "Geometric collider attached to a parent physics body or Area2D.",
inherits: Some("Node2D"),
abstract_class: false,
props: PROPS,
};
pub static PROPS: &[PropSchema] = &[
PropSchema {
key: "shape",
label: "Shape",
doc: "Geometry kind: `box`, `circle`, or `capsule`.",
default_value: DefaultPropVal::Str("box"),
hint: PropHint::Enum(&["box", "circle", "capsule"]),
read_only: false,
},
PropSchema {
key: "size",
label: "Size",
doc: "Bounding box size in world units. Only used when `shape = \"box\"`.",
default_value: DefaultPropVal::Vec2(32.0, 32.0),
hint: PropHint::Vec2 { speed: 1.0 },
read_only: false,
},
PropSchema {
key: "radius",
label: "Radius",
doc: "Circle or capsule radius in world units.",
default_value: DefaultPropVal::Num(16.0),
hint: PropHint::Num {
speed: 1.0,
min: 0.1,
max: 10000.0,
},
read_only: false,
},
PropSchema {
key: "height",
label: "Height",
doc: "Capsule height in world units (excludes the two hemispherical caps).",
default_value: DefaultPropVal::Num(32.0),
hint: PropHint::Num {
speed: 1.0,
min: 0.1,
max: 10000.0,
},
read_only: false,
},
PropSchema {
key: "disabled",
label: "Disabled",
doc: "When true the collider is not registered with the physics world.",
default_value: DefaultPropVal::Bool(false),
hint: PropHint::Bool,
read_only: false,
},
];