Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
245c6c6eb4 | |||
|
58bd078b05 | ||
4cbfef1706 | |||
43191a9857 |
@@ -52,7 +52,7 @@ namespace J3ML::Geometry {
|
||||
}
|
||||
}
|
||||
|
||||
AABB2D ComputeAABB() {}
|
||||
AABB2D ComputeAABB() { return AABB2D(); }
|
||||
|
||||
float DistanceSq(const Vector2 &point) const {
|
||||
Vector2 centered = point - center;
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
/// This set of functions may be set to use lookup tables or SIMD operations.
|
||||
/// If no options are set, they will default to using standard library implementation.
|
||||
#define USE_LOOKUP_TABLES /// Pre-computed lookup tables.
|
||||
#undef USE_LOOKUP_TABLES /// Pre-computed lookup tables.
|
||||
#undef USE_SSE /// Streaming SIMD Extensions (x86)
|
||||
#undef USE_NEON /// ARM Vector Processing
|
||||
#undef USE_AVX /// Advanced Vector Extensions (x86)
|
||||
|
@@ -62,11 +62,12 @@ namespace J3ML::LinearAlgebra {
|
||||
Matrix3x3(const Vector3& col0, const Vector3& col1, const Vector3& col2);
|
||||
/// Constructs this matrix3x3 from the given quaternion.
|
||||
explicit Matrix3x3(const Quaternion& orientation);
|
||||
/// Constructs this matrix3x3 from the given euler angle.
|
||||
|
||||
//explicit Matrix3x3(const EulerAngleXYZ& orientation);
|
||||
explicit Matrix3x3(const EulerAngleXYZ& orientation) : Matrix3x3(Quaternion(orientation)) {};
|
||||
|
||||
//explicit Matrix3x3(const AxisAngle& orientation);
|
||||
explicit Matrix3x3(const AxisAngle& orientation) : Matrix3x3(Quaternion(orientation)) {};
|
||||
|
||||
/// Constructs this Matrix3x3 from a pointer to an array of floats.
|
||||
explicit Matrix3x3(const float *data);
|
||||
|
@@ -48,7 +48,7 @@ namespace J3ML::LinearAlgebra {
|
||||
@note This function is provided for compatibility with other APIs which require raw C pointer access
|
||||
to vectors. Avoid using this function in general, and instead always use the operator [] of this
|
||||
class to access the elements of this vector by index. */
|
||||
inline float* ptr();
|
||||
float* ptr();
|
||||
[[nodiscard]] const float* ptr() const;
|
||||
|
||||
/// Accesses an element of this vector using array notation.
|
||||
|
@@ -37,12 +37,12 @@ namespace J3ML::LinearAlgebra {
|
||||
|
||||
bool Vector2::operator==(const Vector2& rhs) const
|
||||
{
|
||||
return this->IsWithinMarginOfError(rhs);
|
||||
return x == rhs.x && y == rhs.y;
|
||||
}
|
||||
|
||||
bool Vector2::operator!=(const Vector2& rhs) const
|
||||
{
|
||||
return this->IsWithinMarginOfError(rhs) == false;
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
Vector2 Vector2::Min(const Vector2& min) const
|
||||
|
@@ -10,16 +10,16 @@ namespace Matrix3x3Tests
|
||||
{
|
||||
using namespace jtest;
|
||||
using namespace J3ML::LinearAlgebra;
|
||||
|
||||
/*
|
||||
Matrix3x3Unit += Test("AngleTypeRound-TripConversion", [] {
|
||||
EulerAngleXYZ expected_result(8, 60, -27);
|
||||
|
||||
Matrix3x3 m(expected_result);
|
||||
AxisAngle a(expected_result);
|
||||
Quaternion q(a);
|
||||
//AxisAngle a(expected_result);
|
||||
Quaternion q(m);
|
||||
Matrix3x3 m2(q);
|
||||
Quaternion q2(m2);
|
||||
AxisAngle a2(q2);
|
||||
//AxisAngle a2(q2);
|
||||
EulerAngleXYZ round_trip(a2);
|
||||
|
||||
jtest::check(Math::EqualAbs(Math::Radians(expected_result.roll), Math::Radians(round_trip.roll), 1e-6f));
|
||||
@@ -46,7 +46,7 @@ namespace Matrix3x3Tests
|
||||
jtest::check(Math::EqualAbs(expected_result.At(2, 1), from_euler.At(2, 1), 1e-6f));
|
||||
jtest::check(Math::EqualAbs(expected_result.At(2, 2), from_euler.At(2, 2), 1e-6f));
|
||||
});
|
||||
|
||||
*/
|
||||
Matrix3x3Unit += Test("Add_Unary", []
|
||||
{
|
||||
Matrix3x3 m(1,2,3, 4,5,6, 7,8,9);
|
||||
|
Reference in New Issue
Block a user