Update misc files to match sead math changes

This commit is contained in:
ThePixelGamer
2021-10-06 18:02:53 -05:00
parent a82333ef90
commit 20df9e7c7d
11 changed files with 28 additions and 34 deletions
+5 -5
View File
@@ -796,11 +796,11 @@ bool Manager::isGerudoDesertClimate() const {
}
bool Manager::hasCameraOrPlayerMoved(float distance_threshold) const {
const auto camera_dist = sead::norm2(mCameraPos - mPrevCameraPos);
const auto player_dist = sead::norm2(mPlayerPos - mPrevPlayerPos);
const auto camera_dist = (mCameraPos - mPrevCameraPos).length();
const auto player_dist = (mPlayerPos - mPrevPlayerPos).length();
const bool moved = player_dist >= distance_threshold || camera_dist >= distance_threshold;
if (sead::norm2(mPlayerPos - mPrevPlayerPos) <= 100.0 &&
if ((mPlayerPos - mPrevPlayerPos).length() <= 100.0 &&
evt::Manager::instance()->hasActiveEvent()) {
return false;
}
@@ -830,7 +830,7 @@ float Manager::getDungeonLightLongitude() const {
void Manager::setCameraDistForRemainsElectric(sead::Vector3f pos) {
_7ac = 10;
_770 = sead::norm2(mCameraPos - pos);
_770 = (mCameraPos - pos).length();
}
void Manager::setFocusDist(float dist) {
@@ -888,7 +888,7 @@ void Manager::setIgnitedLevel(int level, float radius, sead::Vector3f center) {
const sead::Vector3f unk_center{-2004, mPlayerPos.y, 1710};
mIgnitedLevel = level;
if (sead::norm2(mPlayerPos - unk_center) < 20.0) {
if ((mPlayerPos - unk_center).length() < 20.0) {
mIgnitedCenter = unk_center;
mIgnitedRadius = 7.0;
}
+1 -7
View File
@@ -5,12 +5,6 @@
namespace ksys::world {
static void normalize(sead::Vector3f& v) {
const auto norm = sead::norm2(v);
if (norm > 0.0)
v *= 1.0f / norm;
}
SkyMgr::SkyMgr() {
_20._18 = {0, 0, 0};
_20._24 = {0, 0, 0};
@@ -321,7 +315,7 @@ SkyMgr::SkyMgr() {
_3f14.x = -0.0;
_3f14.y = -std::sinf(0.82903141);
_3f14.z = -std::cosf(0.82903141);
normalize(_3f14);
_3f14.normalize();
_3f44 = 0.0;
_3f48 = 0.0;
_3f4c = 0.2;