pub struct MeshObject<A: for<'a> BinRead<Args<'a> = ()> + SsbhWrite> {
Show 22 fields pub name: SsbhString, pub subindex: u64, pub parent_bone_name: SsbhString, pub vertex_count: u32, pub vertex_index_count: u32, pub unk2: u32, pub vertex_buffer0_offset: u32, pub vertex_buffer1_offset: u32, pub vertex_buffer2_offset: u32, pub vertex_buffer3_offset: u32, pub stride0: u32, pub stride1: u32, pub stride2: u32, pub stride3: u32, pub index_buffer_offset: u32, pub unk8: u32, pub draw_element_type: DrawElementType, pub use_vertex_skinning: u32, pub sort_bias: i32, pub depth_flags: DepthFlags, pub bounding_info: BoundingInfo, pub attributes: SsbhArray<A>,
}
Expand description

An indexed vertex collection identified by its name and subindex. In addition to organizing the model into logical components, material and rigging data are assigned per MeshObject.

Fields§

§name: SsbhString

The name of the MeshObject such as "c00BodyShape". Objects with the same name should have a unique subindex.

§subindex: u64

The index for multiple objects of the same name starting from 0.

§parent_bone_name: SsbhString

If use_vertex_skinning is set to 0, the object’s position is determined by the SkelBoneEntry with matching name. Otherwise, parent_bone_name is set to an empty string.

§vertex_count: u32

The number of elements for this object in the vertex_buffers Each attribute in attributes should have the same number of elements.

§vertex_index_count: u32

The number of elements for this object in the index_buffer. This determines the actual number of vertices rendered and will typically be larger than vertex_count.

§unk2: u32§vertex_buffer0_offset: u32§vertex_buffer1_offset: u32§vertex_buffer2_offset: u32§vertex_buffer3_offset: u32§stride0: u32

The stride in bytes for the first buffer in vertex_buffers.

§stride1: u32

The stride in bytes for the second buffer in vertex_buffers.

§stride2: u32

The stride in bytes for the third buffer in vertex_buffers.

§stride3: u32

The stride in bytes for the fourth buffer in vertex_buffers.

§index_buffer_offset: u32

The byte offset for the start of this object’s vertex indices in the index_buffer. The number of bytes to read is determined by draw_element_type and vertex_index_count.

§unk8: u32§draw_element_type: DrawElementType

The data type for the vertex indices stored in index_buffer.

§use_vertex_skinning: u32

A value of 1 uses the weights and influences in rigging_buffers A value of 0 disables vertex skinning, so vertices inherit the transforms determined by parent_bone_name.

§sort_bias: i32

An offset to affect this object’s sort order, which can help resolve alpha blending issues caused by incorrect render order.

§depth_flags: DepthFlags

Flags to control depth testing.

§bounding_info: BoundingInfo§attributes: SsbhArray<A>

Describes how the vertex attribute data for this object is stored in the vertex_buffers.

Trait Implementations§

source§

impl<A: for<'a> BinRead<Args<'a> = ()> + SsbhWrite> BinRead for MeshObject<A>

§

type Args<'__binrw_generated_args_lifetime> = ()

The type used for the args parameter of read_args() and read_options(). Read more
source§

fn read_options<R: Read + Seek>( __binrw_generated_var_reader: &mut R, __binrw_generated_var_endian: Endian, __binrw_generated_var_arguments: Self::Args<'_> ) -> BinResult<Self>

Read Self from the reader using the given Endian and arguments. Read more
source§

fn read_be<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming big-endian byte order. Read more
source§

fn read_le<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read Self from the reader using default arguments and assuming little-endian byte order. Read more
source§

fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + Seek, Self::Args<'a>: for<'a> Required,

Read T from the reader assuming native-endian byte order. Read more
source§

fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming big-endian byte order, using the given arguments. Read more
source§

fn read_le_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read Self from the reader, assuming little-endian byte order, using the given arguments. Read more
source§

fn read_ne_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
where R: Read + Seek,

Read T from the reader, assuming native-endian byte order, using the given arguments. Read more
source§

impl<A: Clone + for<'a> BinRead<Args<'a> = ()> + SsbhWrite> Clone for MeshObject<A>

source§

fn clone(&self) -> MeshObject<A>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<A: Debug + for<'a> BinRead<Args<'a> = ()> + SsbhWrite> Debug for MeshObject<A>

source§

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

Formats the value using the given formatter. Read more
source§

impl<A: PartialEq + for<'a> BinRead<Args<'a> = ()> + SsbhWrite> PartialEq for MeshObject<A>

source§

fn eq(&self, other: &MeshObject<A>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<A: for<'a> BinRead<Args<'a> = ()> + SsbhWrite> SsbhWrite for MeshObject<A>

source§

fn ssbh_write<W: Write + Seek>( &self, writer: &mut W, data_ptr: &mut u64 ) -> Result<()>

Writes the byte representation of self to writer. data_ptr is assumed to be the absolute offset where the next data stored behind an offset will be written. Struct that contains no offsets as fields can skip updating data_ptr. Read more
source§

fn size_in_bytes(&self) -> u64

The offset in bytes between successive elements in an array of this type. This should include any alignment or padding.
source§

fn alignment_in_bytes() -> u64

The alignment for pointers of this type, which is useful for offset calculations.
source§

fn write<W>(&self, writer: &mut W) -> Result<(), Error>
where W: Write + Seek,

Writes the byte representation of self to writer. This is a convenience method for ssbh_write that handles initializing the data pointer.
source§

impl<A: for<'a> BinRead<Args<'a> = ()> + SsbhWrite> StructuralPartialEq for MeshObject<A>

Auto Trait Implementations§

§

impl<A> RefUnwindSafe for MeshObject<A>
where A: RefUnwindSafe,

§

impl<A> Send for MeshObject<A>
where A: Send,

§

impl<A> Sync for MeshObject<A>
where A: Sync,

§

impl<A> Unpin for MeshObject<A>
where A: Unpin,

§

impl<A> UnwindSafe for MeshObject<A>
where A: UnwindSafe,

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> 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> ToOwned for T
where T: Clone,

§

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.