Added Matrix4::Identity(), Added Lerp (scalar.h)
This commit is contained in:
@@ -107,6 +107,7 @@ public:
|
||||
static Matrix4 Translation(const Vector3 &v);
|
||||
static Matrix4 Rotation(const Vector3 &v);
|
||||
static Matrix4 Scaling(const Vector3 &v);
|
||||
static Matrix4 Identity();
|
||||
};
|
||||
static_assert(std::is_pod<Matrix4>::value, "kraken::Matrix4 must be a POD type.");
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
namespace kraken {
|
||||
|
||||
float SmoothStep(float a, float b, float t);
|
||||
float Lerp(float a, float b, float t);
|
||||
|
||||
}; // namespace kraken
|
||||
|
||||
|
||||
@@ -441,5 +441,12 @@ Matrix4 Matrix4::Scaling(const Vector3 &v)
|
||||
return m;
|
||||
}
|
||||
|
||||
Matrix4 Matrix4::Identity()
|
||||
{
|
||||
Matrix4 m;
|
||||
m.init();
|
||||
return m;
|
||||
}
|
||||
|
||||
} // namespace kraken
|
||||
|
||||
|
||||
@@ -39,4 +39,9 @@ float SmoothStep(float a, float b, float t)
|
||||
return a * (1.0f - d) + b * d;
|
||||
}
|
||||
|
||||
float Lerp(float a, float b, float t)
|
||||
{
|
||||
return (a + (b - a) * t);
|
||||
}
|
||||
|
||||
} // namespace kraken
|
||||
|
||||
Reference in New Issue
Block a user