-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jvenin
committed
Mar 2, 2024
1 parent
33735c6
commit 9c6753e
Showing
7 changed files
with
82 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'package:vector_math/vector_math.dart'; | ||
|
||
class Rotation { | ||
Rotation(): matrix = Matrix3.zero(); | ||
|
||
Matrix3 matrix; | ||
|
||
void setMatrix( | ||
double xRotation, | ||
double yRotation, | ||
double zRotation, | ||
) { | ||
matrix = Matrix3.rotationZ(xRotation) * | ||
Matrix3.rotationY(yRotation) * | ||
Matrix3.rotationZ(zRotation); | ||
} | ||
|
||
@override | ||
String toString() { | ||
return matrix.toString(); | ||
} | ||
|
||
@override | ||
bool operator ==(Object other) => | ||
other is Rotation && other.matrix == matrix; | ||
|
||
@override | ||
int get hashCode => matrix.hashCode; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters