-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add camera XZ translation and Y-axis rotation
- Loading branch information
Showing
7 changed files
with
212 additions
and
62 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#ifndef LEPUS_UTILITY_TYPES_QUATERNION | ||
#define LEPUS_UTILITY_TYPES_QUATERNION | ||
|
||
#include "Vector.h" | ||
|
||
namespace lepus | ||
{ | ||
namespace types | ||
{ | ||
class Quaternion : public Vector4 | ||
{ | ||
public: | ||
Quaternion() | ||
{ | ||
const float const identity[] = { 0.f, 0.f, 0.f, 1.f }; | ||
init((float*)identity); | ||
} | ||
|
||
Quaternion(const Quaternion& quat) | ||
{ | ||
init(quat); | ||
} | ||
|
||
Quaternion(float* quatData) | ||
{ | ||
init(quatData); | ||
} | ||
|
||
inline Quaternion operator*(const Quaternion& b) | ||
{ | ||
// TODO: use scalar/vector notation for multiplying quaternions | ||
Quaternion result = Quaternion(); | ||
result.x(x() * b.x()); | ||
result.y(y() * b.y()); | ||
result.z(z() * b.z()); | ||
result.w(w() * b.w()); | ||
} | ||
}; | ||
} | ||
} | ||
|
||
#endif |
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
Oops, something went wrong.