提交 01d26fe7 编写于 作者: V Viktor Lidholt

Merge pull request #443 from vlidholt/master

First pass on sprite 3D node
part of sprites;
class Node3D extends Node {
double _rotationX = 0.0;
double get rotationX => _rotationX;
set rotationX(double rotationX) {
_rotationX = rotationX;
invalidateTransformMatrix();
}
double _rotationY = 0.0;
double get rotationY => _rotationY;
set rotationY(double rotationY) {
_rotationY = rotationY;
invalidateTransformMatrix();
}
Matrix4 computeTransformMatrix() {
// Apply normal 2d transforms
Matrix4 matrix = super.computeTransformMatrix();
matrix.translate(0.0, 0.0, 500.0);
// Rotate around x and y axis
matrix.rotateY(radians(_rotationY));
matrix.rotateX(radians(_rotationX));
return matrix;
}
}
...@@ -22,6 +22,7 @@ part 'action.dart'; ...@@ -22,6 +22,7 @@ part 'action.dart';
part 'color_secuence.dart'; part 'color_secuence.dart';
part 'image_map.dart'; part 'image_map.dart';
part 'node.dart'; part 'node.dart';
part 'node3d.dart';
part 'node_with_size.dart'; part 'node_with_size.dart';
part 'particle_system.dart'; part 'particle_system.dart';
part 'sprite.dart'; part 'sprite.dart';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册