transform namespace updated
This commit is contained in:
@@ -46,3 +46,8 @@ app::Quaternion Transform::QuaternionEuler(app::Vector3 eulerAngles)
|
||||
|
||||
return app::Quaternion_Euler(x, y, z, nullptr);
|
||||
}
|
||||
|
||||
app::Quaternion Transform::QuaternionIdentity()
|
||||
{
|
||||
return app::Quaternion_get_identity(nullptr);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,24 @@
|
||||
|
||||
namespace Transform {
|
||||
app::Transform* GetTransform(app::GameObject* go);
|
||||
|
||||
// e.g. NolanBehaviour
|
||||
template<typename T>
|
||||
inline app::Transform* GetTransform(T* component);
|
||||
|
||||
app::Vector3 GetPosition(app::Transform* transform);
|
||||
app::Quaternion GetRotation(app::Transform* transform);
|
||||
app::Vector3 GetForward(app::Transform* transform);
|
||||
app::Vector3 GetRight(app::Transform* transform);
|
||||
app::Vector3 GetEulerAngles(app::Quaternion rotation);
|
||||
app::Quaternion QuaternionEuler(app::Vector3 eulerAngles);
|
||||
app::Quaternion QuaternionIdentity();
|
||||
|
||||
template<typename T>
|
||||
app::Transform* GetTransform(T* component)
|
||||
{
|
||||
if (!component) return nullptr;
|
||||
|
||||
return app::Component_get_transform((app::Component*)component, nullptr);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user