@pixygon/avatar 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Avatar type definitions — mirrors the Rust AvatarAppearance from infinite-game.
3
+ *
4
+ * Keep in sync with: crates/infinite-game/src/avatar/mod.rs
5
+ */
6
+
7
+ /** RGB colour triplet (0.0 – 1.0 per channel). */
8
+ export type Colour3 = [number, number, number]
9
+
10
+ /** Complete avatar appearance. */
11
+ export interface AvatarAppearance {
12
+ body: AvatarBody
13
+ head: AvatarHead
14
+ skin_color: Colour3
15
+ }
16
+
17
+ /** Body shape parameters. */
18
+ export interface AvatarBody {
19
+ /** 0.0 = short, 1.0 = tall */
20
+ height: number
21
+ /** 0.0 = thin, 1.0 = heavy */
22
+ build: number
23
+ }
24
+
25
+ /** Head & facial feature parameters. */
26
+ export interface AvatarHead {
27
+ /** Head width scale (0.5 – 1.5, default 1.0) */
28
+ width: number
29
+ /** Head height scale (0.5 – 1.5, default 1.0) */
30
+ height: number
31
+
32
+ // Eyes
33
+ eye_style: number
34
+ eye_color: Colour3
35
+ eye_y: number
36
+ eye_spacing: number
37
+ eye_size: number
38
+ eye_rotation: number
39
+
40
+ // Eyebrows
41
+ brow_style: number
42
+ brow_color: Colour3
43
+ brow_y: number
44
+ brow_spacing: number
45
+ brow_size: number
46
+ brow_rotation: number
47
+
48
+ // Nose
49
+ nose_style: number
50
+ nose_y: number
51
+ nose_size: number
52
+
53
+ // Mouth
54
+ mouth_style: number
55
+ mouth_y: number
56
+ mouth_size: number
57
+ mouth_color: Colour3
58
+
59
+ // Hair
60
+ hair_style: number
61
+ hair_color: Colour3
62
+
63
+ // Facial hair (0 = none)
64
+ facial_hair_style: number
65
+ facial_hair_color: Colour3
66
+
67
+ // Glasses (0 = none)
68
+ glasses_style: number
69
+ glasses_color: Colour3
70
+ }
71
+
72
+ /** One bone segment for the capsule-body renderer. */
73
+ export interface BoneSegment {
74
+ start: [number, number, number]
75
+ end: [number, number, number]
76
+ radius: number
77
+ }
78
+
79
+ /** Head transform — position + ellipsoid radii. */
80
+ export interface HeadInfo {
81
+ center: [number, number, number]
82
+ radius_x: number
83
+ radius_y: number
84
+ radius_z: number
85
+ }
86
+
87
+ /** Style count constants — keep in sync with Rust. */
88
+ export const STYLE_COUNTS = {
89
+ eye: 12,
90
+ brow: 8,
91
+ nose: 8,
92
+ mouth: 8,
93
+ hair: 16,
94
+ facial_hair: 8,
95
+ glasses: 6,
96
+ } as const