2019-07-23 20:55:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
2019-07-24 21:06:48 +00:00
|
|
|
class CPhysical;
|
2019-07-23 20:55:23 +00:00
|
|
|
|
|
|
|
enum tWaterLevel
|
|
|
|
{
|
|
|
|
FLOATER_ABOVE_WATER,
|
|
|
|
FLOATER_IN_WATER,
|
|
|
|
FLOATER_UNDER_WATER,
|
|
|
|
};
|
|
|
|
|
|
|
|
class cBuoyancy
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CVector m_position;
|
|
|
|
CMatrix m_matrix;
|
|
|
|
int m_field_54;
|
|
|
|
CVector m_positionZ;
|
|
|
|
float m_waterlevel;
|
|
|
|
float m_waterLevelInc;
|
|
|
|
float m_buoyancy;
|
|
|
|
CVector m_dimMax;
|
|
|
|
CVector m_dimMin;
|
|
|
|
float m_numPartialVolumes;
|
|
|
|
int m_field_8C;
|
|
|
|
int m_field_90;
|
|
|
|
int m_field_94;
|
|
|
|
bool m_haveVolume;
|
|
|
|
CVector m_step;
|
|
|
|
CVector m_stepRatio;
|
|
|
|
float m_numSteps;
|
|
|
|
bool m_flipAverage;
|
|
|
|
char m_field_B9;
|
|
|
|
bool m_isBoat;
|
|
|
|
float m_volumeUnderWater;
|
2019-07-24 21:06:48 +00:00
|
|
|
CVector m_impulsePoint;
|
2019-07-23 20:55:23 +00:00
|
|
|
|
2019-10-13 04:05:08 +00:00
|
|
|
bool ProcessBuoyancy(CPhysical *phys, float buoyancy, CVector *point, CVector *impulse);
|
2020-07-01 16:03:39 +00:00
|
|
|
bool ProcessBuoyancyBoat(CVehicle *phys, float buoyancy, CVector *point, CVector *impulse, bool bNoTurnForce);
|
2019-07-23 20:55:23 +00:00
|
|
|
void PreCalcSetup(CPhysical *phys, float buoyancy);
|
|
|
|
void SimpleCalcBuoyancy(void);
|
|
|
|
float SimpleSumBuoyancyData(CVector &waterLevel, tWaterLevel waterPosition);
|
|
|
|
void FindWaterLevel(const CVector &zpos, CVector *waterLevel, tWaterLevel *waterPosition);
|
2020-07-01 16:03:39 +00:00
|
|
|
void FindWaterLevelNorm(const CVector &zpos, CVector *waterLevel, tWaterLevel *waterPosition, CVector *normal);
|
2019-07-23 20:55:23 +00:00
|
|
|
bool CalcBuoyancyForce(CPhysical *phys, CVector *impulse, CVector *point);
|
|
|
|
};
|
2020-04-16 12:30:47 +00:00
|
|
|
extern cBuoyancy mod_Buoyancy;
|