physis/layer/
shared_group.rs

1// SPDX-FileCopyrightText: 2025 Joshua Goins <josh@redstrate.com>
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4use binrw::{binread, binrw};
5
6use super::read_bool_from;
7
8#[binrw]
9#[brw(repr = i32)]
10#[derive(Debug, PartialEq)]
11pub enum DoorState {
12    Auto = 0x1,
13    Open = 0x2,
14    Closed = 0x3,
15}
16
17#[binrw]
18#[brw(repr = i32)]
19#[derive(Debug, PartialEq)]
20pub enum RotationState {
21    Rounding = 0x1,
22    Stopped = 0x2,
23}
24
25#[binrw]
26#[brw(repr = i32)]
27#[derive(Debug, PartialEq)]
28pub enum TransformState {
29    Play = 0x0,
30    Stop = 0x1,
31    Replay = 0x2,
32    Reset = 0x3,
33}
34
35#[binrw]
36#[brw(repr = i32)]
37#[derive(Debug, PartialEq)]
38pub enum ColourState {
39    Play = 0x0,
40    Stop = 0x1,
41    Replay = 0x2,
42    Reset = 0x3,
43}
44
45#[binread]
46#[derive(Debug)]
47#[br(little)]
48pub struct SharedGroupInstance {
49    pub asset_path_offset: u32,
50    pub initial_door_state: DoorState,
51    pub overriden_members: i32,
52    pub overriden_members_count: i32,
53    pub initial_rotation_state: RotationState,
54    #[br(map = read_bool_from::<u8>)]
55    pub random_timeline_auto_play: bool,
56    #[br(map = read_bool_from::<u8>)]
57    pub random_timeline_loop_playback: bool,
58    #[br(map = read_bool_from::<u8>)]
59    pub collision_controllable_without_eobj: bool,
60    padding: u8,
61    pub bound_client_path_instance_id: u32,
62    pub move_path_settings: i32,
63    #[br(map = read_bool_from::<u8>)]
64    pub not_create_navimesh_door: bool,
65    padding1: [u8; 3],
66    pub initial_transform_state: TransformState,
67    pub initial_color_state: ColourState,
68    // TODO: read move path settings
69}