physis/layer/
bg.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 ModelCollisionType {
12    None = 0x0,
13    Replace = 0x1,
14    Box = 0x2,
15}
16
17#[binread]
18#[derive(Debug)]
19#[br(little)]
20pub struct BGInstanceObject {
21    pub asset_path_string_offset: u32,
22    pub collision_asset_path_string_offset: u32,
23    pub collision_type: ModelCollisionType,
24    pub attribute_mask: u32,
25    pub attribute: u32,
26    pub collision_config: i32,
27    #[br(map = read_bool_from::<u8>)]
28    pub is_visible: bool,
29    #[br(map = read_bool_from::<u8>)]
30    pub render_shadow_enabled: bool,
31    #[br(map = read_bool_from::<u8>)]
32    pub render_light_shadow_enabeld: bool,
33    padding: u8,
34    pub render_model_clip_range: f32,
35}