@@ -9,7 +9,7 @@ use xmlparser as xml;
99
1010use crate :: audiofile:: dynamic:: { load_audio_file, AudioFile } ;
1111use crate :: streamer:: FileStreamer ;
12- use crate :: transform:: { parse_pos, parse_rot, parse_transform, parse_vol, Transform , Vec3 } ;
12+ use crate :: transform:: { parse_pos, parse_rot, parse_transform, parse_vol, Quat , Transform , Vec3 } ;
1313use crate :: { Source , Transformer , REFERENCE_ID } ;
1414
1515use super :: error:: ParseError ;
@@ -1018,8 +1018,8 @@ impl<'a> Element<'a> for TransformElement {
10181018 }
10191019
10201020 let mut positions = Vec :: < Vec3 > :: new ( ) ;
1021- let mut rotations = Vec :: new ( ) ;
1022- let mut volumes = Vec :: new ( ) ;
1021+ let mut rotations = Vec :: < Quat > :: new ( ) ;
1022+ let mut volumes = Vec :: < f32 > :: new ( ) ;
10231023 let mut times_pos = Vec :: < Option < f32 > > :: new ( ) ;
10241024 let mut times_rot = Vec :: < Option < f32 > > :: new ( ) ;
10251025 let mut times_vol = Vec :: < Option < f32 > > :: new ( ) ;
@@ -1215,6 +1215,10 @@ impl<'a> Element<'a> for TransformElement {
12151215 } ;
12161216
12171217 for ( rot_idx, pos_idx) in rot_time_from_pos {
1218+ // Begin and end time have been set above.
1219+ if rot_idx == 0 || rot_idx == times_rot. len ( ) - 1 {
1220+ continue ;
1221+ }
12181222 assert ! ( times_rot[ rot_idx] . is_none( ) ) ;
12191223 times_rot[ rot_idx] = Some ( pos_spline. as_ref ( ) . unwrap ( ) . grid ( ) [ pos_idx] ) ;
12201224 }
@@ -1244,10 +1248,18 @@ impl<'a> Element<'a> for TransformElement {
12441248 } ;
12451249
12461250 for ( vol_idx, pos_idx) in vol_time_from_pos {
1251+ // Begin and end time have been set above.
1252+ if vol_idx == 0 || vol_idx == times_vol. len ( ) - 1 {
1253+ continue ;
1254+ }
12471255 assert ! ( times_vol[ vol_idx] . is_none( ) ) ;
12481256 times_vol[ vol_idx] = Some ( pos_spline. as_ref ( ) . unwrap ( ) . grid ( ) [ pos_idx] ) ;
12491257 }
12501258 for ( vol_idx, rot_idx) in vol_time_from_rot {
1259+ // Begin and end time have been set above.
1260+ if vol_idx == 0 || vol_idx == times_vol. len ( ) - 1 {
1261+ continue ;
1262+ }
12511263 assert ! ( times_vol[ vol_idx] . is_none( ) ) ;
12521264 times_vol[ vol_idx] = Some ( rot_spline. as_ref ( ) . unwrap ( ) . grid ( ) [ rot_idx] ) ;
12531265 }
0 commit comments