mirror of
https://github.com/projectPiki/pikmin2.git
synced 2024-11-23 13:29:55 +00:00
Match getBestAngle (TAKE 2)
This commit is contained in:
parent
928362c1b8
commit
9ad660726a
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user