feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef TRANSFORM_3D_H
|
||||
#define TRANSFORM_3D_H
|
||||
#pragma once
|
||||
|
||||
#include "core/math/aabb.h"
|
||||
#include "core/math/basis.h"
|
||||
|
|
@ -75,10 +74,11 @@ struct [[nodiscard]] Transform3D {
|
|||
void orthogonalize();
|
||||
Transform3D orthogonalized() const;
|
||||
bool is_equal_approx(const Transform3D &p_transform) const;
|
||||
bool is_same(const Transform3D &p_transform) const;
|
||||
bool is_finite() const;
|
||||
|
||||
bool operator==(const Transform3D &p_transform) const;
|
||||
bool operator!=(const Transform3D &p_transform) const;
|
||||
constexpr bool operator==(const Transform3D &p_transform) const;
|
||||
constexpr bool operator!=(const Transform3D &p_transform) const;
|
||||
|
||||
_FORCE_INLINE_ Vector3 xform(const Vector3 &p_vector) const;
|
||||
_FORCE_INLINE_ AABB xform(const AABB &p_aabb) const;
|
||||
|
|
@ -102,10 +102,10 @@ struct [[nodiscard]] Transform3D {
|
|||
|
||||
void operator*=(const Transform3D &p_transform);
|
||||
Transform3D operator*(const Transform3D &p_transform) const;
|
||||
void operator*=(real_t p_val);
|
||||
Transform3D operator*(real_t p_val) const;
|
||||
void operator/=(real_t p_val);
|
||||
Transform3D operator/(real_t p_val) const;
|
||||
constexpr void operator*=(real_t p_val);
|
||||
constexpr Transform3D operator*(real_t p_val) const;
|
||||
constexpr void operator/=(real_t p_val);
|
||||
constexpr Transform3D operator/(real_t p_val) const;
|
||||
|
||||
Transform3D interpolate_with(const Transform3D &p_transform, real_t p_c) const;
|
||||
|
||||
|
|
@ -124,12 +124,48 @@ struct [[nodiscard]] Transform3D {
|
|||
|
||||
operator String() const;
|
||||
|
||||
Transform3D() {}
|
||||
Transform3D(const Basis &p_basis, const Vector3 &p_origin = Vector3());
|
||||
Transform3D(const Vector3 &p_x, const Vector3 &p_y, const Vector3 &p_z, const Vector3 &p_origin);
|
||||
Transform3D(real_t p_xx, real_t p_xy, real_t p_xz, real_t p_yx, real_t p_yy, real_t p_yz, real_t p_zx, real_t p_zy, real_t p_zz, real_t p_ox, real_t p_oy, real_t p_oz);
|
||||
Transform3D() = default;
|
||||
constexpr Transform3D(const Basis &p_basis, const Vector3 &p_origin = Vector3()) :
|
||||
basis(p_basis),
|
||||
origin(p_origin) {}
|
||||
constexpr Transform3D(const Vector3 &p_x, const Vector3 &p_y, const Vector3 &p_z, const Vector3 &p_origin) :
|
||||
basis(p_x, p_y, p_z),
|
||||
origin(p_origin) {}
|
||||
constexpr Transform3D(real_t p_xx, real_t p_xy, real_t p_xz, real_t p_yx, real_t p_yy, real_t p_yz, real_t p_zx, real_t p_zy, real_t p_zz, real_t p_ox, real_t p_oy, real_t p_oz) :
|
||||
basis(p_xx, p_xy, p_xz, p_yx, p_yy, p_yz, p_zx, p_zy, p_zz),
|
||||
origin(p_ox, p_oy, p_oz) {}
|
||||
};
|
||||
|
||||
constexpr bool Transform3D::operator==(const Transform3D &p_transform) const {
|
||||
return (basis == p_transform.basis && origin == p_transform.origin);
|
||||
}
|
||||
|
||||
constexpr bool Transform3D::operator!=(const Transform3D &p_transform) const {
|
||||
return (basis != p_transform.basis || origin != p_transform.origin);
|
||||
}
|
||||
|
||||
constexpr void Transform3D::operator*=(real_t p_val) {
|
||||
origin *= p_val;
|
||||
basis *= p_val;
|
||||
}
|
||||
|
||||
constexpr Transform3D Transform3D::operator*(real_t p_val) const {
|
||||
Transform3D ret(*this);
|
||||
ret *= p_val;
|
||||
return ret;
|
||||
}
|
||||
|
||||
constexpr void Transform3D::operator/=(real_t p_val) {
|
||||
basis /= p_val;
|
||||
origin /= p_val;
|
||||
}
|
||||
|
||||
constexpr Transform3D Transform3D::operator/(real_t p_val) const {
|
||||
Transform3D ret(*this);
|
||||
ret /= p_val;
|
||||
return ret;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ Vector3 Transform3D::xform(const Vector3 &p_vector) const {
|
||||
return Vector3(
|
||||
basis[0].dot(p_vector) + origin.x,
|
||||
|
|
@ -269,5 +305,3 @@ _FORCE_INLINE_ Plane Transform3D::xform_inv_fast(const Plane &p_plane, const Tra
|
|||
real_t d = normal.dot(point);
|
||||
return Plane(normal, d);
|
||||
}
|
||||
|
||||
#endif // TRANSFORM_3D_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue