mirror of
https://github.com/zeldaret/ss
synced 2026-06-19 15:40:26 -04:00
9d68802507
* d_a_e_sm (chu chu) start * progress, includes LightParam addition in BlurPaletteMgr * oops - TBox Progress I guess * dAcEsm_c::actorExecute and Particle Resource data moved * step in symbols map * Update blur_and_palette_manager.h * m_angle cleanup pass * Last explicit_zero_data Fixes #69 * add mQuat_c ctor
39 lines
923 B
C++
39 lines
923 B
C++
|
|
#include "d/col/c/c_m3d_g_pla.h"
|
|
|
|
#include "d/col/c/c_m3d.h"
|
|
#include "m/m_angle.h"
|
|
#include "m/m_vec.h"
|
|
|
|
bool cM3dGPla::CrossInfLin(const mVec3_c &start, const mVec3_c &end, mVec3_c &out) const {
|
|
f32 tmp1 = getPlaneFunc(start);
|
|
f32 tmp2 = getPlaneFunc(end);
|
|
|
|
if (cM3d_IsZero(tmp1 - tmp2)) {
|
|
out = end;
|
|
return false;
|
|
}
|
|
|
|
f32 pF = tmp1 / (tmp1 - tmp2);
|
|
cM3d_InDivPos2(&start, &end, pF, &out);
|
|
return true;
|
|
}
|
|
|
|
bool cM3dGPla::getCrossYLessD(const mVec3_c &point, f32 *out) const {
|
|
if (cM3d_IsZero(mNormal.y)) {
|
|
return false;
|
|
} else {
|
|
*out = (-mNormal.x * point.x - mNormal.z * point.z) / mNormal.y;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
mAng cM3dGPla::GetAngle(mAng ang) const {
|
|
mAng angleY = GetAngleY();
|
|
return cM::atan2s(GetXZDist() * mAng(angleY - ang).cos(), mNormal.y);
|
|
}
|
|
|
|
mAng cM3dGPla::GetNegativeAngle(mAng ang) const {
|
|
return -GetAngle(ang);
|
|
}
|