Refactored Math::Vector to glm::vec3 in various auto classes
parent
300a2d8569
commit
4634564f17
|
@ -124,7 +124,7 @@ bool CAutoBase::EventProcess(const Event &event)
|
|||
{
|
||||
Math::Matrix* mat;
|
||||
CObject* pObj;
|
||||
Math::Vector pos, speed, vibCir, iPos;
|
||||
glm::vec3 pos, speed, vibCir, iPos;
|
||||
glm::vec2 dim, p;
|
||||
float angle, dist, time, h, len, vSpeed;
|
||||
int i, max;
|
||||
|
@ -155,8 +155,8 @@ begin:
|
|||
m_object->SetPartRotationZ(1+i, Math::PI/2.0f-124.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(18+i, 10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, glm::vec3(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, glm::vec3(23.5f, 0.0f, 11.5f));
|
||||
}
|
||||
|
||||
pObj = m_main->GetSelectObject();
|
||||
|
@ -186,8 +186,8 @@ begin:
|
|||
m_object->SetPartRotationZ(1+i, Math::PI/2.0f-124.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(18+i, 10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, glm::vec3(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, glm::vec3(23.5f, 0.0f, 11.5f));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,12 +202,12 @@ begin:
|
|||
|
||||
m_camera->SetType(Gfx::CAM_TYPE_SCRIPT);
|
||||
|
||||
Math::Vector eye = m_pos;
|
||||
glm::vec3 eye = m_pos;
|
||||
eye.x -= 150.0f;
|
||||
m_terrain->AdjustToFloor(eye);
|
||||
eye.y += 10.0f;
|
||||
|
||||
Math::Vector lookat = m_object->GetPosition();
|
||||
glm::vec3 lookat = m_object->GetPosition();
|
||||
lookat.y += 300.0f+50.0f;
|
||||
|
||||
m_camera->SetScriptCamera(eye, lookat);
|
||||
|
@ -265,37 +265,37 @@ begin:
|
|||
pos.z -= 60.0f;
|
||||
pos.y += 80.0f;
|
||||
m_posSound = pos;
|
||||
m_camera->SetScriptCamera(pos, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_camera->SetScriptCamera(pos, glm::vec3(0.0f, 0.0f, 0.0f));
|
||||
m_engine->SetFocus(1.0f);
|
||||
|
||||
BeginTransit();
|
||||
|
||||
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 = 10.0f;
|
||||
dim.y = dim.x;
|
||||
pos = Math::Vector(42.0f, -2.0f, 17.0f);
|
||||
pos = glm::vec3(42.0f, -2.0f, 17.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_partiChannel[0] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(17.0f, -2.0f, 42.0f);
|
||||
pos = glm::vec3(17.0f, -2.0f, 42.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_partiChannel[1] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(42.0f, -2.0f, -17.0f);
|
||||
pos = glm::vec3(42.0f, -2.0f, -17.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_partiChannel[2] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(17.0f, -2.0f, -42.0f);
|
||||
pos = glm::vec3(17.0f, -2.0f, -42.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_partiChannel[3] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(-42.0f, -2.0f, 17.0f);
|
||||
pos = glm::vec3(-42.0f, -2.0f, 17.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_partiChannel[4] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(-17.0f, -2.0f, 42.0f);
|
||||
pos = glm::vec3(-17.0f, -2.0f, 42.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_partiChannel[5] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(-42.0f, -2.0f, -17.0f);
|
||||
pos = glm::vec3(-42.0f, -2.0f, -17.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_partiChannel[6] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(-17.0f, -2.0f, -42.0f);
|
||||
pos = glm::vec3(-17.0f, -2.0f, -42.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_partiChannel[7] = m_particle->CreateParticle(pos, speed, dim, Gfx::PARTILENS1, BASE_TRANSIT_TIME+1.0f, 0.0f, 0.0f);
|
||||
|
||||
|
@ -342,12 +342,12 @@ begin:
|
|||
vibCir *= Math::Min(1.0f, (1.0f-m_progress)*3.0f);
|
||||
m_object->SetCirVibration(vibCir);
|
||||
|
||||
Math::Vector eye = m_pos;
|
||||
glm::vec3 eye = m_pos;
|
||||
eye.x -= 150.0f;
|
||||
m_terrain->AdjustToFloor(eye);
|
||||
eye.y += 10.0f;
|
||||
|
||||
Math::Vector lookat = m_object->GetPosition();
|
||||
glm::vec3 lookat = m_object->GetPosition();
|
||||
lookat.y += 50.0f;
|
||||
|
||||
m_camera->SetScriptCameraAnimate(eye, lookat);
|
||||
|
@ -407,7 +407,7 @@ begin:
|
|||
m_bMotor = false; // put out the reactor
|
||||
|
||||
m_object->SetPosition(m_pos); // setting down
|
||||
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetCirVibration(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||
MoveCargo(); // all cargo moves
|
||||
|
||||
// Impact with the ground.
|
||||
|
@ -419,7 +419,7 @@ begin:
|
|||
pos = m_pos;
|
||||
pos.x += p.x;
|
||||
pos.z += p.y;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = Math::Rand()*10.0f+10.0f;
|
||||
dim.y = dim.x;
|
||||
time = Math::Rand()*2.0f+1.5f;
|
||||
|
@ -513,7 +513,7 @@ begin:
|
|||
pos = m_pos;
|
||||
pos.x += p.x;
|
||||
pos.z += p.y;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = Math::Rand()*8.0f+8.0f;
|
||||
dim.y = dim.x;
|
||||
time = Math::Rand()*2.0f+1.5f;
|
||||
|
@ -537,8 +537,8 @@ begin:
|
|||
len = 7.0f-m_progress*(7.0f+11.5f);
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, len));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, -len));
|
||||
m_object->SetPartPosition(10+i, glm::vec3(23.5f, 0.0f, len));
|
||||
m_object->SetPartPosition(18+i, glm::vec3(23.5f, 0.0f, -len));
|
||||
m_object->SetPartRotationX(10+i, -10.0f*Math::PI/180.0f*m_progress);
|
||||
m_object->SetPartRotationX(18+i, 10.0f*Math::PI/180.0f*m_progress);
|
||||
}
|
||||
|
@ -562,8 +562,8 @@ begin:
|
|||
{
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, glm::vec3(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, glm::vec3(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartRotationX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(18+i, 10.0f*Math::PI/180.0f);
|
||||
}
|
||||
|
@ -616,8 +616,8 @@ begin:
|
|||
len = 7.0f-(1.0f-m_progress)*(7.0f+11.5f);
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, len));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, -len));
|
||||
m_object->SetPartPosition(10+i, glm::vec3(23.5f, 0.0f, len));
|
||||
m_object->SetPartPosition(18+i, glm::vec3(23.5f, 0.0f, -len));
|
||||
m_object->SetPartRotationX(10+i, -10.0f*Math::PI/180.0f*(1.0f-m_progress));
|
||||
m_object->SetPartRotationX(18+i, 10.0f*Math::PI/180.0f*(1.0f-m_progress));
|
||||
}
|
||||
|
@ -626,8 +626,8 @@ begin:
|
|||
{
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, 7.0f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, -7.0f));
|
||||
m_object->SetPartPosition(10+i, glm::vec3(23.5f, 0.0f, 7.0f));
|
||||
m_object->SetPartPosition(18+i, glm::vec3(23.5f, 0.0f, -7.0f));
|
||||
m_object->SetPartRotationX(10+i, 0.0f);
|
||||
m_object->SetPartRotationX(18+i, 0.0f);
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ begin:
|
|||
pos.x += p.x;
|
||||
pos.z += p.y;
|
||||
pos.y += 85.0f;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = Math::Rand()*3.0f+3.0f;
|
||||
dim.y = dim.x;
|
||||
time = Math::Rand()*1.0f+1.0f;
|
||||
|
@ -745,12 +745,12 @@ begin:
|
|||
vibCir.y = 0.0f;
|
||||
m_object->SetCirVibration(vibCir);
|
||||
|
||||
Math::Vector eye = m_pos;
|
||||
glm::vec3 eye = m_pos;
|
||||
eye.x -= 110.0f+m_progress*250.0f;
|
||||
m_terrain->AdjustToFloor(eye);
|
||||
eye.y += 10.0f;
|
||||
|
||||
Math::Vector lookat = m_object->GetPosition();
|
||||
glm::vec3 lookat = m_object->GetPosition();
|
||||
lookat.y += 50.0f;
|
||||
|
||||
m_camera->SetScriptCameraAnimate(eye, lookat);
|
||||
|
@ -859,7 +859,7 @@ begin:
|
|||
pos = m_pos;
|
||||
pos.x += p.x;
|
||||
pos.z += p.y;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = Math::Rand()*10.0f+10.0f;
|
||||
dim.y = dim.x;
|
||||
time = Math::Rand()*2.0f+1.5f;
|
||||
|
@ -952,7 +952,7 @@ begin:
|
|||
if ( vSpeed < 0.0f ) vSpeed *= 1.5f;
|
||||
}
|
||||
|
||||
pos = Math::Vector(0.0f, 6.0f, 0.0f);
|
||||
pos = glm::vec3(0.0f, 6.0f, 0.0f);
|
||||
speed.x = (Math::Rand()-0.5f)*4.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*4.0f;
|
||||
speed.y = vSpeed*0.8f-(8.0f+Math::Rand()*6.0f);
|
||||
|
@ -968,72 +968,72 @@ begin:
|
|||
|
||||
if ( m_phase == ABP_TRANSIT_MOVE )
|
||||
{
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 12.0f;
|
||||
dim.y = dim.x;
|
||||
pos = Math::Vector(0.0f, 7.0f, 0.0f);
|
||||
pos = glm::vec3(0.0f, 7.0f, 0.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 1.0f, 0.0f, 0.0f);
|
||||
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 4.0f;
|
||||
dim.y = dim.x;
|
||||
pos = Math::Vector(42.0f, 0.0f, 17.0f);
|
||||
pos = glm::vec3(42.0f, 0.0f, 17.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(17.0f, 0.0f, 42.0f);
|
||||
pos = glm::vec3(17.0f, 0.0f, 42.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(42.0f, 0.0f, -17.0f);
|
||||
pos = glm::vec3(42.0f, 0.0f, -17.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(17.0f, 0.0f, -42.0f);
|
||||
pos = glm::vec3(17.0f, 0.0f, -42.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(-42.0f, 0.0f, 17.0f);
|
||||
pos = glm::vec3(-42.0f, 0.0f, 17.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(-17.0f, 0.0f, 42.0f);
|
||||
pos = glm::vec3(-17.0f, 0.0f, 42.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(-42.0f, 0.0f, -17.0f);
|
||||
pos = glm::vec3(-42.0f, 0.0f, -17.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f);
|
||||
pos = Math::Vector(-17.0f, 0.0f, -42.0f);
|
||||
pos = glm::vec3(-17.0f, 0.0f, -42.0f);
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f; pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 0.5f, 0.0f, 0.0f);
|
||||
|
||||
pos = Math::Vector(42.0f, -2.0f, 17.0f);
|
||||
pos = glm::vec3(42.0f, -2.0f, 17.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->SetPosition(m_partiChannel[0], pos);
|
||||
pos = Math::Vector(17.0f, -2.0f, 42.0f);
|
||||
pos = glm::vec3(17.0f, -2.0f, 42.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->SetPosition(m_partiChannel[1], pos);
|
||||
pos = Math::Vector(42.0f, -2.0f, -17.0f);
|
||||
pos = glm::vec3(42.0f, -2.0f, -17.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->SetPosition(m_partiChannel[2], pos);
|
||||
pos = Math::Vector(17.0f, -2.0f, -42.0f);
|
||||
pos = glm::vec3(17.0f, -2.0f, -42.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->SetPosition(m_partiChannel[3], pos);
|
||||
pos = Math::Vector(-42.0f, -2.0f, 17.0f);
|
||||
pos = glm::vec3(-42.0f, -2.0f, 17.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->SetPosition(m_partiChannel[4], pos);
|
||||
pos = Math::Vector(-17.0f, -2.0f, 42.0f);
|
||||
pos = glm::vec3(-17.0f, -2.0f, 42.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->SetPosition(m_partiChannel[5], pos);
|
||||
pos = Math::Vector(-42.0f, -2.0f, -17.0f);
|
||||
pos = glm::vec3(-42.0f, -2.0f, -17.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->SetPosition(m_partiChannel[6], pos);
|
||||
pos = Math::Vector(-17.0f, -2.0f, -42.0f);
|
||||
pos = glm::vec3(-17.0f, -2.0f, -42.0f);
|
||||
pos = Transform(*mat, pos);
|
||||
m_particle->SetPosition(m_partiChannel[7], pos);
|
||||
}
|
||||
|
@ -1086,8 +1086,8 @@ bool CAutoBase::Abort()
|
|||
m_object->SetPartRotationZ(1+i, Math::PI/2.0f-124.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(18+i, 10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, glm::vec3(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, glm::vec3(23.5f, 0.0f, 11.5f));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1101,15 +1101,15 @@ bool CAutoBase::Abort()
|
|||
m_bOpen = true;
|
||||
|
||||
m_object->SetPosition(m_pos); // setting down
|
||||
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetCirVibration(glm::vec3(0.0f, 0.0f, 0.0f));
|
||||
MoveCargo(); // all cargo moves
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPartRotationZ(1+i, Math::PI/2.0f-124.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartRotationX(18+i, 10.0f*Math::PI/180.0f);
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, glm::vec3(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, glm::vec3(23.5f, 0.0f, 11.5f));
|
||||
}
|
||||
|
||||
m_main->SetMovieLock(false); // you can play!
|
||||
|
@ -1241,7 +1241,7 @@ void CAutoBase::FreezeCargo(bool freeze)
|
|||
if ( obj == m_object ) continue; // yourself?
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(m_pos, oPos);
|
||||
if ( dist < 32.0f )
|
||||
{
|
||||
|
@ -1259,11 +1259,11 @@ void CAutoBase::FreezeCargo(bool freeze)
|
|||
|
||||
void CAutoBase::MoveCargo()
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
glm::vec3 sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : m_cargoObjects)
|
||||
{
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
oPos.y = sPos.y+30.0f;
|
||||
oPos.y += obj->GetCharacter()->height;
|
||||
oPos.x += sPos.x-m_lastPos.x;
|
||||
|
@ -1289,7 +1289,7 @@ Error CAutoBase::CheckCloseDoor()
|
|||
|
||||
for (const auto& crashSphere : obj->GetAllCrashSpheres())
|
||||
{
|
||||
Math::Vector oPos = crashSphere.sphere.pos;
|
||||
glm::vec3 oPos = crashSphere.sphere.pos;
|
||||
float oRad = crashSphere.sphere.radius;
|
||||
float dist = Math::DistanceProjected(m_pos, oPos);
|
||||
if ( dist+oRad > 32.0f &&
|
||||
|
@ -1384,12 +1384,12 @@ Error CAutoBase::TakeOff(bool printMsg)
|
|||
|
||||
m_camera->SetType(Gfx::CAM_TYPE_SCRIPT);
|
||||
|
||||
Math::Vector eye = m_pos;
|
||||
glm::vec3 eye = m_pos;
|
||||
eye.x -= 110.0f;
|
||||
m_terrain->AdjustToFloor(eye);
|
||||
eye.y += 10.0f;
|
||||
|
||||
Math::Vector lookat = m_object->GetPosition();
|
||||
glm::vec3 lookat = m_object->GetPosition();
|
||||
lookat.y += 50.0f;
|
||||
|
||||
m_camera->SetScriptCameraAnimate(eye, lookat);
|
||||
|
|
|
@ -101,10 +101,10 @@ protected:
|
|||
float m_lastMotorParticle = 0.0f;
|
||||
float m_fogStart = 0.0f;
|
||||
float m_deepView = 0.0f;
|
||||
Math::Vector m_pos;
|
||||
Math::Vector m_posSound;
|
||||
Math::Vector m_finalPos;
|
||||
Math::Vector m_lastPos;
|
||||
glm::vec3 m_pos = { 0, 0, 0 };
|
||||
glm::vec3 m_posSound = { 0, 0, 0 };
|
||||
glm::vec3 m_finalPos = { 0, 0, 0 };
|
||||
glm::vec3 m_lastPos = { 0, 0, 0 };
|
||||
int m_param = 0;
|
||||
int m_soundChannel = 0;
|
||||
int m_partiChannel[8] = {};
|
||||
|
|
|
@ -100,7 +100,7 @@ void CAutoConvert::Init()
|
|||
bool CAutoConvert::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* cargo;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim, c, p;
|
||||
float angle;
|
||||
|
||||
|
@ -221,7 +221,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
pos.x = p.x;
|
||||
pos.z = p.y;
|
||||
pos.y += 1.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::PARTIGAS, 1.0f, 0.0f, 0.0f);
|
||||
|
@ -265,7 +265,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
pos.x += (Math::Rand()-0.5f)*6.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*6.0f;
|
||||
pos.y += Math::Rand()*4.0f;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = Math::Rand()*4.0f+3.0f;
|
||||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLUE, 1.0f, 0.0f, 0.0f);
|
||||
|
@ -397,7 +397,7 @@ bool CAutoConvert::Read(CLevelParserLine* line)
|
|||
|
||||
CObject* CAutoConvert::SearchStone(ObjectType type)
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -405,7 +405,7 @@ CObject* CAutoConvert::SearchStone(ObjectType type)
|
|||
if ( oType != type ) continue;
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, cPos);
|
||||
|
||||
if ( dist <= 5.0f ) return obj;
|
||||
|
@ -418,7 +418,7 @@ CObject* CAutoConvert::SearchStone(ObjectType type)
|
|||
|
||||
bool CAutoConvert::SearchVehicle()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -440,7 +440,7 @@ bool CAutoConvert::SearchVehicle()
|
|||
|
||||
void CAutoConvert::CreateMetal()
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
float angle = m_object->GetRotationY();
|
||||
|
||||
CObjectManager::GetInstancePointer()->CreateObject(pos, angle, OBJECT_METAL);
|
||||
|
|
|
@ -89,7 +89,7 @@ void CAutoDerrick::DeleteObject(bool all)
|
|||
|
||||
void CAutoDerrick::Init()
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
Gfx::TerrainRes res = m_terrain->GetResource(pos);
|
||||
|
||||
if ( res == Gfx::TR_STONE ||
|
||||
|
@ -124,9 +124,9 @@ void CAutoDerrick::Init()
|
|||
m_lastTrack = 0.0f;
|
||||
}
|
||||
|
||||
Math::Vector CAutoDerrick::GetCargoPos()
|
||||
glm::vec3 CAutoDerrick::GetCargoPos()
|
||||
{
|
||||
Math::Vector pos = Math::Vector(7.0f, 0.0f, 0.0f);
|
||||
glm::vec3 pos = glm::vec3(7.0f, 0.0f, 0.0f);
|
||||
Math::Matrix* mat = m_object->GetWorldMatrix(0);
|
||||
pos = Math::Transform(*mat, pos);
|
||||
m_terrain->AdjustToFloor(pos);
|
||||
|
@ -139,7 +139,7 @@ Math::Vector CAutoDerrick::GetCargoPos()
|
|||
bool CAutoDerrick::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* cargo;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
float angle, duration, factor;
|
||||
|
||||
|
@ -310,7 +310,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress == 0.0f )
|
||||
{
|
||||
Math::Vector cargoPos = GetCargoPos();
|
||||
glm::vec3 cargoPos = GetCargoPos();
|
||||
if ( SearchFree(cargoPos) )
|
||||
{
|
||||
angle = m_object->GetRotationY();
|
||||
|
@ -339,7 +339,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
pos.x += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.y += (Math::Rand()-0.5f)*5.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_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFIRE, 1.0f, 0.0f, 0.0f);
|
||||
|
@ -350,7 +350,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
pos.x += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.y += Math::Rand()*2.5f;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
speed = glm::vec3(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 1.0f;
|
||||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 2.0f, 0.0f, 0.0f);
|
||||
|
@ -361,7 +361,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
{
|
||||
if ( cargo != nullptr )
|
||||
{
|
||||
Math::Vector cargoPos = GetCargoPos();
|
||||
glm::vec3 cargoPos = GetCargoPos();
|
||||
pos = cargo->GetPosition();
|
||||
pos.y -= event.rTime*20.0f; // grave
|
||||
if ( !m_bSoundFall && pos.y < cargoPos.y )
|
||||
|
@ -464,13 +464,13 @@ bool CAutoDerrick::Read(CLevelParserLine* line)
|
|||
|
||||
CObject* CAutoDerrick::SearchCargo()
|
||||
{
|
||||
Math::Vector cargoPos = GetCargoPos();
|
||||
glm::vec3 cargoPos = GetCargoPos();
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
ObjectType type = obj->GetType();
|
||||
if ( type == OBJECT_DERRICK ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
|
||||
if ( oPos.x == cargoPos.x &&
|
||||
oPos.z == cargoPos.z ) return obj;
|
||||
|
@ -481,7 +481,7 @@ CObject* CAutoDerrick::SearchCargo()
|
|||
|
||||
// Seeks if a site is free.
|
||||
|
||||
bool CAutoDerrick::SearchFree(Math::Vector pos)
|
||||
bool CAutoDerrick::SearchFree(glm::vec3 pos)
|
||||
{
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -490,7 +490,7 @@ bool CAutoDerrick::SearchFree(Math::Vector pos)
|
|||
|
||||
for (const auto& crashSphere : obj->GetAllCrashSpheres())
|
||||
{
|
||||
Math::Vector sPos = crashSphere.sphere.pos;
|
||||
glm::vec3 sPos = crashSphere.sphere.pos;
|
||||
float sRadius = crashSphere.sphere.radius;
|
||||
|
||||
float distance = Math::Distance(sPos, pos);
|
||||
|
@ -504,7 +504,7 @@ bool CAutoDerrick::SearchFree(Math::Vector pos)
|
|||
|
||||
// Create a transportable object.
|
||||
|
||||
void CAutoDerrick::CreateCargo(Math::Vector pos, float angle, ObjectType type,
|
||||
void CAutoDerrick::CreateCargo(glm::vec3 pos, float angle, ObjectType type,
|
||||
float height)
|
||||
{
|
||||
CObject* cargo = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, type);
|
||||
|
|
|
@ -55,11 +55,11 @@ public:
|
|||
|
||||
protected:
|
||||
CObject* SearchCargo();
|
||||
bool SearchFree(Math::Vector pos);
|
||||
void CreateCargo(Math::Vector pos, float angle, ObjectType type, float height);
|
||||
bool SearchFree(glm::vec3 pos);
|
||||
void CreateCargo(glm::vec3 pos, float angle, ObjectType type, float height);
|
||||
bool ExistKey();
|
||||
|
||||
Math::Vector GetCargoPos();
|
||||
glm::vec3 GetCargoPos();
|
||||
|
||||
protected:
|
||||
AutoDerrickPhase m_phase = ADP_WAIT;
|
||||
|
|
|
@ -117,7 +117,7 @@ Error CAutoDestroyer::StartAction(int param)
|
|||
bool CAutoDestroyer::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* scrap;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
Ui::CWindow* pw;
|
||||
|
||||
|
@ -183,13 +183,13 @@ bool CAutoDestroyer::EventProcess(const Event &event)
|
|||
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
pos = Math::Vector(0.0f, -10.0f, 0.0f);
|
||||
pos = glm::vec3(0.0f, -10.0f, 0.0f);
|
||||
pos.y = -Math::Bounce(m_progress, 0.3f)*10.0f;
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, -10.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, glm::vec3(0.0f, -10.0f, 0.0f));
|
||||
m_sound->Play(SOUND_REPAIR, m_object->GetPosition());
|
||||
|
||||
m_phase = ADEP_REPAIR;
|
||||
|
@ -217,13 +217,13 @@ bool CAutoDestroyer::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
pos = Math::Vector(0.0f, -10.0f, 0.0f);
|
||||
pos = glm::vec3(0.0f, -10.0f, 0.0f);
|
||||
pos.y = -(1.0f-m_progress)*10.0f;
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, glm::vec3(0.0f, 0.0f, 0.0f));
|
||||
|
||||
m_phase = ADEP_WAIT;
|
||||
m_progress = 0.0f;
|
||||
|
@ -279,7 +279,7 @@ bool CAutoDestroyer::CreateInterface(bool bSelect)
|
|||
|
||||
CObject* CAutoDestroyer::SearchPlastic()
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
glm::vec3 sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ CObject* CAutoDestroyer::SearchPlastic()
|
|||
if (!obj->Implements(ObjectInterfaceType::Destroyable)) continue;
|
||||
if (obj->GetType() == OBJECT_HUMAN || obj->GetType() == OBJECT_TECH) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, sPos);
|
||||
if ( dist <= 5.0f ) return obj;
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ bool CAutoEgg::EventProcess(const Event &event)
|
|||
m_progress += event.rTime*m_speed;
|
||||
if ( m_progress < 1.0f ) return true;
|
||||
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
glm::vec3 pos = m_object->GetPosition();
|
||||
float angle = m_object->GetRotationY();
|
||||
CObject* alien = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, m_type);
|
||||
|
||||
|
@ -288,7 +288,7 @@ Error CAutoEgg::GetError()
|
|||
|
||||
CObject* CAutoEgg::SearchAlien()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
float min = 100000.0f;
|
||||
CObject* best = nullptr;
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
|
@ -301,7 +301,7 @@ CObject* CAutoEgg::SearchAlien()
|
|||
type != OBJECT_SPIDER &&
|
||||
type != OBJECT_WORM ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist < 8.0f && dist < min )
|
||||
{
|
||||
|
|
|
@ -209,7 +209,7 @@ bool CAutoFactory::EventProcess(const Event &event)
|
|||
CObject* vehicle;
|
||||
Math::Matrix* mat;
|
||||
CPhysics* physics;
|
||||
Math::Vector pos, speed;
|
||||
glm::vec3 pos, speed;
|
||||
glm::vec2 dim;
|
||||
float zoom, angle, prog;
|
||||
int i;
|
||||
|
@ -369,7 +369,7 @@ bool CAutoFactory::EventProcess(const Event &event)
|
|||
m_lastParticle = m_time;
|
||||
|
||||
mat = m_object->GetWorldMatrix(0);
|
||||
pos = Math::Vector(-12.0f, 20.0f, -4.0f); // position of chimney
|
||||
pos = glm::vec3(-12.0f, 20.0f, -4.0f); // position of chimney
|
||||
pos = Math::Transform(*mat, pos);
|
||||
pos.y += 2.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f;
|
||||
|
@ -456,7 +456,7 @@ bool CAutoFactory::EventProcess(const Event &event)
|
|||
pos.x += (Math::Rand()-0.5f)*10.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*10.0f;
|
||||
pos.y += Math::Rand()*10.0f;
|
||||
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;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 2.0f, 0.0f, 0.0f);
|
||||
|
@ -499,7 +499,7 @@ bool CAutoFactory::EventProcess(const Event &event)
|
|||
pos.x += (Math::Rand()-0.5f)*10.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*10.0f;
|
||||
pos.y += Math::Rand()*10.0f;
|
||||
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;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 2.0f, 0.0f, 0.0f);
|
||||
|
@ -569,7 +569,7 @@ CObject* CAutoFactory::SearchCargo()
|
|||
if ( type != OBJECT_METAL ) continue;
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, m_cargoPos);
|
||||
|
||||
if ( dist < 8.0f ) return obj;
|
||||
|
@ -582,7 +582,7 @@ CObject* CAutoFactory::SearchCargo()
|
|||
|
||||
bool CAutoFactory::NearestVehicle()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
glm::vec3 cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -644,17 +644,17 @@ bool CAutoFactory::CreateVehicle()
|
|||
{
|
||||
float angle = m_object->GetRotationY();
|
||||
|
||||
Math::Vector pos;
|
||||
glm::vec3 pos{};
|
||||
if ( m_type == OBJECT_MOBILErt ||
|
||||
m_type == OBJECT_MOBILErc ||
|
||||
m_type == OBJECT_MOBILErr ||
|
||||
m_type == OBJECT_MOBILErs )
|
||||
{
|
||||
pos = Math::Vector(2.0f, 0.0f, 0.0f);
|
||||
pos = glm::vec3(2.0f, 0.0f, 0.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
pos = Math::Vector(4.0f, 0.0f, 0.0f);
|
||||
pos = glm::vec3(4.0f, 0.0f, 0.0f);
|
||||
}
|
||||
Math::Matrix* mat = m_object->GetWorldMatrix(0);
|
||||
pos = Transform(*mat, pos);
|
||||
|
@ -700,7 +700,7 @@ CObject* CAutoFactory::SearchVehicle()
|
|||
if ( type != m_type ) continue;
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, m_cargoPos);
|
||||
|
||||
if ( dist < 8.0f ) return obj;
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "object/auto/auto.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
class CObject;
|
||||
|
||||
enum AutoFactoryPhase
|
||||
|
@ -72,7 +74,7 @@ protected:
|
|||
float m_progress = 0.0f;
|
||||
float m_speed = 0.0f;
|
||||
float m_lastParticle = 0.0f;
|
||||
Math::Vector m_cargoPos;
|
||||
glm::vec3 m_cargoPos = { 0, 0, 0 };
|
||||
int m_channelSound = 0;
|
||||
|
||||
std::string m_program;
|
||||
|
|
|
@ -40,10 +40,10 @@ CAutoHouston::CAutoHouston(COldObject* object) : CAuto(object)
|
|||
m_lens[1].type = Gfx::PARTISELR;
|
||||
m_lens[2].type = Gfx::PARTISELR;
|
||||
m_lens[3].type = Gfx::PARTISELR;
|
||||
m_lens[0].pos = Math::Vector(0.0f+13.0f, 34.0f, 30.0f );
|
||||
m_lens[1].pos = Math::Vector(0.0f-13.0f, 34.0f, 30.0f );
|
||||
m_lens[2].pos = Math::Vector(0.0f , 34.0f, 30.0f+13.0f);
|
||||
m_lens[3].pos = Math::Vector(0.0f , 34.0f, 30.0f-13.0f);
|
||||
m_lens[0].pos = glm::vec3(0.0f+13.0f, 34.0f, 30.0f );
|
||||
m_lens[1].pos = glm::vec3(0.0f-13.0f, 34.0f, 30.0f );
|
||||
m_lens[2].pos = glm::vec3(0.0f , 34.0f, 30.0f+13.0f);
|
||||
m_lens[3].pos = glm::vec3(0.0f , 34.0f, 30.0f-13.0f);
|
||||
m_lens[0].dim = 4.0f;
|
||||
m_lens[1].dim = 4.0f;
|
||||
m_lens[2].dim = 4.0f;
|
||||
|
@ -61,46 +61,46 @@ CAutoHouston::CAutoHouston(COldObject* object) : CAuto(object)
|
|||
|
||||
// Part under the radar.
|
||||
m_lens[i].type = Gfx::PARTISELR;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 9.9f, 40.1f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 9.9f, 40.1f);
|
||||
m_lens[i].dim = 1.8f;
|
||||
m_lens[i].total = 0.4f;
|
||||
m_lens[i].off = 0.2f;
|
||||
i ++;
|
||||
|
||||
m_lens[i].type = Gfx::PARTISELY;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 7.2f, 34.8f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 7.2f, 34.8f);
|
||||
m_lens[i].dim = 0.4f;
|
||||
m_lens[i].total = 0.7f;
|
||||
m_lens[i].off = 0.3f;
|
||||
i ++;
|
||||
m_lens[i].type = Gfx::PARTISELY;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 6.5f, 34.3f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 6.5f, 34.3f);
|
||||
m_lens[i].dim = 0.4f;
|
||||
m_lens[i].total = 0.7f;
|
||||
m_lens[i].off = 0.3f;
|
||||
i ++;
|
||||
m_lens[i].type = Gfx::PARTISELR;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 6.5f, 33.4f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 6.5f, 33.4f);
|
||||
m_lens[i].dim = 0.4f;
|
||||
m_lens[i].total = 0.0f;
|
||||
m_lens[i].off = 0.0f;
|
||||
i ++;
|
||||
m_lens[i].type = Gfx::PARTISELR;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 6.5f, 33.0f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 6.5f, 33.0f);
|
||||
m_lens[i].dim = 0.4f;
|
||||
m_lens[i].total = 1.0f;
|
||||
m_lens[i].off = 0.5f;
|
||||
i ++;
|
||||
|
||||
m_lens[i].type = Gfx::PARTISELY;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 8.5f, 14.0f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 8.5f, 14.0f);
|
||||
m_lens[i].dim = 1.2f;
|
||||
m_lens[i].total = 0.8f;
|
||||
m_lens[i].off = 0.2f;
|
||||
i ++;
|
||||
|
||||
m_lens[i].type = Gfx::PARTISELR;
|
||||
m_lens[i].pos = Math::Vector(4.0f, 6.0f, 8.6f);
|
||||
m_lens[i].pos = glm::vec3(4.0f, 6.0f, 8.6f);
|
||||
m_lens[i].dim = 1.0f;
|
||||
m_lens[i].total = 0.9f;
|
||||
m_lens[i].off = 0.7f;
|
||||
|
@ -108,53 +108,53 @@ CAutoHouston::CAutoHouston(COldObject* object) : CAuto(object)
|
|||
|
||||
// Part with three windows.
|
||||
m_lens[i].type = Gfx::PARTISELR;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 9.9f, -19.9f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 9.9f, -19.9f);
|
||||
m_lens[i].dim = 1.0f;
|
||||
m_lens[i].total = 0.6f;
|
||||
m_lens[i].off = 0.3f;
|
||||
i ++;
|
||||
|
||||
m_lens[i].type = Gfx::PARTISELY;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 7.2f, 34.8f-60.0f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 7.2f, 34.8f-60.0f);
|
||||
m_lens[i].dim = 0.4f;
|
||||
m_lens[i].total = 0.7f;
|
||||
m_lens[i].off = 0.3f;
|
||||
i ++;
|
||||
m_lens[i].type = Gfx::PARTISELY;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 6.5f, 34.3f-60.0f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 6.5f, 34.3f-60.0f);
|
||||
m_lens[i].dim = 0.4f;
|
||||
m_lens[i].total = 0.0f;
|
||||
m_lens[i].off = 0.0f;
|
||||
i ++;
|
||||
m_lens[i].type = Gfx::PARTISELR;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 6.5f, 33.4f-60.0f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 6.5f, 33.4f-60.0f);
|
||||
m_lens[i].dim = 0.4f;
|
||||
m_lens[i].total = 0.6f;
|
||||
m_lens[i].off = 0.4f;
|
||||
i ++;
|
||||
m_lens[i].type = Gfx::PARTISELR;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 6.5f, 33.0f-60.0f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 6.5f, 33.0f-60.0f);
|
||||
m_lens[i].dim = 0.4f;
|
||||
m_lens[i].total = 0.8f;
|
||||
m_lens[i].off = 0.2f;
|
||||
i ++;
|
||||
|
||||
m_lens[i].type = Gfx::PARTISELY;
|
||||
m_lens[i].pos = Math::Vector(-6.5f, 13.5f, -37.0f);
|
||||
m_lens[i].pos = glm::vec3(-6.5f, 13.5f, -37.0f);
|
||||
m_lens[i].dim = 1.0f;
|
||||
m_lens[i].total = 0.0f;
|
||||
m_lens[i].off = 0.0f;
|
||||
i ++;
|
||||
|
||||
m_lens[i].type = Gfx::PARTISELY;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 12.2f, -39.8f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 12.2f, -39.8f);
|
||||
m_lens[i].dim = 1.8f;
|
||||
m_lens[i].total = 1.5f;
|
||||
m_lens[i].off = 0.5f;
|
||||
i ++;
|
||||
|
||||
m_lens[i].type = Gfx::PARTISELY;
|
||||
m_lens[i].pos = Math::Vector(-7.0f, 8.5f, -47.0f);
|
||||
m_lens[i].pos = glm::vec3(-7.0f, 8.5f, -47.0f);
|
||||
m_lens[i].dim = 0.6f;
|
||||
m_lens[i].total = 0.7f;
|
||||
m_lens[i].off = 0.5f;
|
||||
|
@ -236,10 +236,10 @@ bool CAutoHouston::EventProcess(const Event &event)
|
|||
dim.x = m_lens[i].dim;
|
||||
dim.y = dim.x;
|
||||
|
||||
Math::Vector pos = m_lens[i].pos;
|
||||
Math::RotatePoint(Math::Vector(0.0f, 0.0f, 0.0f), -m_object->GetRotationY(), 0.0f, pos);
|
||||
glm::vec3 pos = m_lens[i].pos;
|
||||
Math::RotatePoint(glm::vec3(0.0f, 0.0f, 0.0f), -m_object->GetRotationY(), 0.0f, pos);
|
||||
|
||||
m_lens[i].parti = m_particle->CreateParticle(m_object->GetPosition()+pos, Math::Vector(0.0f, 0.0f, 0.0f), dim, m_lens[i].type, 1.0f, 0.0f, 0.0f);
|
||||
m_lens[i].parti = m_particle->CreateParticle(m_object->GetPosition()+pos, glm::vec3(0.0f, 0.0f, 0.0f), dim, m_lens[i].type, 1.0f, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ struct HustonLens
|
|||
{
|
||||
int parti = 0;
|
||||
Gfx::ParticleType type = {};
|
||||
Math::Vector pos;
|
||||
glm::vec3 pos = { 0, 0, 0 };
|
||||
float dim = 0.0f;
|
||||
float total = 0.0f;
|
||||
float off = 0.0f;
|
||||
|
|
|
@ -89,7 +89,7 @@ void CAutoJostle::Start(int param)
|
|||
|
||||
bool CAutoJostle::EventProcess(const Event &event)
|
||||
{
|
||||
Math::Vector dir;
|
||||
glm::vec3 dir;
|
||||
float factor, angle, zoom;
|
||||
|
||||
CAuto::EventProcess(event);
|
||||
|
@ -129,7 +129,7 @@ bool CAutoJostle::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));
|
||||
m_error = ERR_STOP;
|
||||
}
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ Error CAutoLabo::StartAction(int param)
|
|||
bool CAutoLabo::EventProcess(const Event &event)
|
||||
{
|
||||
CObject* power;
|
||||
Math::Vector pos, goal, speed;
|
||||
glm::vec3 pos, goal, speed;
|
||||
glm::vec2 dim, rot;
|
||||
float angle;
|
||||
int i;
|
||||
|
@ -251,7 +251,7 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPartPosition(1, Math::Vector(-9.0f, 13.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, glm::vec3(-9.0f, 13.0f, 0.0f));
|
||||
|
||||
SoundManip(1.5f, 1.0f, 0.5f);
|
||||
m_phase = ALAP_OPEN3;
|
||||
|
@ -292,7 +292,7 @@ bool CAutoLabo::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 = 4.0f;
|
||||
dim.y = dim.x;
|
||||
m_partiSphere = m_particle->CreateParticle(pos, speed,
|
||||
|
@ -411,7 +411,7 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPartPosition(1, Math::Vector(-9.0f, 3.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, glm::vec3(-9.0f, 3.0f, 0.0f));
|
||||
|
||||
SoundManip(1.0f, 1.0f, 1.0f);
|
||||
m_phase = ALAP_CLOSE3;
|
||||
|
|
|
@ -66,7 +66,7 @@ void CAutoNest::DeleteObject(bool all)
|
|||
|
||||
void CAutoNest::Init()
|
||||
{
|
||||
Math::Vector pos;
|
||||
glm::vec3 pos;
|
||||
|
||||
m_phase = ANP_WAIT;
|
||||
m_progress = 0.0f;
|
||||
|
@ -145,7 +145,7 @@ bool CAutoNest::EventProcess(const Event &event)
|
|||
|
||||
// Seeks if a site is free.
|
||||
|
||||
bool CAutoNest::SearchFree(Math::Vector pos)
|
||||
bool CAutoNest::SearchFree(glm::vec3 pos)
|
||||
{
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -154,7 +154,7 @@ bool CAutoNest::SearchFree(Math::Vector pos)
|
|||
|
||||
for (const auto& crashSphere : obj->GetAllCrashSpheres())
|
||||
{
|
||||
Math::Vector sPos = crashSphere.sphere.pos;
|
||||
glm::vec3 sPos = crashSphere.sphere.pos;
|
||||
float sRadius = crashSphere.sphere.radius;
|
||||
|
||||
float distance = Math::Distance(sPos, pos);
|
||||
|
@ -168,7 +168,7 @@ bool CAutoNest::SearchFree(Math::Vector pos)
|
|||
|
||||
// Create a transportable object.
|
||||
|
||||
void CAutoNest::CreateCargo(Math::Vector pos, float angle, ObjectType type)
|
||||
void CAutoNest::CreateCargo(glm::vec3 pos, float angle, ObjectType type)
|
||||
{
|
||||
CObject* cargo = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, type);
|
||||
cargo->SetLock(true); // not usable
|
||||
|
@ -186,7 +186,7 @@ CObject* CAutoNest::SearchCargo()
|
|||
ObjectType type = obj->GetType();
|
||||
if ( type != OBJECT_BULLET ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
glm::vec3 oPos = obj->GetPosition();
|
||||
if ( oPos.x == m_cargoPos.x &&
|
||||
oPos.z == m_cargoPos.z )
|
||||
{
|
||||
|
|
|
@ -49,8 +49,8 @@ public:
|
|||
bool Read(CLevelParserLine* line) override;
|
||||
|
||||
protected:
|
||||
bool SearchFree(Math::Vector pos);
|
||||
void CreateCargo(Math::Vector pos, float angle, ObjectType type);
|
||||
bool SearchFree(glm::vec3 pos);
|
||||
void CreateCargo(glm::vec3 pos, float angle, ObjectType type);
|
||||
CObject* SearchCargo();
|
||||
|
||||
protected:
|
||||
|
@ -58,5 +58,5 @@ protected:
|
|||
float m_progress = 0.0f;
|
||||
float m_speed = 0.0f;
|
||||
float m_lastParticle = 0.0f;
|
||||
Math::Vector m_cargoPos;
|
||||
glm::vec3 m_cargoPos = { 0, 0, 0 };
|
||||
};
|
||||
|
|
|
@ -64,6 +64,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;
|
||||
};
|
||||
|
|
|
@ -61,8 +61,8 @@ protected:
|
|||
float m_cameraProgress = 0.0f;
|
||||
float m_cameraSpeed = 0.0f;
|
||||
float m_lastParticle = 0.0f;
|
||||
Math::Vector m_finalPos;
|
||||
Math::Vector m_startPos;
|
||||
glm::vec3 m_finalPos = { 0, 0, 0 };
|
||||
glm::vec3 m_startPos = { 0, 0, 0 };
|
||||
float m_posTrack = 0.0f;
|
||||
int m_param = 0;
|
||||
int m_soundChannel = 0;
|
||||
|
|
Loading…
Reference in New Issue