Match getBestAngle (TAKE 2)

This commit is contained in:
intns 2024-05-18 01:50:19 +01:00
parent 928362c1b8
commit 9ad660726a
2 changed files with 10 additions and 7 deletions

View File

@ -31,19 +31,21 @@ struct WaterBox;
// };
struct MapMgr : virtual public GenericObjectMgr {
#define BEAM_RADIUS (10.0f)
struct BeamCollisionArg {
BeamCollisionArg() { }
BeamCollisionArg(int index, const Vector3f& position, const Vector3f& targetPosition)
BeamCollisionArg()
{
mBeamRadius = 10.0f;
mIndex = index;
mBeamRadius = BEAM_RADIUS;
mIndex = 0;
mHitSuccess = false;
}
inline void setup(int index, const Vector3f& position, const Vector3f& targetPosition)
{
mIndex = index;
mPosition = position;
mTargetPosition = targetPosition;
mBeamRadius = 10.0f;
mBeamRadius = BEAM_RADIUS;
}
Vector3f mPosition; // _00

View File

@ -195,7 +195,8 @@ f32 MapMgr::getBestAngle(Vector3f& position, f32 distance, f32 divisor)
Vector3f offset(distance * sinf(angle), tanTheta, distance * cosf(angle));
offset = offset + adjustedPos;
BeamCollisionArg beamArg(i, adjustedPos, offset);
BeamCollisionArg beamArg;
beamArg.setup(i, adjustedPos, offset);
checkBeamCollision(beamArg);
angles[i] = beamArg.mTargetDistance;
}