@@ -119,6 +119,7 @@ const MODEL_MARKER_BYTES: &'static [u8] = include_bytes!("../resources/ui/sphere
119
119
const DIR : FileSystem = include_dir ! ( "resources/showcase" ) ;
120
120
121
121
lazy_static ! {
122
+ static ref GLOBAL_TRANSFORMATION : Mat4 = Mat4 :: rotation_yaw( 0.0 * std:: f32 :: consts:: PI ) ;
122
123
static ref MODELS_MAIN_BYTES_SCALE : Vec <( & ' static [ u8 ] , f32 ) > = {
123
124
let files = DIR . find( "**/*_(*).glb" )
124
125
. expect( "Could not traverse the resource directory tree." )
@@ -185,7 +186,6 @@ pub struct Selection {
185
186
#[ mapp]
186
187
pub struct ExampleMapp {
187
188
elapsed : Duration ,
188
- state : Vec < String > ,
189
189
command_id_next : usize ,
190
190
commands : VecDeque < Command > ,
191
191
view_orientations : Option < Vec < Option < Orientation > > > ,
@@ -241,7 +241,6 @@ impl Mapp for ExampleMapp {
241
241
fn new ( ) -> Self {
242
242
let mut result = Self {
243
243
elapsed : Default :: default ( ) ,
244
- state : Vec :: new ( ) ,
245
244
command_id_next : 0 ,
246
245
commands : VecDeque :: new ( ) ,
247
246
view_orientations : None ,
@@ -282,11 +281,6 @@ impl Mapp for ExampleMapp {
282
281
result
283
282
}
284
283
285
- fn test ( & mut self , arg : String ) -> Vec < String > {
286
- self . state . push ( arg) ;
287
- self . state . clone ( )
288
- }
289
-
290
284
fn update ( & mut self , elapsed : Duration ) {
291
285
self . elapsed = elapsed;
292
286
@@ -305,7 +299,7 @@ impl Mapp for ExampleMapp {
305
299
306
300
self . cmd ( CommandKind :: EntityTransformSet {
307
301
entity : entity. unwrap ( ) ,
308
- transform : Some ( transform) ,
302
+ transform : Some ( & * GLOBAL_TRANSFORMATION * transform) ,
309
303
} ) ;
310
304
}
311
305
self . cmd ( CommandKind :: GetViewOrientation { } ) ;
@@ -371,7 +365,7 @@ impl Mapp for ExampleMapp {
371
365
} ) ;
372
366
self . cmd ( CommandKind :: EntityTransformSet {
373
367
entity,
374
- transform : Some ( transform) ,
368
+ transform : Some ( & * GLOBAL_TRANSFORMATION * transform) ,
375
369
} ) ;
376
370
} ,
377
371
CommandResponseKind :: GetViewOrientation { views_per_medium } => {
@@ -453,7 +447,7 @@ impl Mapp for ExampleMapp {
453
447
} ) ;
454
448
self . cmd ( CommandKind :: EntityTransformSet {
455
449
entity : self . entity_marker . unwrap ( ) ,
456
- transform : Some ( transform) ,
450
+ transform : Some ( & * GLOBAL_TRANSFORMATION * transform) ,
457
451
} ) ;
458
452
459
453
self . ray_tracing_task = None ;
@@ -494,6 +488,10 @@ impl Mapp for ExampleMapp {
494
488
}
495
489
}
496
490
491
+ fn receive_event ( & mut self , event : Event ) {
492
+ dbg ! ( event) ;
493
+ }
494
+
497
495
fn flush_io ( & mut self ) -> IO {
498
496
GLOBAL_IO . flush ( )
499
497
}
0 commit comments