File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed 
sky/packages/sky/example/game/lib Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ part of  sprites;
2+ 
3+ class  Node3D  extends  Node  {
4+ 
5+   double  _rotationX =  0.0 ;
6+ 
7+   double  get  rotationX =>  _rotationX;
8+ 
9+   set  rotationX (double  rotationX) {
10+     _rotationX =  rotationX;
11+     invalidateTransformMatrix ();
12+   }
13+ 
14+   double  _rotationY =  0.0 ;
15+ 
16+   double  get  rotationY =>  _rotationY;
17+ 
18+   set  rotationY (double  rotationY) {
19+     _rotationY =  rotationY;
20+     invalidateTransformMatrix ();
21+   }
22+ 
23+   Matrix4  computeTransformMatrix () {
24+     // Apply normal 2d transforms 
25+     Matrix4  matrix =  super .computeTransformMatrix ();
26+ 
27+ 
28+     matrix.translate (0.0 , 0.0 , 500.0 );
29+ 
30+     // Rotate around x and y axis 
31+     matrix.rotateY (radians (_rotationY));
32+     matrix.rotateX (radians (_rotationX));
33+ 
34+     return  matrix;
35+   }
36+ }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ part 'action.dart';
2222part  'color_secuence.dart' ;
2323part  'image_map.dart' ;
2424part  'node.dart' ;
25+ part  'node3d.dart' ;
2526part  'node_with_size.dart' ;
2627part  'particle_system.dart' ;
2728part  'sprite.dart' ;
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments