mirror of
https://github.com/zeldaret/ss
synced 2026-07-09 22:21:32 -04:00
d_t_mass_obj 99%
This commit is contained in:
@@ -44,10 +44,26 @@ struct Quatf {
|
||||
Vector3f rotateVector(const Vector3f &);
|
||||
Vector3f rotateVectorInv(const Vector3f &); // not in SS
|
||||
void slerpTo(const Quatf &, f32, Quatf &out) const;
|
||||
void slerpTo2(f32 fparam,const Quatf & param1, Quatf &out ) const {
|
||||
const Quatf & tmp = param1;
|
||||
slerpTo(tmp, fparam, out);
|
||||
}
|
||||
void limitSlerpTo(const Quatf &, f32, f32, Quatf &out) const;
|
||||
void makeVectorRotationLimit(Vector3f &, Vector3f &, f32); // not in SS
|
||||
void makeVectorRotation(const Vector3f &, const Vector3f &);
|
||||
|
||||
// not sure about the name
|
||||
f32 dot(const Quatf& other) const {
|
||||
f32 ret = v.dot(other.v);
|
||||
ret += w * other.w;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void set(const Quatf& other) {
|
||||
v.set(other.v);
|
||||
w = other.w;
|
||||
}
|
||||
|
||||
void multScalar(f32 s) {
|
||||
w *= s;
|
||||
v.x *= s;
|
||||
@@ -58,6 +74,12 @@ struct Quatf {
|
||||
set(1.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
void makeWPositive() {
|
||||
if (w < 0.f) {
|
||||
multScalar(-1.f);
|
||||
}
|
||||
}
|
||||
|
||||
Vector3f v;
|
||||
f32 w;
|
||||
};
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
#ifndef EGG_VECTOR_H
|
||||
#define EGG_VECTOR_H
|
||||
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "common.h"
|
||||
#include "egg/math/eggMath.h"
|
||||
#include "nw4r/math/math_arithmetic.h"
|
||||
#include "nw4r/math/math_triangular.h"
|
||||
|
||||
#include "nw4r/math.h"
|
||||
#include <cmath>
|
||||
|
||||
namespace EGG {
|
||||
|
||||
@@ -132,6 +135,10 @@ struct Vector3f : public nw4r::math::VEC3 {
|
||||
return squaredLength() <= Math<f32>::epsilon();
|
||||
}
|
||||
|
||||
bool isZero2() const {
|
||||
return fabsf(JMathInlineVEC::C_VECSquareMag(*this)) <= Math<f32>::epsilon();
|
||||
}
|
||||
|
||||
void setZero() {
|
||||
x = y = z = 0.0f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user