semantic-scene 0.1.1

Rust parser for semantic scene descriptors, currently focused on Habitat-Sim Matterport3D .house files.
Documentation
use crate::{Aabb, Obb, Vec3};

#[derive(Debug, Clone, PartialEq)]
pub enum Mp3dRecord {
    House(HouseRecord),
    Level(LevelRecord),
    Region(RegionRecord),
    Category(CategoryRecord),
    Object(ObjectRecord),
    Segment(SegmentRecord),
    Ignored,
}

#[derive(Debug, Clone, PartialEq)]
pub struct HouseRecord {
    pub name: String,
    pub label: String,
    pub images: usize,
    pub panoramas: usize,
    pub vertices: usize,
    pub surfaces: usize,
    pub segments: usize,
    pub objects: usize,
    pub categories: usize,
    pub regions: usize,
    pub portals: usize,
    pub levels: usize,
    pub aabb: Aabb,
}

#[derive(Debug, Clone, PartialEq)]
pub struct LevelRecord {
    pub index: i32,
    pub label: String,
    pub position: Vec3,
    pub aabb: Aabb,
}

#[derive(Debug, Clone, PartialEq)]
pub struct RegionRecord {
    pub index: i32,
    pub level_index: i32,
    pub category_code: char,
    pub position: Vec3,
    pub aabb: Aabb,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CategoryRecord {
    pub index: i32,
    pub raw_index: i32,
    pub raw_name: String,
    pub mpcat40_index: i32,
    pub mpcat40_name: String,
}

#[derive(Debug, Clone, PartialEq)]
pub struct ObjectRecord {
    pub index: i32,
    pub region_index: i32,
    pub category_index: i32,
    pub obb: Obb,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SegmentRecord {
    pub object_index: i32,
    pub segment_id: i32,
}