Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
edb1bf23
Commit
edb1bf23
authored
Aug 04, 2015
by
Viktor Lidholt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First pass on sprite 3D node (does not yet support perspective projections).
parent
e0454520
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
0 deletions
+37
-0
node3d.dart
packages/flutter/example/game/lib/node3d.dart
+36
-0
sprites.dart
packages/flutter/example/game/lib/sprites.dart
+1
-0
No files found.
packages/flutter/example/game/lib/node3d.dart
0 → 100644
View file @
edb1bf23
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
;
}
}
packages/flutter/example/game/lib/sprites.dart
View file @
edb1bf23
...
...
@@ -22,6 +22,7 @@ part 'action.dart';
part
'color_secuence.dart'
;
part
'image_map.dart'
;
part
'node.dart'
;
part
'node3d.dart'
;
part
'node_with_size.dart'
;
part
'particle_system.dart'
;
part
'sprite.dart'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment