Skip to main content

RobSegment

Struct RobSegment 

Source
pub struct RobSegment {
    pub total_size: u32,
    pub segment_name: [u8; 8],
    pub segment_type: u16,
    pub segment_flags: u16,
    pub segment_attribs: u8,
    pub _face_count_low: [u8; 3],
    pub _unused_14: u32,
    pub bbox: SegmentBBox,
    pub data_size: u32,
    pub data: Vec<u8>,
}
Expand description

Parsed ROB segment record with metadata and optional payload bytes.

Fields§

§total_size: u32§segment_name: [u8; 8]§segment_type: u16§segment_flags: u16§segment_attribs: u8

Attribute flags byte at offset 0x10. 0x02 = texture preload, 0x40 = special object.

§_face_count_low: [u8; 3]

Bytes at 0x11..0x14: collision flags, reserved zero, and face_count mod 256.

§_unused_14: u32

Never read at runtime.

§bbox: SegmentBBox§data_size: u32§data: Vec<u8>

Implementations§

Source§

impl RobSegment

Source

pub fn name(&self) -> String

Returns the segment name decoded from its 8-byte field.

Source

pub fn render_mode(&self) -> u8

Render mode derived from the high byte of segment_flags. Value 0 or >0xFD defaults to 0xFF (standard rendering).

Source

pub const fn has_embedded_3d_data(&self) -> bool

Returns true when this segment stores embedded 3D model bytes.

Source

pub const fn has_special_embedded_data(&self) -> bool

Returns true when this segment stores embedded special-object bytes.

Source

pub const fn points_to_external_file(&self) -> bool

Returns true when this segment references an external file.

Source

pub fn parse_embedded_3d_data(&self) -> Result<Model3DFile>

Parses embedded 3D bytes in this segment into a Model3DFile.

Trait Implementations§

Source§

impl Clone for RobSegment

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RobSegment

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<U, T> ToOwnedObj<U> for T
where U: FromObjRef<T>,

Source§

fn to_owned_obj(&self, data: FontData<'_>) -> U

Convert this type into T, using the provided data to resolve any offsets.
Source§

impl<U, T> ToOwnedTable<U> for T
where U: FromTableRef<T>,

Source§

fn to_owned_table(&self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.