Refactored Math::Vector to glm::vec3 in remaining auto classes
parent
4634564f17
commit
55f5d25c95
|
@ -53,7 +53,7 @@ void CAutoFlag::DeleteObject(bool bAll)
|
|||
|
||||
void CAutoFlag::Init()
|
||||
{
|
||||
Math::Vector wind;
|
||||
glm::vec3 wind;
|
||||
float angle;
|
||||
|
||||
m_time = 0.0f;
|
||||
|
|
|
@ -61,14 +61,14 @@ void CAutoKid::Init()
|
|||
|
||||
if ( m_type == OBJECT_TEEN36 ) // trunk ?
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
m_speed = 1.0f/(1.0f+(Math::Mod(pos.x/10.0f-0.5f, 1.0f)*0.2f));
|
||||
m_progress = Math::Mod(pos.x/10.0f, 1.0f);
|
||||
}
|
||||
|
||||
if ( m_type == OBJECT_TEEN37 ) // boat?
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
m_speed = 1.0f/(1.0f+(Math::Mod(pos.x/10.0f-0.5f, 1.0f)*0.2f))*2.5f;
|
||||
m_progress = Math::Mod(pos.x/10.0f, 1.0f);
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ bool CAutoKid::EventProcess(const Event &event)
|
|||
|
||||
if ( m_type == OBJECT_TEEN36 ) // trunk?
|
||||
{
|
||||
Math::Vector vib;
|
||||
glm::vec3 vib{};
|
||||
vib.x = 0.0f;
|
||||
vib.y = sinf(m_progress)*1.0f;
|
||||
vib.z = 0.0f;
|
||||
|
@ -132,12 +132,11 @@ bool CAutoKid::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
Math::Vector pos;
|
||||
pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
pos.y = m_water->GetLevel()+1.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*50.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*50.0f;
|
||||
Math::Vector speed;
|
||||
glm::vec3 speed{};
|
||||
speed.y = 0.0f;
|
||||
speed.x = 0.0f;
|
||||
speed.z = 0.0f;
|
||||
|
@ -150,7 +149,7 @@ bool CAutoKid::EventProcess(const Event &event)
|
|||
|
||||
if ( m_type == OBJECT_TEEN37 ) // boat?
|
||||
{
|
||||
Math::Vector vib;
|
||||
glm::vec3 vib{};
|
||||
vib.x = 0.0f;
|
||||
vib.y = sinf(m_progress)*1.0f;
|
||||
vib.z = 0.0f;
|
||||
|
@ -165,12 +164,11 @@ bool CAutoKid::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
Math::Vector pos;
|
||||
pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
pos.y = m_water->GetLevel()+1.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*20.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*20.0f;
|
||||
Math::Vector speed;
|
||||
glm::vec3 speed{};
|
||||
speed.y = 0.0f;
|
||||
speed.x = 0.0f;
|
||||
speed.z = 0.0f;
|
||||
|
|
|
@ -70,7 +70,7 @@ void CAutoMush::Init()
|
|||
|
||||
bool CAutoMush::EventProcess(const Event &event)
|
||||
{
|
||||
Math::Vector pos, speed, dir;
|
||||
glm::vec3 pos, speed, dir;
|
||||
glm::vec2 dim;
|
||||
float factor, zoom, size, angle;
|
||||
int i, channel;
|
||||
|
@ -214,7 +214,7 @@ bool CAutoMush::EventProcess(const Event &event)
|
|||
{
|
||||
m_object->SetRotationX(0.0f);
|
||||
m_object->SetRotationZ(0.0f);
|
||||
m_object->SetScale(Math::Vector(1.0f, 1.0f, 1.0f));
|
||||
m_object->SetScale(glm::vec3(1.0f, 1.0f, 1.0f));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -225,7 +225,7 @@ bool CAutoMush::EventProcess(const Event &event)
|
|||
|
||||
bool CAutoMush::SearchTarget()
|
||||
{
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
glm::vec3 iPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -281,7 +281,7 @@ bool CAutoMush::SearchTarget()
|
|||
type != OBJECT_PARA &&
|
||||
type != OBJECT_HUMAN ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, iPos);
|
||||
if ( dist < 50.0f ) return true;
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ void CAutoNuclearPlant::Init()
|
|||
m_lastParticle = 0.0f;
|
||||
|
||||
mat = m_object->GetWorldMatrix(0);
|
||||
m_pos = Math::Transform(*mat, Math::Vector(22.0f, 4.0f, 0.0f));
|
||||
m_pos = Math::Transform(*mat, glm::vec3(22.0f, 4.0f, 0.0f));
|
||||
|
||||
m_phase = ANUP_WAIT; // waiting ...
|
||||
m_progress = 0.0f;
|
||||
|
@ -114,7 +114,7 @@ bool CAutoNuclearPlant::EventProcess(const Event &event)
|
|||
{
|
||||
CObject* cargo;
|
||||
Math::Matrix* mat;
|
||||
Math::Vector pos, goal, speed;
|
||||
glm::vec3 pos, goal, speed;
|
||||
glm::vec2 dim, rot;
|
||||
float angle;
|
||||
int i, max;
|
||||
|
@ -394,14 +394,14 @@ bool CAutoNuclearPlant::SearchVehicle()
|
|||
|
||||
void CAutoNuclearPlant::CreatePower()
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
float angle = m_object->GetRotationY();
|
||||
|
||||
float powerLevel = 1.0f;
|
||||
CObject* power = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, OBJECT_ATOMIC, powerLevel);
|
||||
|
||||
dynamic_cast<CTransportableObject&>(*power).SetTransporter(m_object);
|
||||
power->SetPosition(Math::Vector(22.0f, 3.0f, 0.0f));
|
||||
power->SetPosition(glm::vec3(22.0f, 3.0f, 0.0f));
|
||||
m_object->SetPower(power);
|
||||
}
|
||||
|
||||
|
|
|
@ -109,15 +109,13 @@ void CAutoPortico::Init()
|
|||
|
||||
void CAutoPortico::Start(int param)
|
||||
{
|
||||
Math::Vector pos;
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
m_finalPos = pos;
|
||||
pos.z += PORTICO_TIME_MOVE*5.0f; // back to start
|
||||
m_object->SetPosition(pos);
|
||||
m_finalPos.z += PORTICO_TIME_OPEN*5.3f;
|
||||
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, PORTICO_POSa, 0.0f));
|
||||
m_object->SetPartPosition(1, glm::vec3(0.0f, PORTICO_POSa, 0.0f));
|
||||
m_object->SetPartRotationY(2, PORTICO_ANGLE1a);
|
||||
m_object->SetPartRotationY(3, PORTICO_ANGLE2a);
|
||||
m_object->SetPartRotationY(4, PORTICO_ANGLE3a);
|
||||
|
@ -138,7 +136,7 @@ void CAutoPortico::Start(int param)
|
|||
bool CAutoPortico::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* pObj;
|
||||
Math::Vector pos;
|
||||
glm::vec3 pos;
|
||||
float angle;
|
||||
|
||||
CAuto::EventProcess(event);
|
||||
|
@ -164,12 +162,12 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
|
||||
m_camera->SetType(Gfx::CAM_TYPE_SCRIPT);
|
||||
|
||||
Math::Vector eye = m_startPos;
|
||||
glm::vec3 eye = m_startPos;
|
||||
eye.x += -100.0f;
|
||||
eye.y += 9.0f;
|
||||
eye.z += -200.0f;
|
||||
|
||||
Math::Vector lookat = m_object->GetPosition();
|
||||
glm::vec3 lookat = m_object->GetPosition();
|
||||
lookat.x += 0.0f;
|
||||
lookat.y += 10.0f;
|
||||
lookat.z += -40.0f;
|
||||
|
@ -353,7 +351,7 @@ bool CAutoPortico::Abort()
|
|||
CObject* pObj;
|
||||
|
||||
m_object->SetPosition(m_finalPos);
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, PORTICO_POSb, 0.0f));
|
||||
m_object->SetPartPosition(1, glm::vec3(0.0f, PORTICO_POSb, 0.0f));
|
||||
m_object->SetPartRotationY(2, PORTICO_ANGLE1b);
|
||||
m_object->SetPartRotationY(3, PORTICO_ANGLE2b);
|
||||
m_object->SetPartRotationY(4, PORTICO_ANGLE3b);
|
||||
|
|
|
@ -82,7 +82,7 @@ void CAutoPowerCaptor::Init()
|
|||
m_lastParticle = 0.0f;
|
||||
|
||||
mat = m_object->GetWorldMatrix(0);
|
||||
m_pos = Math::Transform(*mat, Math::Vector(22.0f, 4.0f, 0.0f));
|
||||
m_pos = Math::Transform(*mat, glm::vec3(22.0f, 4.0f, 0.0f));
|
||||
|
||||
m_phase = APAP_WAIT; // waiting ...
|
||||
m_progress = 0.0f;
|
||||
|
@ -106,7 +106,7 @@ void CAutoPowerCaptor::StartLightning()
|
|||
|
||||
bool CAutoPowerCaptor::EventProcess(const Event &event)
|
||||
{
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
int i;
|
||||
|
||||
|
@ -247,11 +247,11 @@ Error CAutoPowerCaptor::GetError()
|
|||
|
||||
void CAutoPowerCaptor::ChargeObject(float rTime)
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
glm::vec3 sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, sPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
|
|
@ -60,6 +60,6 @@ protected:
|
|||
float m_speed = 0.0f;
|
||||
float m_timeVirus = 0.0f;
|
||||
float m_lastParticle = 0.0f;
|
||||
Math::Vector m_pos;
|
||||
glm::vec3 m_pos = { 0, 0, 0 };
|
||||
int m_channelSound = 0;
|
||||
};
|
||||
|
|
|
@ -120,7 +120,7 @@ void CAutoPowerPlant::Init()
|
|||
bool CAutoPowerPlant::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* cargo;
|
||||
Math::Vector pos, ppos, speed;
|
||||
glm::vec3 pos, ppos, speed;
|
||||
glm::vec2 dim, c, p;
|
||||
Gfx::TerrainRes res;
|
||||
float big;
|
||||
|
@ -199,7 +199,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 4.0f;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 3.0f;
|
||||
dim.y = dim.x;
|
||||
m_partiSphere = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISPHERE1, POWERPLANT_DELAY, 0.0f, 0.0f);
|
||||
|
@ -288,7 +288,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
pos.x = p.x;
|
||||
pos.z = p.y;
|
||||
pos.y += 2.5f+Math::Rand()*3.0f;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = Math::Rand()*2.0f+1.0f;
|
||||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 1.0f, 0.0f, 0.0f);
|
||||
|
@ -332,7 +332,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
cargo->SetScale(1.0f);
|
||||
cargo->SetLock(false); // usable battery
|
||||
dynamic_cast<CTransportableObject&>(*cargo).SetTransporter(m_object);
|
||||
cargo->SetPosition(Math::Vector(0.0f, 3.0f, 0.0f));
|
||||
cargo->SetPosition(glm::vec3(0.0f, 3.0f, 0.0f));
|
||||
m_object->SetPower(cargo);
|
||||
|
||||
m_main->DisplayError(INFO_ENERGY, m_object);
|
||||
|
@ -400,7 +400,7 @@ CObject* CAutoPowerPlant::SearchMetal()
|
|||
|
||||
bool CAutoPowerPlant::SearchVehicle()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -459,7 +459,7 @@ bool CAutoPowerPlant::SearchVehicle()
|
|||
|
||||
void CAutoPowerPlant::CreatePower()
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
float angle = m_object->GetRotationY();
|
||||
float powerLevel = 1.0f;
|
||||
CObject* power = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, OBJECT_POWER, powerLevel);
|
||||
|
@ -474,7 +474,7 @@ void CAutoPowerPlant::CreatePower()
|
|||
|
||||
CObject* CAutoPowerPlant::SearchPower()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -483,7 +483,7 @@ CObject* CAutoPowerPlant::SearchPower()
|
|||
ObjectType type = obj->GetType();
|
||||
if ( type != OBJECT_POWER ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
if ( oPos.x == cPos.x &&
|
||||
oPos.z == cPos.z )
|
||||
{
|
||||
|
|
|
@ -203,11 +203,11 @@ bool CAutoPowerStation::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
Math::Vector pos, ppos, speed;
|
||||
glm::vec3 pos, ppos, speed;
|
||||
glm::vec2 dim;
|
||||
|
||||
Math::Matrix* mat = m_object->GetWorldMatrix(0);
|
||||
pos = Math::Vector(-15.0f, 7.0f, 0.0f); // battery position
|
||||
pos = glm::vec3(-15.0f, 7.0f, 0.0f); // battery position
|
||||
pos = Math::Transform(*mat, pos);
|
||||
speed.x = (Math::Rand()-0.5f)*20.0f;
|
||||
speed.y = (Math::Rand()-0.5f)*20.0f;
|
||||
|
@ -243,7 +243,7 @@ bool CAutoPowerStation::EventProcess(const Event &event)
|
|||
|
||||
CObject* CAutoPowerStation::SearchVehicle()
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
glm::vec3 sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -283,7 +283,7 @@ CObject* CAutoPowerStation::SearchVehicle()
|
|||
type != OBJECT_MOBILEtg &&
|
||||
type != OBJECT_MOBILEdr ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, sPos);
|
||||
if ( dist <= 5.0f ) return obj;
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ protected:
|
|||
float m_lastUpdateTime = 0.0f;
|
||||
float m_lastParticle = 0.0f;
|
||||
int m_soundChannel = 0;
|
||||
Math::Vector m_cargoPos;
|
||||
glm::vec3 m_cargoPos = { 0, 0, 0 };
|
||||
bool m_bLastVirus = false;
|
||||
float m_energyVirus = 0.0f;
|
||||
};
|
||||
|
|
|
@ -75,7 +75,7 @@ void CAutoRadar::Init()
|
|||
|
||||
bool CAutoRadar::EventProcess(const Event &event)
|
||||
{
|
||||
Math::Vector pos, ePos;
|
||||
glm::vec3 pos, ePos;
|
||||
float speed, angle, prog, freq, ampl;
|
||||
|
||||
CAuto::EventProcess(event);
|
||||
|
@ -264,9 +264,9 @@ void CAutoRadar::UpdateInterface()
|
|||
|
||||
// Seeking the position of an enemy.
|
||||
|
||||
bool CAutoRadar::SearchEnemy(Math::Vector &pos)
|
||||
bool CAutoRadar::SearchEnemy(glm::vec3 &pos)
|
||||
{
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
glm::vec3 iPos = m_object->GetPosition();
|
||||
float min = 1000000.0f;
|
||||
m_totalDetect = 0;
|
||||
|
||||
|
@ -284,7 +284,7 @@ bool CAutoRadar::SearchEnemy(Math::Vector &pos)
|
|||
|
||||
m_totalDetect ++;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float distance = Math::Distance(oPos, iPos);
|
||||
if ( distance < min )
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ public:
|
|||
|
||||
protected:
|
||||
void UpdateInterface();
|
||||
bool SearchEnemy(Math::Vector &pos);
|
||||
bool SearchEnemy(glm::vec3 &pos);
|
||||
|
||||
protected:
|
||||
AutoRadarPhase m_phase = ARAP_WAIT;
|
||||
|
|
|
@ -81,7 +81,7 @@ void CAutoRepair::Init()
|
|||
bool CAutoRepair::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* vehicle;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
float angle;
|
||||
|
||||
|
@ -237,7 +237,7 @@ bool CAutoRepair::CreateInterface(bool bSelect)
|
|||
|
||||
CObject* CAutoRepair::SearchVehicle()
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
glm::vec3 sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -247,7 +247,7 @@ CObject* CAutoRepair::SearchVehicle()
|
|||
|
||||
if ( obj->Implements(ObjectInterfaceType::Movable) && !dynamic_cast<CMovableObject&>(*obj).GetPhysics()->GetLand() ) continue; // in flight?
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, sPos);
|
||||
if ( dist <= 5.0f ) return obj;
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ Error CAutoResearch::StartAction(int param)
|
|||
bool CAutoResearch::EventProcess(const Event &event)
|
||||
{
|
||||
CPowerContainerObject* power;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
Error message;
|
||||
glm::vec2 dim;
|
||||
float angle;
|
||||
|
@ -500,7 +500,7 @@ bool CAutoResearch::TestResearch(EventType event)
|
|||
void CAutoResearch::FireStopUpdate(float progress, bool bLightOn)
|
||||
{
|
||||
Math::Matrix* mat;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
int i;
|
||||
|
||||
|
@ -529,7 +529,7 @@ void CAutoResearch::FireStopUpdate(float progress, bool bLightOn)
|
|||
|
||||
mat = m_object->GetWorldMatrix(0);
|
||||
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 2.0f;
|
||||
dim.y = dim.x;
|
||||
|
||||
|
|
|
@ -56,18 +56,18 @@ void CAutoRoot::DeleteObject(bool bAll)
|
|||
void CAutoRoot::Init()
|
||||
{
|
||||
Math::Matrix* mat;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
|
||||
m_time = 0.0f;
|
||||
m_lastParticle = 0.0f;
|
||||
|
||||
mat = m_object->GetWorldMatrix(0);
|
||||
pos = Math::Vector(-5.0f, 28.0f, -4.0f); // peak position
|
||||
pos = glm::vec3(-5.0f, 28.0f, -4.0f); // peak position
|
||||
pos = Math::Transform(*mat, pos);
|
||||
m_center = pos;
|
||||
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 100.0f;
|
||||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(m_center, speed, dim, Gfx::PARTISPHERE5, 0.5f, 0.0f, 0.0f);
|
||||
|
@ -80,7 +80,7 @@ void CAutoRoot::Init()
|
|||
|
||||
bool CAutoRoot::EventProcess(const Event &event)
|
||||
{
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
|
||||
CAuto::EventProcess(event);
|
||||
|
|
|
@ -40,5 +40,5 @@ protected:
|
|||
|
||||
protected:
|
||||
float m_lastParticle = 0.0f;
|
||||
Math::Vector m_center;
|
||||
glm::vec3 m_center = { 0, 0, 0 };
|
||||
};
|
||||
|
|
|
@ -100,7 +100,7 @@ void CAutoTower::Init()
|
|||
bool CAutoTower::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* target;
|
||||
Math::Vector pos;
|
||||
glm::vec3 pos;
|
||||
float angle, quick;
|
||||
|
||||
CAuto::EventProcess(event);
|
||||
|
@ -263,9 +263,9 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
|
||||
// Seeks the nearest target object.
|
||||
|
||||
CObject* CAutoTower::SearchTarget(Math::Vector &impact)
|
||||
CObject* CAutoTower::SearchTarget(glm::vec3 &impact)
|
||||
{
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
glm::vec3 iPos = m_object->GetPosition();
|
||||
float min = 1000000.0f;
|
||||
|
||||
CObject* best = nullptr;
|
||||
|
@ -297,7 +297,7 @@ CObject* CAutoTower::SearchTarget(Math::Vector &impact)
|
|||
|
||||
if (obj->GetCrashSphereCount() == 0) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetFirstCrashSphere().sphere.pos;
|
||||
glm::vec3 oPos = obj->GetFirstCrashSphere().sphere.pos;
|
||||
float distance = Math::Distance(oPos, iPos);
|
||||
if ( distance > TOWER_SCOPE ) continue; // too far
|
||||
if ( distance < min )
|
||||
|
@ -340,7 +340,7 @@ Error CAutoTower::GetError()
|
|||
void CAutoTower::FireStopUpdate(float progress, bool bLightOn)
|
||||
{
|
||||
Math::Matrix* mat;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
int i;
|
||||
|
||||
|
@ -367,7 +367,7 @@ void CAutoTower::FireStopUpdate(float progress, bool bLightOn)
|
|||
|
||||
mat = m_object->GetWorldMatrix(0);
|
||||
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 2.0f;
|
||||
dim.y = dim.x;
|
||||
|
||||
|
@ -494,7 +494,7 @@ bool CAutoTower::Read(CLevelParserLine* line)
|
|||
m_phase = static_cast< AutoTowerPhase >(line->GetParam("aPhase")->AsInt(ATP_WAIT));
|
||||
m_progress = line->GetParam("aProgress")->AsFloat(0.0f);
|
||||
m_speed = line->GetParam("aSpeed")->AsFloat(1.0f);
|
||||
m_targetPos = line->GetParam("aTargetPos")->AsPoint(Math::Vector());
|
||||
m_targetPos = line->GetParam("aTargetPos")->AsPoint(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||
m_angleYactual = line->GetParam("aAngleYactual")->AsFloat(0.0f);
|
||||
m_angleZactual = line->GetParam("aAngleZactual")->AsFloat(0.0f);
|
||||
m_angleYfinal = line->GetParam("aAngleYfinal")->AsFloat(0.0f);
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
protected:
|
||||
void UpdateInterface(float rTime);
|
||||
|
||||
CObject* SearchTarget(Math::Vector &impact);
|
||||
CObject* SearchTarget(glm::vec3 &impact);
|
||||
void FireStopUpdate(float progress, bool bLightOn);
|
||||
|
||||
protected:
|
||||
|
@ -66,7 +66,7 @@ protected:
|
|||
float m_timeVirus = 0.0f;
|
||||
float m_lastUpdateTime = 0.0f;
|
||||
float m_lastParticle = 0.0f;
|
||||
Math::Vector m_targetPos;
|
||||
glm::vec3 m_targetPos = { 0, 0, 0 };
|
||||
float m_angleYactual = 0.0f;
|
||||
float m_angleZactual = 0.0f;
|
||||
float m_angleYfinal = 0.0f;
|
||||
|
|
|
@ -112,7 +112,7 @@ void CAutoVault::Init()
|
|||
bool CAutoVault::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* pObj;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
int i, count;
|
||||
|
||||
|
@ -243,7 +243,7 @@ bool CAutoVault::EventProcess(const Event &event)
|
|||
}
|
||||
|
||||
m_object->DeleteAllCrashSpheres();
|
||||
m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 0.0f));
|
||||
m_object->SetCameraCollisionSphere(Math::Sphere(glm::vec3(0.0f, 0.0f, 0.0f), 0.0f));
|
||||
|
||||
m_sound->Play(SOUND_FINDING, m_object->GetPosition());
|
||||
|
||||
|
@ -281,7 +281,7 @@ bool CAutoVault::EventProcess(const Event &event)
|
|||
}
|
||||
|
||||
// Blinks the keys.
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 2.0f;
|
||||
dim.y = dim.x;
|
||||
for ( i=0 ; i<4 ; i++ )
|
||||
|
@ -387,7 +387,7 @@ bool CAutoVault::Read(CLevelParserLine* line)
|
|||
|
||||
int CAutoVault::CountKeys()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
float cAngle = m_object->GetRotationY();
|
||||
|
||||
for (int index = 0; index < 4; index++)
|
||||
|
@ -406,7 +406,7 @@ int CAutoVault::CountKeys()
|
|||
oType != OBJECT_KEYc &&
|
||||
oType != OBJECT_KEYd ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
@ -465,7 +465,7 @@ int CAutoVault::CountKeys()
|
|||
|
||||
void CAutoVault::LockKeys()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -477,7 +477,7 @@ void CAutoVault::LockKeys()
|
|||
oType != OBJECT_KEYc &&
|
||||
oType != OBJECT_KEYd ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
@ -489,7 +489,7 @@ void CAutoVault::LockKeys()
|
|||
|
||||
void CAutoVault::DownKeys(float progress)
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -501,7 +501,7 @@ void CAutoVault::DownKeys(float progress)
|
|||
oType != OBJECT_KEYc &&
|
||||
oType != OBJECT_KEYd ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
@ -514,7 +514,7 @@ void CAutoVault::DownKeys(float progress)
|
|||
|
||||
void CAutoVault::DeleteKeys()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
bool haveDeleted = false;
|
||||
do
|
||||
|
@ -530,7 +530,7 @@ void CAutoVault::DeleteKeys()
|
|||
oType != OBJECT_KEYc &&
|
||||
oType != OBJECT_KEYd ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
@ -546,14 +546,14 @@ void CAutoVault::DeleteKeys()
|
|||
|
||||
CObject* CAutoVault::SearchVehicle()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
if ( obj == m_object ) continue;
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist <= 4.0f ) return obj;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,6 @@ protected:
|
|||
float m_actualAngle = 0.0f;
|
||||
float m_finalAngle = 0.0f;
|
||||
bool m_bKey[4] = {};
|
||||
Math::Vector m_keyPos[4];
|
||||
glm::vec3 m_keyPos[4] = {};
|
||||
int m_keyParti[4] = {};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue