mirror of
https://github.com/redstrate/Physis.git
synced 2025-04-26 14:17:45 +00:00
parent
7cf6ab8f60
commit
2e27a999d6
2 changed files with 32 additions and 10 deletions
15
src/model.rs
15
src/model.rs
|
@ -520,11 +520,13 @@ impl MDL {
|
|||
vertices[k as usize].bone_weight = MDL::read_byte_float4(&mut cursor).unwrap();
|
||||
}
|
||||
VertexType::Byte4 => {
|
||||
// TODO: This was used in Dawntrail models. Look into if this is really correct, but seems so?
|
||||
vertices[k as usize].bone_weight = MDL::read_byte_float4(&mut cursor).unwrap();
|
||||
}
|
||||
VertexType::Unknown1 => {
|
||||
// TODO: Unimplemented, needed for Dawntrail?
|
||||
let bytes = MDL::read_byte4(&mut cursor).unwrap();
|
||||
vertices[k as usize].bone_weight = [
|
||||
f32::from(bytes[0]),
|
||||
f32::from(bytes[1]),
|
||||
f32::from(bytes[2]),
|
||||
f32::from(bytes[3])
|
||||
];
|
||||
}
|
||||
_ => {
|
||||
panic!("Unexpected vertex type for blendweight: {:#?}", element.vertex_type);
|
||||
|
@ -536,9 +538,6 @@ impl MDL {
|
|||
VertexType::Byte4 => {
|
||||
vertices[k as usize].bone_id = MDL::read_byte4(&mut cursor).unwrap();
|
||||
}
|
||||
VertexType::Unknown1 => {
|
||||
// TODO: Unimplemented, needed for Dawntrail?
|
||||
}
|
||||
_ => {
|
||||
panic!("Unexpected vertex type for blendindice: {:#?}", element.vertex_type);
|
||||
}
|
||||
|
|
|
@ -12,17 +12,40 @@ const END_OF_STREAM: u8 = 0xFF;
|
|||
#[brw(repr = u8)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
pub enum VertexType {
|
||||
/// 1 32-bit float
|
||||
Single1 = 0,
|
||||
/// 2 32-bit floats
|
||||
Single2 = 1,
|
||||
/// 3 32-bit floats
|
||||
Single3 = 2,
|
||||
/// 4 32-bit floats
|
||||
Single4 = 3,
|
||||
|
||||
/// 4 bytes
|
||||
Byte4 = 5,
|
||||
|
||||
/// 2 16-bit signed integers
|
||||
Short2 = 6,
|
||||
/// 4 16-bit signed integers
|
||||
Short4 = 7,
|
||||
|
||||
/// 4 8-bit floats
|
||||
ByteFloat4 = 8,
|
||||
|
||||
/// Duplicate of Short2?
|
||||
Short2n = 9,
|
||||
/// Duplicate of Short4?
|
||||
Short4n = 10,
|
||||
|
||||
/// 2 16-bit floats
|
||||
Half2 = 13,
|
||||
/// 4 16-bit floats
|
||||
Half4 = 14,
|
||||
|
||||
// Unknown vertex type, I seen them used in BlendIndices in Dawntrail
|
||||
Unknown1 = 17
|
||||
/// 2 16-bit unsigned integers
|
||||
UnsignedShort2 = 16,
|
||||
/// 4 16-bit unsigned integers
|
||||
UnsignedShort4 = 17
|
||||
}
|
||||
|
||||
#[binrw]
|
||||
|
|
Loading…
Add table
Reference in a new issue