🐛 the demo can load a do-nothing anim now
parent
5515362d7b
commit
10bd7278d7
27
src/main.rs
27
src/main.rs
|
@ -164,6 +164,12 @@ fn main () {
|
|||
format: iqm::FLOAT,
|
||||
size: 3,
|
||||
},
|
||||
iqm::VertexArrayUnplaced {
|
||||
r#type: iqm::TANGENT,
|
||||
flags: 0,
|
||||
format: iqm::FLOAT,
|
||||
size: 4,
|
||||
},
|
||||
iqm::VertexArrayUnplaced {
|
||||
r#type: iqm::BLENDINDEXES,
|
||||
flags: 0,
|
||||
|
@ -183,7 +189,7 @@ fn main () {
|
|||
name: u32::try_from (texts.len ()).unwrap (),
|
||||
parent: -1,
|
||||
translate: [0.0, 0.0, 0.0],
|
||||
rotate: [1.0, 0.0, 0.0, 0.0],
|
||||
rotate: [0.0, 0.0, 0.0, 1.0],
|
||||
scale: [1.0, 1.0, 1.0],
|
||||
},
|
||||
];
|
||||
|
@ -193,8 +199,12 @@ fn main () {
|
|||
iqm::Pose {
|
||||
parent: -1,
|
||||
channelmask: 1, // Should be X translation
|
||||
channeloffset: [0.0; 10],
|
||||
channelscale: [16.0 / 32768.0; 10],
|
||||
channeloffset: [
|
||||
0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0,
|
||||
1.0, 1.0, 1.0,
|
||||
],
|
||||
channelscale: [0.0 / 32768.0; 10],
|
||||
},
|
||||
];
|
||||
|
||||
|
@ -203,7 +213,7 @@ fn main () {
|
|||
name: u32::try_from (texts.len ()).unwrap (),
|
||||
first_frame: 0,
|
||||
num_frames: 2,
|
||||
framerate: 5.0,
|
||||
framerate: 1.0,
|
||||
flags: 0,
|
||||
},
|
||||
];
|
||||
|
@ -213,7 +223,7 @@ fn main () {
|
|||
|
||||
let frames = [
|
||||
0,
|
||||
32768,
|
||||
0,
|
||||
];
|
||||
|
||||
let vertexes = vertexes;
|
||||
|
@ -375,6 +385,12 @@ fn main () {
|
|||
}
|
||||
}
|
||||
|
||||
for v in &vertexes {
|
||||
for x in [0.0, 0.0, 0.0, 1.0] {
|
||||
f.write_all (&(f32::to_le_bytes (x))).unwrap ();
|
||||
}
|
||||
}
|
||||
|
||||
for v in &vertexes {
|
||||
f.write_all (&[0, 0, 0, 0]).unwrap ();
|
||||
}
|
||||
|
@ -455,6 +471,7 @@ mod iqm {
|
|||
|
||||
pub const POSITION: u32 = 0;
|
||||
pub const NORMAL: u32 = 2;
|
||||
pub const TANGENT: u32 = 3;
|
||||
pub const BLENDINDEXES: u32 = 4;
|
||||
pub const BLENDWEIGHTS: u32 = 5;
|
||||
|
||||
|
|
Loading…
Reference in New Issue