Merge branch 'master' into nazara-next

This commit is contained in:
Jérôme Leclercq
2020-08-27 20:12:36 +02:00
21 changed files with 617 additions and 27 deletions

View File

@@ -60,6 +60,7 @@ namespace Nz
T SquaredMagnitude() const;
RadianAngle<T> To2DAngle() const;
EulerAngles<T> ToEulerAngles() const;
//Matrix3<T> ToRotationMatrix() const;
String ToString() const;

View File

@@ -463,13 +463,27 @@ namespace Nz
return w * w + x * x + y * y + z * z;
}
/*!
* \brief Returns the "roll angle" of this quaternion
* \return Roll rotation
*
* \remark This function only has sense when quaternion only represents a "roll rotation"
*/
template<typename T>
RadianAngle<T> Quaternion<T>::To2DAngle() const
{
T siny_cosp = T(2.0) * (w * z + x * y);
T cosy_cosp = T(1.0) - T(2.0) * (y * y + z * z);
return std::atan2(siny_cosp, cosy_cosp);
}
/*!
* \brief Converts this quaternion to Euler angles representation
* \return EulerAngles which is the representation of this rotation
*
* \remark Rotation are "left-handed"
*/
template<typename T>
EulerAngles<T> Quaternion<T>::ToEulerAngles() const
{

View File

@@ -14,7 +14,7 @@ namespace Nz
{
enum class WindowManager
{
None,
Invalid,
X11,
Wayland,
@@ -23,14 +23,14 @@ namespace Nz
struct WindowHandle
{
WindowManager type = WindowManager::None;
WindowManager type = WindowManager::Invalid;
union
{
struct
{
void* display; //< Display*
void* window; //< Window
unsigned long window; //< Window
} x11;
struct

View File

@@ -119,6 +119,8 @@
#define NAZARA_PLATFORM_LINUX
#define NAZARA_PLATFORM_POSIX
#define NAZARA_PLATFORM_GLX
#define NAZARA_EXPORT __attribute__((visibility ("default")))
#define NAZARA_IMPORT __attribute__((visibility ("default")))
/*#elif defined(__APPLE__) && defined(__MACH__)

View File

@@ -99,6 +99,8 @@ namespace Ndk
void OnComponentDetached(BaseComponent& component) override;
void OnDetached() override;
void OnEntityDestruction() override;
void OnEntityDisabled() override;
void OnEntityEnabled() override;
struct PendingPhysObjectStates
{