Struct ssbh_lib::formats::mesh::MeshObject
source · 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>
impl<A: for<'a> BinRead<Args<'a> = ()> + SsbhWrite> BinRead for MeshObject<A>
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>
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>
source§fn read_be<R>(reader: &mut R) -> Result<Self, Error>
fn read_be<R>(reader: &mut R) -> Result<Self, Error>
Self
from the reader using default arguments and assuming
big-endian byte order. Read moresource§fn read_le<R>(reader: &mut R) -> Result<Self, Error>
fn read_le<R>(reader: &mut R) -> Result<Self, Error>
Self
from the reader using default arguments and assuming
little-endian byte order. Read moresource§fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
fn read_ne<R>(reader: &mut R) -> Result<Self, Error>
T
from the reader assuming native-endian byte order. Read moresource§fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
fn read_be_args<R>(reader: &mut R, args: Self::Args<'_>) -> Result<Self, Error>
Self
from the reader, assuming big-endian byte order, using the
given arguments. Read moresource§impl<A: Clone + for<'a> BinRead<Args<'a> = ()> + SsbhWrite> Clone for MeshObject<A>
impl<A: Clone + for<'a> BinRead<Args<'a> = ()> + SsbhWrite> Clone for MeshObject<A>
source§fn clone(&self) -> MeshObject<A>
fn clone(&self) -> MeshObject<A>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<A: PartialEq + for<'a> BinRead<Args<'a> = ()> + SsbhWrite> PartialEq for MeshObject<A>
impl<A: PartialEq + for<'a> BinRead<Args<'a> = ()> + SsbhWrite> PartialEq for MeshObject<A>
source§fn eq(&self, other: &MeshObject<A>) -> bool
fn eq(&self, other: &MeshObject<A>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<A: for<'a> BinRead<Args<'a> = ()> + SsbhWrite> SsbhWrite for MeshObject<A>
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<()>
fn ssbh_write<W: Write + Seek>( &self, writer: &mut W, data_ptr: &mut u64 ) -> Result<()>
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