GetPostion(), GetRotation() and GetScale() in CObject interface
Also replace old calls like GetPosition(0) to GetPosition()master
parent
57e3e16517
commit
9a7c1961a4
|
@ -1384,7 +1384,7 @@ bool CCamera::EventFrameBack(const Event &event)
|
|||
|
||||
if (m_cameraObj != NULL)
|
||||
{
|
||||
Math::Vector lookatPt = m_cameraObj->GetPosition(0);
|
||||
Math::Vector lookatPt = m_cameraObj->GetPosition();
|
||||
if (type == OBJECT_BASE ) lookatPt.y += 40.0f;
|
||||
else if (type == OBJECT_HUMAN) lookatPt.y += 1.0f;
|
||||
else if (type == OBJECT_TECH ) lookatPt.y += 1.0f;
|
||||
|
@ -1485,7 +1485,7 @@ bool CCamera::EventFrameFix(const Event &event)
|
|||
|
||||
if (m_cameraObj != NULL)
|
||||
{
|
||||
Math::Vector lookatPt = m_cameraObj->GetPosition(0);
|
||||
Math::Vector lookatPt = m_cameraObj->GetPosition();
|
||||
|
||||
float h = m_fixDirectionH + m_remotePan;
|
||||
float v = m_fixDirectionV;
|
||||
|
|
|
@ -101,7 +101,7 @@ bool CLightning::EventFrame(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_pos = obj->GetPosition(0);
|
||||
m_pos = obj->GetPosition();
|
||||
m_terrain->AdjustToFloor(m_pos, true);
|
||||
|
||||
ObjectType type = obj->GetType();
|
||||
|
@ -329,7 +329,7 @@ CObject* CLightning::SearchObject(Math::Vector pos)
|
|||
type == OBJECT_PARA ) // building a lightning effect?
|
||||
{
|
||||
paraObj.push_back(obj);
|
||||
paraObjPos.push_back(obj->GetPosition(0));
|
||||
paraObjPos.push_back(obj->GetPosition());
|
||||
}
|
||||
|
||||
float detect = 0.0f;
|
||||
|
@ -390,7 +390,7 @@ CObject* CLightning::SearchObject(Math::Vector pos)
|
|||
}
|
||||
if (detect == 0.0f) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, pos);
|
||||
if (dist > detect) continue;
|
||||
if (dist < min)
|
||||
|
@ -404,7 +404,7 @@ CObject* CLightning::SearchObject(Math::Vector pos)
|
|||
return nullptr; // nothing found
|
||||
|
||||
// Under the protection of a lightning conductor?
|
||||
Math::Vector oPos = bestObj->GetPosition(0);
|
||||
Math::Vector oPos = bestObj->GetPosition();
|
||||
for (int i = paraObj.size()-1; i >= 0; i--)
|
||||
{
|
||||
float dist = Math::DistanceProjected(oPos, paraObjPos[i]);
|
||||
|
|
|
@ -2764,7 +2764,7 @@ void CParticle::DrawParticleTriangle(int i)
|
|||
|
||||
CObject* object = m_particle[i].objLink;
|
||||
if (object != nullptr)
|
||||
pos += object->GetPosition(0);
|
||||
pos += object->GetPosition();
|
||||
|
||||
Math::Vector angle;
|
||||
angle.x = -Math::RotateAngle(Math::DistanceProjected(pos, eye), pos.y-eye.y);
|
||||
|
@ -2834,7 +2834,7 @@ void CParticle::DrawParticleNorm(int i)
|
|||
|
||||
CObject* object = m_particle[i].objLink;
|
||||
if (object != nullptr)
|
||||
pos += object->GetPosition(0);
|
||||
pos += object->GetPosition();
|
||||
|
||||
Math::Vector angle;
|
||||
angle.x = -Math::RotateAngle(Math::DistanceProjected(pos, eye), pos.y-eye.y);
|
||||
|
@ -2889,7 +2889,7 @@ void CParticle::DrawParticleFlat(int i)
|
|||
|
||||
CObject* object = m_particle[i].objLink;
|
||||
if (object != nullptr)
|
||||
pos += object->GetPosition(0);
|
||||
pos += object->GetPosition();
|
||||
|
||||
Math::Vector angle;
|
||||
angle.x = Math::PI/2.0f;
|
||||
|
@ -2978,7 +2978,7 @@ void CParticle::DrawParticleFog(int i)
|
|||
|
||||
CObject* object = m_particle[i].objLink;
|
||||
if (object != nullptr)
|
||||
pos += object->GetPosition(0);
|
||||
pos += object->GetPosition();
|
||||
|
||||
Math::Vector angle;
|
||||
angle.x = Math::PI/2.0f;
|
||||
|
@ -3041,7 +3041,7 @@ void CParticle::DrawParticleRay(int i)
|
|||
|
||||
CObject* object = m_particle[i].objLink;
|
||||
if (object != nullptr)
|
||||
pos += object->GetPosition(0);
|
||||
pos += object->GetPosition();
|
||||
|
||||
float a = Math::RotateAngle(Math::Point(pos.x,pos.z), Math::Point(goal.x,goal.z), Math::Point(eye.x,eye.z));
|
||||
bool left = (a < Math::PI);
|
||||
|
@ -3715,7 +3715,7 @@ CObject* CParticle::SearchObjectGun(Math::Vector old, Math::Vector pos,
|
|||
continue;
|
||||
}
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
|
||||
if ( type == PARTIGUN2 || // shooting insect?
|
||||
type == PARTIGUN3 ) // suiciding spider?
|
||||
|
@ -3796,7 +3796,7 @@ CObject* CParticle::SearchObjectRay(Math::Vector pos, Math::Vector goal,
|
|||
oType != OBJECT_MOTHER &&
|
||||
oType != OBJECT_NEST ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
|
||||
if ( oPos.x < box1.x || oPos.x > box2.x || // outside the box?
|
||||
oPos.y < box1.y || oPos.y > box2.y ||
|
||||
|
|
|
@ -82,7 +82,7 @@ bool CPyro::Create(PyroType type, CObject* obj, float force)
|
|||
|
||||
Math::Vector min, max;
|
||||
m_engine->GetObjectBBox(objRank, min, max);
|
||||
Math::Vector pos = obj->GetPosition(0);
|
||||
Math::Vector pos = obj->GetPosition();
|
||||
|
||||
DisplayError(type, obj); // displays eventual messages
|
||||
|
||||
|
@ -132,7 +132,7 @@ bool CPyro::Create(PyroType type, CObject* obj, float force)
|
|||
else
|
||||
{
|
||||
m_power = true;
|
||||
pos = power->GetPosition(0);
|
||||
pos = power->GetPosition();
|
||||
pos.y += 1.0f;
|
||||
Math::Matrix* mat = obj->GetWorldMatrix(0);
|
||||
m_posPower = Math::Transform(*mat, pos);
|
||||
|
@ -618,7 +618,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
|
||||
if (m_soundChannel != -1 && m_object != nullptr)
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
m_sound->Position(m_soundChannel, pos);
|
||||
|
||||
if (m_lightRank != -1)
|
||||
|
@ -896,7 +896,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
|
||||
if(m_object != nullptr)
|
||||
{
|
||||
Math::Vector angle = m_object->GetAngle(0);
|
||||
Math::Vector angle = m_object->GetRotation();
|
||||
angle.y = m_progress*20.0f;
|
||||
angle.x = sinf(m_progress*49.0f)*0.3f;
|
||||
angle.z = sinf(m_progress*47.0f)*0.2f;
|
||||
|
@ -935,7 +935,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
|
||||
if(m_object != nullptr)
|
||||
{
|
||||
Math::Vector angle = m_object->GetAngle(0);
|
||||
Math::Vector angle = m_object->GetRotation();
|
||||
angle.x = sinf(m_progress*49.0f)*0.3f*(1.0f-m_progress);
|
||||
angle.z = sinf(m_progress*47.0f)*0.2f*(1.0f-m_progress);
|
||||
m_object->SetAngle(0, angle);
|
||||
|
@ -966,7 +966,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
|
||||
if(m_object != nullptr)
|
||||
{
|
||||
Math::Vector angle = m_object->GetAngle(0);
|
||||
Math::Vector angle = m_object->GetRotation();
|
||||
angle.y = m_progress*20.0f;
|
||||
angle.x = sinf(m_progress*49.0f)*0.3f;
|
||||
angle.z = sinf(m_progress*47.0f)*0.2f;
|
||||
|
@ -1050,7 +1050,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
|
||||
float factor = m_size/25.0f; // 1 = standard size
|
||||
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
pos.y -= m_object->GetCharacter()->height;
|
||||
pos.x += (Math::Rand()-0.5f)*(4.0f+8.0f*m_progress)*factor;
|
||||
pos.z += (Math::Rand()-0.5f)*(4.0f+8.0f*m_progress)*factor;
|
||||
|
@ -1063,7 +1063,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, PARTIFLAME, 2.0f, 0.0f, 0.2f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y -= m_object->GetCharacter()->height;
|
||||
pos.x += (Math::Rand()-0.5f)*(2.0f+4.0f*m_progress)*factor;
|
||||
pos.z += (Math::Rand()-0.5f)*(2.0f+4.0f*m_progress)*factor;
|
||||
|
@ -1074,7 +1074,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, PARTIFLAME, 2.0f, 0.0f, 0.2f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y -= 2.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*5.0f*factor;
|
||||
pos.z += (Math::Rand()-0.5f)*5.0f*factor;
|
||||
|
@ -1113,7 +1113,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
pos.y += 1.5f;
|
||||
Math::Vector speed;
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
|
@ -1135,7 +1135,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
pos.y -= 2.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*10.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*10.0f;
|
||||
|
@ -1306,7 +1306,7 @@ void CPyro::DisplayError(PyroType type, CObject* obj)
|
|||
oType == OBJECT_END )
|
||||
{
|
||||
err = ERR_DELETEBUILDING;
|
||||
m_main->DisplayError(err, obj->GetPosition(0), 5.0f);
|
||||
m_main->DisplayError(err, obj->GetPosition(), 5.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1350,7 +1350,7 @@ void CPyro::DeleteObject(bool primary, bool secondary)
|
|||
if (m_object->GetResetCap() == RESET_MOVE) // resettable object?
|
||||
{
|
||||
m_object->SetEnable(false); // object cache and inactive
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
pos.y = -100.0f;
|
||||
m_object->SetPosition(0, pos);
|
||||
return;
|
||||
|
@ -1548,7 +1548,7 @@ void CPyro::ExploStart()
|
|||
{
|
||||
m_burnType = m_object->GetType();
|
||||
|
||||
Math::Vector oPos = m_object->GetPosition(0);
|
||||
Math::Vector oPos = m_object->GetPosition();
|
||||
m_burnFall = m_terrain->GetHeightToFloor(oPos, true);
|
||||
|
||||
m_object->Simplify();
|
||||
|
@ -1621,7 +1621,7 @@ void CPyro::BurnStart()
|
|||
{
|
||||
m_burnType = m_object->GetType();
|
||||
|
||||
Math::Vector oPos = m_object->GetPosition(0);
|
||||
Math::Vector oPos = m_object->GetPosition();
|
||||
m_burnFall = m_terrain->GetHeightToFloor(oPos, true);
|
||||
|
||||
m_object->Simplify();
|
||||
|
@ -2191,7 +2191,7 @@ void CPyro::FallStart()
|
|||
{
|
||||
m_object->SetBurn(true); // usable
|
||||
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
m_fallFloor = m_terrain->GetFloorLevel(pos);
|
||||
m_fallSpeed = 0.0f;
|
||||
m_fallBulletTime = 0.0f;
|
||||
|
@ -2256,7 +2256,7 @@ CObject* CPyro::FallSearchBeeExplo()
|
|||
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
|
||||
float shieldRadius = obj->GetShieldRadius();
|
||||
if ( shieldRadius > 0.0f )
|
||||
|
@ -2298,7 +2298,7 @@ void CPyro::FallProgress(float rTime)
|
|||
|
||||
m_fallSpeed += rTime*50.0f; // v2 = v1 + a*dt
|
||||
Math::Vector pos;
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y -= m_fallSpeed*rTime; // dd -= v2*dt
|
||||
|
||||
bool floor = false;
|
||||
|
@ -2361,7 +2361,7 @@ Error CPyro::FallIsEnded()
|
|||
{
|
||||
if (m_fallEnding || m_object == 0) return ERR_STOP;
|
||||
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
if (pos.y > m_fallFloor) return ERR_CONTINUE;
|
||||
|
||||
m_sound->Play(SOUND_BOUM, pos);
|
||||
|
|
|
@ -94,7 +94,7 @@ void CAutoBase::Init()
|
|||
m_lastParticle = 0.0f;
|
||||
m_lastMotorParticle = 0.0f;
|
||||
|
||||
m_pos = m_object->GetPosition(0);
|
||||
m_pos = m_object->GetPosition();
|
||||
m_lastPos = m_pos;
|
||||
|
||||
m_phase = ABP_WAIT;
|
||||
|
@ -132,7 +132,7 @@ bool CAutoBase::EventProcess(const Event &event)
|
|||
if ( m_engine->GetPause() ) return true;
|
||||
|
||||
begin:
|
||||
iPos = m_object->GetPosition(0);
|
||||
iPos = m_object->GetPosition();
|
||||
|
||||
if ( m_phase == ABP_START )
|
||||
{
|
||||
|
@ -207,7 +207,7 @@ begin:
|
|||
m_camera->SetScriptEye(pos);
|
||||
m_posSound = pos;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 300.0f+50.0f;
|
||||
m_camera->SetScriptLookat(pos);
|
||||
|
||||
|
@ -228,7 +228,7 @@ begin:
|
|||
|
||||
if ( m_param == PARAM_PORTICO ) // gate on the porch?
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_finalPos = pos;
|
||||
pos.z += BASE_PORTICO_TIME_MOVE*5.0f; // back
|
||||
pos.y += 10.0f; // rises (the gate)
|
||||
|
@ -251,7 +251,7 @@ begin:
|
|||
m_speed = 1.0f/BASE_TRANSIT_TIME;
|
||||
|
||||
m_object->SetAngleZ(0, -Math::PI/2.0f);
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 10000.0f; // in space
|
||||
m_finalPos = pos;
|
||||
m_object->SetPosition(0, pos);
|
||||
|
@ -348,7 +348,7 @@ begin:
|
|||
pos.y += 10.0f;
|
||||
m_camera->SetScriptEye(pos);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 50.0f;
|
||||
m_camera->SetScriptLookat(pos);
|
||||
|
||||
|
@ -376,7 +376,7 @@ begin:
|
|||
}
|
||||
|
||||
// Particles are ejected from the jet engine.
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 6.0f;
|
||||
h = m_terrain->GetHeightToFloor(pos)/300.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*(80.0f-50.0f*h);
|
||||
|
@ -596,7 +596,7 @@ begin:
|
|||
m_camera->SetType(pObj->GetCameraType());
|
||||
m_camera->SetDist(pObj->GetCameraDist());
|
||||
}
|
||||
m_sound->Play(SOUND_BOUM, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_BOUM, m_object->GetPosition());
|
||||
m_soundChannel = -1;
|
||||
|
||||
m_engine->SetFogStart(m_fogStart);
|
||||
|
@ -677,7 +677,7 @@ begin:
|
|||
time = Math::Rand()*1.0f+1.0f;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, time);
|
||||
}
|
||||
m_sound->Play(SOUND_BOUM, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_BOUM, m_object->GetPosition());
|
||||
|
||||
m_soundChannel = -1;
|
||||
m_bOpen = false;
|
||||
|
@ -709,7 +709,7 @@ begin:
|
|||
m_lastParticle = m_time;
|
||||
|
||||
// Particles are ejected from the reactor.
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 6.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*160.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*160.0f;
|
||||
|
@ -751,7 +751,7 @@ begin:
|
|||
pos.y += 10.0f;
|
||||
m_camera->SetScriptEye(pos);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 50.0f;
|
||||
m_camera->SetScriptLookat(pos);
|
||||
|
||||
|
@ -779,7 +779,7 @@ begin:
|
|||
}
|
||||
|
||||
// Particles are ejected from the reactor.
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 6.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*40.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*40.0f;
|
||||
|
@ -791,7 +791,7 @@ begin:
|
|||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGAS, 2.0f, 10.0f, 2.0f);
|
||||
|
||||
// Black smoke from the reactor.
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 3.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f*(4.0f-m_progress*3.0f);
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f*(4.0f-m_progress*3.0f);
|
||||
|
@ -817,7 +817,7 @@ begin:
|
|||
{
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.z -= event.rTime*5.0f;
|
||||
m_object->SetPosition(0, pos);
|
||||
MoveCargo(); // all cargo moves
|
||||
|
@ -844,7 +844,7 @@ begin:
|
|||
{
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y -= event.rTime*(10.0f/BASE_PORTICO_TIME_DOWN);
|
||||
m_object->SetPosition(0, pos);
|
||||
MoveCargo(); // all cargo moves
|
||||
|
@ -900,7 +900,7 @@ begin:
|
|||
{
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += event.rTime*(2000.0f/BASE_TRANSIT_TIME);
|
||||
m_object->SetPosition(0, pos);
|
||||
pos.x += 60.0f;
|
||||
|
@ -941,7 +941,7 @@ begin:
|
|||
}
|
||||
else
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( m_phase == ABP_TRANSIT_MOVE )
|
||||
{
|
||||
vSpeed = (pos.x-iPos.x)/event.rTime;
|
||||
|
@ -1269,13 +1269,13 @@ void CAutoBase::FreezeCargo(bool freeze)
|
|||
|
||||
void CAutoBase::MoveCargo()
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition(0);
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
if ( !obj->IsSpaceshipCargo() ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
oPos.y = sPos.y+30.0f;
|
||||
oPos.y += obj->GetCharacter()->height;
|
||||
oPos.x += sPos.x-m_lastPos.x;
|
||||
|
@ -1412,7 +1412,7 @@ Error CAutoBase::TakeOff(bool printMsg)
|
|||
m_camera->SetScriptEye(pos);
|
||||
m_posSound = pos;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 50.0f;
|
||||
m_camera->SetScriptLookat(pos);
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
InitProgressTotal(3.0f+10.0f+1.5f);
|
||||
UpdateInterface();
|
||||
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.0f);
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(), 1.0f, 1.0f);
|
||||
m_bSoundClose = false;
|
||||
|
||||
m_phase = ACP_CLOSE;
|
||||
|
@ -164,7 +164,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
if ( m_progress >= 0.8f && !m_bSoundClose )
|
||||
{
|
||||
m_bSoundClose = true;
|
||||
m_sound->Play(SOUND_CLOSE, m_object->GetPosition(0), 1.0f, 0.8f);
|
||||
m_sound->Play(SOUND_CLOSE, m_object->GetPosition(), 1.0f, 0.8f);
|
||||
}
|
||||
angle = -Math::PI*0.35f*(1.0f-Math::Bounce(m_progress, 0.85f, 0.05f));
|
||||
m_object->SetAngleX(2, angle);
|
||||
|
@ -175,7 +175,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
m_object->SetAngleX(2, 0.0f);
|
||||
m_object->SetAngleX(3, 0.0f);
|
||||
|
||||
m_soundChannel = m_sound->Play(SOUND_CONVERT, m_object->GetPosition(0), 0.0f, 0.25f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_CONVERT, m_object->GetPosition(), 0.0f, 0.25f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.25f, 0.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.00f, 4.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.25f, 4.5f, SOPER_CONTINUE);
|
||||
|
@ -207,7 +207,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
c.x = pos.x;
|
||||
c.y = pos.z;
|
||||
p.x = c.x;
|
||||
|
@ -237,7 +237,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
}
|
||||
|
||||
CreateMetal(); // Create the metal
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.5f);
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(), 1.0f, 1.5f);
|
||||
|
||||
m_phase = ACP_OPEN;
|
||||
m_progress = 0.0f;
|
||||
|
@ -258,7 +258,7 @@ bool CAutoConvert::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*6.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*6.0f;
|
||||
pos.y += Math::Rand()*4.0f;
|
||||
|
@ -394,7 +394,7 @@ bool CAutoConvert::Read(CLevelParserLine* line)
|
|||
|
||||
CObject* CAutoConvert::SearchStone(ObjectType type)
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -402,7 +402,7 @@ CObject* CAutoConvert::SearchStone(ObjectType type)
|
|||
if ( oType != type ) continue;
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, cPos);
|
||||
|
||||
if ( dist <= 5.0f ) return obj;
|
||||
|
@ -415,7 +415,7 @@ CObject* CAutoConvert::SearchStone(ObjectType type)
|
|||
|
||||
bool CAutoConvert::SearchVehicle()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -475,7 +475,7 @@ bool CAutoConvert::SearchVehicle()
|
|||
|
||||
void CAutoConvert::CreateMetal()
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
float angle = m_object->GetAngleY(0);
|
||||
|
||||
CObject* cargo = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, OBJECT_METAL);
|
||||
|
|
|
@ -90,7 +90,7 @@ void CAutoDerrick::Init()
|
|||
Math::Vector pos;
|
||||
Gfx::TerrainRes res;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
res = m_terrain->GetResource(pos);
|
||||
|
||||
if ( res == Gfx::TR_STONE ||
|
||||
|
@ -178,7 +178,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
{
|
||||
factor = 1.0f;
|
||||
}
|
||||
m_soundChannel = m_sound->Play(SOUND_DERRICK, m_object->GetPosition(0), 1.0f, 0.5f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_DERRICK, m_object->GetPosition(), 1.0f, 0.5f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.5f, 4.0f*factor, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.3f, 6.0f*factor, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.5f, 1.0f, SOPER_CONTINUE);
|
||||
|
@ -190,7 +190,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.y = Math::Rand()*5.0f;
|
||||
|
@ -204,7 +204,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastTrack = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*12.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*12.0f;
|
||||
speed.y = Math::Rand()*10.0f+10.0f;
|
||||
|
@ -243,7 +243,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.y = Math::Rand()*5.0f;
|
||||
|
@ -257,7 +257,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastTrack = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*12.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*12.0f;
|
||||
speed.y = Math::Rand()*10.0f+10.0f;
|
||||
|
@ -332,7 +332,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
|
||||
if ( m_progress < 0.3f )
|
||||
{
|
||||
pos = cargo->GetPosition(0);
|
||||
pos = cargo->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.y += (Math::Rand()-0.5f)*5.0f;
|
||||
|
@ -343,7 +343,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
pos = cargo->GetPosition(0);
|
||||
pos = cargo->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.y += Math::Rand()*2.5f;
|
||||
|
@ -358,7 +358,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
{
|
||||
if ( cargo != 0 )
|
||||
{
|
||||
pos = cargo->GetPosition(0);
|
||||
pos = cargo->GetPosition();
|
||||
pos.y -= event.rTime*20.0f; // grave
|
||||
if ( !m_bSoundFall && pos.y < m_cargoPos.y )
|
||||
{
|
||||
|
@ -465,7 +465,7 @@ CObject* CAutoDerrick::SearchCargo()
|
|||
ObjectType type = obj->GetType();
|
||||
if ( type == OBJECT_DERRICK ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
|
||||
if ( oPos.x == m_cargoPos.x &&
|
||||
oPos.z == m_cargoPos.z ) return obj;
|
||||
|
@ -510,7 +510,7 @@ void CAutoDerrick::CreateCargo(Math::Vector pos, float angle, ObjectType type,
|
|||
cargo->SetResetCap(RESET_DELETE);
|
||||
}
|
||||
|
||||
pos = cargo->GetPosition(0);
|
||||
pos = cargo->GetPosition();
|
||||
pos.y += height;
|
||||
cargo->SetPosition(0, pos);
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ Error CAutoDestroyer::StartAction(int param)
|
|||
scrap->SetLock(true); // usable waste
|
||||
//? scrap->SetTransporter(m_object); // usable waste
|
||||
|
||||
m_sound->Play(SOUND_PSHHH2, m_object->GetPosition(0), 1.0f, 1.0f);
|
||||
m_sound->Play(SOUND_PSHHH2, m_object->GetPosition(), 1.0f, 1.0f);
|
||||
|
||||
m_phase = ADEP_DOWN;
|
||||
m_progress = 0.0f;
|
||||
|
@ -183,7 +183,7 @@ bool CAutoDestroyer::EventProcess(const Event &event)
|
|||
else
|
||||
{
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, -10.0f, 0.0f));
|
||||
m_sound->Play(SOUND_REPAIR, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_REPAIR, m_object->GetPosition());
|
||||
|
||||
m_phase = ADEP_REPAIR;
|
||||
m_progress = 0.0f;
|
||||
|
@ -198,7 +198,7 @@ bool CAutoDestroyer::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 0.8f);
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(), 1.0f, 0.8f);
|
||||
|
||||
m_phase = ADEP_UP;
|
||||
m_progress = 0.0f;
|
||||
|
@ -272,7 +272,7 @@ bool CAutoDestroyer::CreateInterface(bool bSelect)
|
|||
|
||||
CObject* CAutoDestroyer::SearchPlastic()
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition(0);
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -327,7 +327,7 @@ CObject* CAutoDestroyer::SearchPlastic()
|
|||
type != OBJECT_WORM ) continue;
|
||||
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, sPos);
|
||||
if ( dist <= 5.0f ) return obj;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ void CAutoEgg::DeleteObject(bool all)
|
|||
if ( alien != nullptr )
|
||||
{
|
||||
// Probably the intended action
|
||||
// Original code: ( alien->GetZoom(0) == 1.0f )
|
||||
// Original code: ( alien->GetScale() == 1.0f )
|
||||
if ( alien->GetZoomY(0) == 1.0f )
|
||||
{
|
||||
alien->SetLock(false);
|
||||
|
@ -178,7 +178,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(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
float angle = m_object->GetAngleY(0);
|
||||
CObject* alien = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, m_type);
|
||||
|
||||
|
@ -274,7 +274,7 @@ Error CAutoEgg::GetError()
|
|||
|
||||
CObject* CAutoEgg::SearchAlien()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
float min = 100000.0f;
|
||||
CObject* best = nullptr;
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
|
@ -287,7 +287,7 @@ CObject* CAutoEgg::SearchAlien()
|
|||
type != OBJECT_SPIDER &&
|
||||
type != OBJECT_WORM ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist < 8.0f && dist < min )
|
||||
{
|
||||
|
|
|
@ -102,7 +102,7 @@ void CAutoFactory::Init()
|
|||
m_time = 0.0f;
|
||||
m_lastParticle = 0.0f;
|
||||
|
||||
m_cargoPos = m_object->GetPosition(0);
|
||||
m_cargoPos = m_object->GetPosition();
|
||||
|
||||
m_program = nullptr;
|
||||
|
||||
|
@ -280,7 +280,7 @@ bool CAutoFactory::EventProcess(const Event &event)
|
|||
m_object->SetAngleZ(10+i, 0.0f);
|
||||
}
|
||||
|
||||
m_channelSound = m_sound->Play(SOUND_FACTORY, m_object->GetPosition(0), 0.0f, 1.0f, true);
|
||||
m_channelSound = m_sound->Play(SOUND_FACTORY, m_object->GetPosition(), 0.0f, 1.0f, true);
|
||||
m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, 2.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, 11.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_channelSound, 0.0f, 1.0f, 2.0f, SOPER_STOP);
|
||||
|
@ -539,7 +539,7 @@ bool CAutoFactory::Read(CLevelParserLine* line)
|
|||
m_speed = line->GetParam("aSpeed")->AsFloat(1.0f);
|
||||
|
||||
m_lastParticle = 0.0f;
|
||||
m_cargoPos = m_object->GetPosition(0);
|
||||
m_cargoPos = m_object->GetPosition();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -555,7 +555,7 @@ CObject* CAutoFactory::SearchCargo()
|
|||
if ( type != OBJECT_METAL ) continue;
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, m_cargoPos);
|
||||
|
||||
if ( dist < 8.0f ) return obj;
|
||||
|
@ -568,7 +568,7 @@ CObject* CAutoFactory::SearchCargo()
|
|||
|
||||
bool CAutoFactory::NearestVehicle()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -679,7 +679,7 @@ CObject* CAutoFactory::SearchVehicle()
|
|||
if ( type != m_type ) continue;
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, m_cargoPos);
|
||||
|
||||
if ( dist < 8.0f ) return obj;
|
||||
|
@ -931,7 +931,7 @@ void CAutoFactory::SoundManip(float time, float amplitude, float frequency)
|
|||
{
|
||||
int i;
|
||||
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f*frequency, true);
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.3f*frequency, true);
|
||||
m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, 0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, time-0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.0f, 0.3f*frequency, 0.1f, SOPER_STOP);
|
||||
|
|
|
@ -38,7 +38,7 @@ CAutoHouston::CAutoHouston(CObject* object) : CAuto(object)
|
|||
m_lens[i].parti = -1;
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_lens[0].type = Gfx::PARTISELR;
|
||||
m_lens[1].type = Gfx::PARTISELR;
|
||||
m_lens[2].type = Gfx::PARTISELR;
|
||||
|
|
|
@ -268,7 +268,7 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
{
|
||||
m_object->SetAngleZ(1, 0.0f);
|
||||
|
||||
goal = m_object->GetPosition(0);
|
||||
goal = m_object->GetPosition();
|
||||
goal.y += 3.0f;
|
||||
pos = goal;
|
||||
pos.x -= 4.0f;
|
||||
|
@ -281,13 +281,13 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
LABO_DELAY);
|
||||
}
|
||||
|
||||
m_soundChannel = m_sound->Play(SOUND_LABO, m_object->GetPosition(0), 0.0f, 0.25f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_LABO, m_object->GetPosition(), 0.0f, 0.25f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.60f, 2.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 2.00f, 8.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 0.60f, 8.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.25f, 2.0f, SOPER_STOP);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 4.0f;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 4.0f;
|
||||
|
@ -326,7 +326,7 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
for ( i=0 ; i<3 ; i++ )
|
||||
{
|
||||
rot = Math::RotatePoint(-angle, -4.0f);
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += rot.x;
|
||||
pos.z += rot.y;
|
||||
pos.y += 3.0f+4.0f;;
|
||||
|
@ -342,7 +342,7 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
if ( m_progress > 0.25f &&
|
||||
m_progress < 0.80f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 3.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*2.0f;
|
||||
|
@ -576,7 +576,7 @@ void CAutoLabo::SoundManip(float time, float amplitude, float frequency)
|
|||
{
|
||||
int i;
|
||||
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f*frequency, true);
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.3f*frequency, true);
|
||||
m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, 0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, time-0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.0f, 0.3f*frequency, 0.1f, SOPER_STOP);
|
||||
|
|
|
@ -126,7 +126,7 @@ bool CAutoMush::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_sound->Play(SOUND_MUSHROOM, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_MUSHROOM, m_object->GetPosition());
|
||||
|
||||
m_phase = AMP_FIRE;
|
||||
m_progress = 0.0f;
|
||||
|
@ -147,7 +147,7 @@ bool CAutoMush::EventProcess(const Event &event)
|
|||
|
||||
for ( i=0 ; i<10 ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 5.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*200.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*200.0f;
|
||||
|
@ -175,7 +175,7 @@ bool CAutoMush::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 5.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*4.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*4.0f;
|
||||
|
@ -224,7 +224,7 @@ bool CAutoMush::EventProcess(const Event &event)
|
|||
|
||||
bool CAutoMush::SearchTarget()
|
||||
{
|
||||
Math::Vector iPos = m_object->GetPosition(0);
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -274,7 +274,7 @@ bool CAutoMush::SearchTarget()
|
|||
type != OBJECT_PARA &&
|
||||
type != OBJECT_HUMAN ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, iPos);
|
||||
if ( dist < 50.0f ) return true;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ void CAutoNest::Init()
|
|||
m_time = 0.0f;
|
||||
m_lastParticle = 0.0f;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_terrain->AdjustToFloor(pos);
|
||||
m_cargoPos = pos;
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ CObject* CAutoNest::SearchCargo()
|
|||
ObjectType type = obj->GetType();
|
||||
if ( type != OBJECT_BULLET ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
if ( oPos.x == m_cargoPos.x &&
|
||||
oPos.z == m_cargoPos.z )
|
||||
{
|
||||
|
|
|
@ -152,7 +152,7 @@ bool CAutoNuclearPlant::EventProcess(const Event &event)
|
|||
InitProgressTotal(1.5f+NUCLEARPLANT_DELAY+1.5f);
|
||||
UpdateInterface();
|
||||
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.4f);
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(), 1.0f, 1.4f);
|
||||
|
||||
m_phase = ANUP_CLOSE;
|
||||
m_progress = 0.0f;
|
||||
|
@ -188,9 +188,9 @@ bool CAutoNuclearPlant::EventProcess(const Event &event)
|
|||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH);
|
||||
}
|
||||
|
||||
m_sound->Play(SOUND_CLOSE, m_object->GetPosition(0), 1.0f, 1.0f);
|
||||
m_sound->Play(SOUND_CLOSE, m_object->GetPosition(), 1.0f, 1.0f);
|
||||
|
||||
m_channelSound = m_sound->Play(SOUND_NUCLEAR, m_object->GetPosition(0), 1.0f, 0.1f, true);
|
||||
m_channelSound = m_sound->Play(SOUND_NUCLEAR, m_object->GetPosition(), 1.0f, 0.1f, true);
|
||||
m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, NUCLEARPLANT_DELAY-1.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_channelSound, 0.0f, 1.0f, 2.0f, SOPER_STOP);
|
||||
|
||||
|
@ -208,7 +208,7 @@ bool CAutoNuclearPlant::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 30.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*6.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*6.0f;
|
||||
|
@ -254,7 +254,7 @@ bool CAutoNuclearPlant::EventProcess(const Event &event)
|
|||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLUE, Math::Rand()*5.0f+5.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 1.4f);
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(), 1.0f, 1.4f);
|
||||
|
||||
m_phase = ANUP_OPEN;
|
||||
m_progress = 0.0f;
|
||||
|
@ -383,7 +383,7 @@ bool CAutoNuclearPlant::SearchVehicle()
|
|||
|
||||
void CAutoNuclearPlant::CreatePower()
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
float angle = m_object->GetAngleY(0);
|
||||
|
||||
float powerLevel = 1.0f;
|
||||
|
@ -406,7 +406,7 @@ Error CAutoNuclearPlant::GetError()
|
|||
return ERR_BAT_VIRUS;
|
||||
}
|
||||
|
||||
//? res = m_terrain->GetResource(m_object->GetPosition(0));
|
||||
//? res = m_terrain->GetResource(m_object->GetPosition());
|
||||
//? if ( res != TR_POWER ) return ERR_NUCLEAR_NULL;
|
||||
|
||||
//? if ( m_object->GetEnergy() < ENERGY_POWER ) return ERR_NUCLEAR_LOW;
|
||||
|
|
|
@ -109,7 +109,7 @@ void CAutoPortico::Start(int param)
|
|||
{
|
||||
Math::Vector pos;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_finalPos = pos;
|
||||
pos.z += PORTICO_TIME_MOVE*5.0f; // back to start
|
||||
m_object->SetPosition(0, pos);
|
||||
|
@ -147,9 +147,9 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_param == PARAM_DEPOSE ) // deposits the ship?
|
||||
{
|
||||
m_startPos = m_object->GetPosition(0);
|
||||
m_startPos = m_object->GetPosition();
|
||||
|
||||
m_soundChannel = m_sound->Play(SOUND_MOTORr, m_object->GetPosition(0), 0.0f, 0.3f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_MOTORr, m_object->GetPosition(), 0.0f, 0.3f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.5f, 0.6f, 0.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.5f, 0.6f, PORTICO_TIME_MOVE-0.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.3f, 0.5f, SOPER_STOP);
|
||||
|
@ -168,7 +168,7 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
pos.z += -200.0f;
|
||||
m_camera->SetScriptEye(pos);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += 0.0f;
|
||||
pos.y += 10.0f;
|
||||
pos.z += -40.0f;
|
||||
|
@ -198,7 +198,7 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.z -= event.rTime*5.0f; // advance
|
||||
m_object->SetPosition(0, pos);
|
||||
|
||||
|
@ -217,7 +217,7 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress >= 1.0f )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.3f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.3f, 0.5f, 1.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.3f, 0.6f, PORTICO_TIME_DOWN-1.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.3f, 1.0f, SOPER_STOP);
|
||||
|
@ -254,12 +254,12 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress >= 1.0f )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.5f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.5f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.5f, 1.0f, 0.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.5f, 1.0f, PORTICO_TIME_OPEN/2.0f-0.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 0.5f, SOPER_STOP);
|
||||
|
||||
m_soundChannel = m_sound->Play(SOUND_MOTORr, m_object->GetPosition(0), 0.0f, 0.3f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_MOTORr, m_object->GetPosition(), 0.0f, 0.3f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.5f, 0.6f, 0.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.5f, 0.6f, PORTICO_TIME_OPEN-0.5f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.3f, 0.5f, SOPER_STOP);
|
||||
|
@ -274,7 +274,7 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress < 1.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.z += event.rTime*5.3f; // back
|
||||
m_object->SetPosition(0, pos);
|
||||
|
||||
|
@ -320,7 +320,7 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
|
||||
if ( m_soundChannel != -1 )
|
||||
{
|
||||
//? m_sound->Position(m_soundChannel, m_object->GetPosition(0));
|
||||
//? m_sound->Position(m_soundChannel, m_object->GetPosition());
|
||||
pos = m_engine->GetEyePt();
|
||||
m_sound->Position(m_soundChannel, pos);
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
m_camera->SetScriptEye(pos);
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += 0.0f;
|
||||
pos.y += 10.0f;
|
||||
pos.z += -40.0f;
|
||||
|
|
|
@ -136,7 +136,7 @@ bool CAutoPowerCaptor::EventProcess(const Event &event)
|
|||
|
||||
for ( i=0 ; i<10 ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*m_progress*40.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*m_progress*40.0f;
|
||||
pos.y += 50.0f-m_progress*50.0f;
|
||||
|
@ -167,7 +167,7 @@ bool CAutoPowerCaptor::EventProcess(const Event &event)
|
|||
|
||||
for ( i=0 ; i<2 ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 16.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||
|
@ -244,11 +244,11 @@ Error CAutoPowerCaptor::GetError()
|
|||
|
||||
void CAutoPowerCaptor::ChargeObject(float rTime)
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition(0);
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, sPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time )
|
||||
{
|
||||
m_lastParticle = m_time;
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 10.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||
|
@ -154,7 +154,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
|
||||
big = m_object->GetEnergy();
|
||||
|
||||
res = m_terrain->GetResource(m_object->GetPosition(0));
|
||||
res = m_terrain->GetResource(m_object->GetPosition());
|
||||
if ( res == Gfx::TR_POWER )
|
||||
{
|
||||
big += event.rTime*0.01f; // recharges the big pile
|
||||
|
@ -190,7 +190,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
InitProgressTotal(POWERPLANT_DELAY);
|
||||
CAuto::UpdateInterface();
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 4.0f;
|
||||
speed = Math::Vector(0.0f, 0.0f, 0.0f);
|
||||
dim.x = 3.0f;
|
||||
|
@ -226,7 +226,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
if ( m_lastParticle+m_engine->ParticleAdapt(0.05f) <= m_time )
|
||||
{
|
||||
m_lastParticle = m_time;
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 10.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*1.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*1.0f;
|
||||
|
@ -272,7 +272,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
c.x = pos.x;
|
||||
c.y = pos.z;
|
||||
p.x = c.x;
|
||||
|
@ -286,7 +286,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIGLINT, 1.0f, 0.0f, 0.0f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 3.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*30.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*30.0f;
|
||||
|
@ -295,7 +295,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
dim.y = dim.x;
|
||||
m_particle->CreateTrack(pos, speed, dim, Gfx::PARTITRACK2, 2.0f, 50.0f, 1.2f, 1.2f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 10.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*1.5f;
|
||||
speed.z = (Math::Rand()-0.5f)*1.5f;
|
||||
|
@ -304,7 +304,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFIREZ, 1.0f, 0.0f, 0.0f);
|
||||
|
||||
m_sound->Play(SOUND_ENERGY, m_object->GetPosition(0),
|
||||
m_sound->Play(SOUND_ENERGY, m_object->GetPosition(),
|
||||
1.0f, 1.0f+Math::Rand()*1.5f);
|
||||
}
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 17.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*3.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*3.0f;
|
||||
|
@ -396,7 +396,7 @@ CObject* CAutoPowerPlant::SearchMetal()
|
|||
|
||||
bool CAutoPowerPlant::SearchVehicle()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -449,13 +449,13 @@ bool CAutoPowerPlant::SearchVehicle()
|
|||
|
||||
void CAutoPowerPlant::CreatePower()
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
float angle = m_object->GetAngleY(0);
|
||||
float powerLevel = 1.0f;
|
||||
CObject* power = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, OBJECT_POWER, powerLevel);
|
||||
power->SetLock(true); // battery not yet usable
|
||||
|
||||
pos = power->GetPosition(0);
|
||||
pos = power->GetPosition();
|
||||
pos.y += 3.0f;
|
||||
power->SetPosition(0, pos);
|
||||
}
|
||||
|
@ -464,7 +464,7 @@ void CAutoPowerPlant::CreatePower()
|
|||
|
||||
CObject* CAutoPowerPlant::SearchPower()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -473,7 +473,7 @@ CObject* CAutoPowerPlant::SearchPower()
|
|||
ObjectType type = obj->GetType();
|
||||
if ( type != OBJECT_POWER ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
if ( oPos.x == cPos.x &&
|
||||
oPos.z == cPos.z )
|
||||
{
|
||||
|
@ -497,7 +497,7 @@ Error CAutoPowerPlant::GetError()
|
|||
if ( m_phase != AENP_WAIT &&
|
||||
m_phase != AENP_BLITZ ) return ERR_OK;
|
||||
|
||||
Gfx::TerrainRes res = m_terrain->GetResource(m_object->GetPosition(0));
|
||||
Gfx::TerrainRes res = m_terrain->GetResource(m_object->GetPosition());
|
||||
if ( res != Gfx::TR_POWER ) return ERR_ENERGY_NULL;
|
||||
|
||||
if ( m_object->GetEnergy() < POWERPLANT_POWER ) return ERR_ENERGY_LOW;
|
||||
|
|
|
@ -119,7 +119,7 @@ bool CAutoPowerStation::EventProcess(const Event &event)
|
|||
|
||||
float big = m_object->GetEnergy();
|
||||
|
||||
Gfx::TerrainRes res = m_terrain->GetResource(m_object->GetPosition(0));
|
||||
Gfx::TerrainRes res = m_terrain->GetResource(m_object->GetPosition());
|
||||
if ( res == Gfx::TR_POWER )
|
||||
{
|
||||
big += event.rTime*0.01f; // recharges the large battery
|
||||
|
@ -172,7 +172,7 @@ bool CAutoPowerStation::EventProcess(const Event &event)
|
|||
freq = 1.0f+3.0f*freq;
|
||||
if ( m_soundChannel == -1 )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(SOUND_STATION, m_object->GetPosition(0),
|
||||
m_soundChannel = m_sound->Play(SOUND_STATION, m_object->GetPosition(),
|
||||
0.3f, freq, true);
|
||||
}
|
||||
m_sound->Frequency(m_soundChannel, freq);
|
||||
|
@ -244,7 +244,7 @@ bool CAutoPowerStation::EventProcess(const Event &event)
|
|||
|
||||
CObject* CAutoPowerStation::SearchVehicle()
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition(0);
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -277,7 +277,7 @@ CObject* CAutoPowerStation::SearchVehicle()
|
|||
type != OBJECT_MOBILEit &&
|
||||
type != OBJECT_MOBILEdr ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, sPos);
|
||||
if ( dist <= 5.0f ) return obj;
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ Error CAutoPowerStation::GetError()
|
|||
return ERR_BAT_VIRUS;
|
||||
}
|
||||
|
||||
res = m_terrain->GetResource(m_object->GetPosition(0));
|
||||
res = m_terrain->GetResource(m_object->GetPosition());
|
||||
if ( res != Gfx::TR_POWER ) return ERR_STATION_NULL;
|
||||
|
||||
return ERR_OK;
|
||||
|
|
|
@ -127,7 +127,7 @@ bool CAutoRadar::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_start = m_object->GetAngleY(1);
|
||||
m_angle = m_start-Math::NormAngle(m_start)+Math::PI*2.0f;
|
||||
m_angle += Math::RotateAngle(pos.x-ePos.x, ePos.z-pos.z);
|
||||
|
@ -149,7 +149,7 @@ bool CAutoRadar::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_sound->Play(SOUND_RADAR, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_RADAR, m_object->GetPosition());
|
||||
|
||||
m_phase = ARAP_SINUS;
|
||||
m_progress = 0.0f;
|
||||
|
@ -264,7 +264,7 @@ void CAutoRadar::UpdateInterface()
|
|||
|
||||
bool CAutoRadar::SearchEnemy(Math::Vector &pos)
|
||||
{
|
||||
Math::Vector iPos = m_object->GetPosition(0);
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
float min = 1000000.0f;
|
||||
m_totalDetect = 0;
|
||||
|
||||
|
@ -282,7 +282,7 @@ bool CAutoRadar::SearchEnemy(Math::Vector &pos)
|
|||
|
||||
m_totalDetect ++;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float distance = Math::Distance(oPos, iPos);
|
||||
if ( distance < min )
|
||||
{
|
||||
|
@ -294,7 +294,7 @@ bool CAutoRadar::SearchEnemy(Math::Vector &pos)
|
|||
UpdateInterface();
|
||||
|
||||
if ( best == nullptr ) return false;
|
||||
pos = best->GetPosition(0);
|
||||
pos = best->GetPosition();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ bool CAutoRepair::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 0.8f);
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(), 1.0f, 0.8f);
|
||||
|
||||
m_phase = ARP_DOWN;
|
||||
m_progress = 0.0f;
|
||||
|
@ -130,7 +130,7 @@ bool CAutoRepair::EventProcess(const Event &event)
|
|||
else
|
||||
{
|
||||
m_object->SetAngleZ(1, 0.0f);
|
||||
m_sound->Play(SOUND_REPAIR, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_REPAIR, m_object->GetPosition());
|
||||
|
||||
m_phase = ARP_REPAIR;
|
||||
m_progress = 0.0f;
|
||||
|
@ -156,7 +156,7 @@ bool CAutoRepair::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.y += 1.0f;
|
||||
|
@ -170,7 +170,7 @@ bool CAutoRepair::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(0), 1.0f, 0.8f);
|
||||
m_sound->Play(SOUND_OPEN, m_object->GetPosition(), 1.0f, 0.8f);
|
||||
|
||||
m_phase = ARP_UP;
|
||||
m_progress = 0.0f;
|
||||
|
@ -233,7 +233,7 @@ bool CAutoRepair::CreateInterface(bool bSelect)
|
|||
|
||||
CObject* CAutoRepair::SearchVehicle()
|
||||
{
|
||||
Math::Vector sPos = m_object->GetPosition(0);
|
||||
Math::Vector sPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -269,7 +269,7 @@ CObject* CAutoRepair::SearchVehicle()
|
|||
CPhysics* physics = obj->GetPhysics();
|
||||
if ( physics != nullptr && !physics->GetLand() ) continue; // in flight?
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, sPos);
|
||||
if ( dist <= 5.0f ) return obj;
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ Error CAutoResearch::StartAction(int param)
|
|||
InitProgressTotal(time);
|
||||
UpdateInterface();
|
||||
|
||||
m_channelSound = m_sound->Play(SOUND_RESEARCH, m_object->GetPosition(0), 0.0f, 1.0f, true);
|
||||
m_channelSound = m_sound->Play(SOUND_RESEARCH, m_object->GetPosition(), 0.0f, 1.0f, true);
|
||||
m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, 2.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_channelSound, 1.0f, 1.0f, time-4.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_channelSound, 0.0f, 1.0f, 2.0f, SOPER_STOP);
|
||||
|
@ -235,7 +235,7 @@ bool CAutoResearch::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*6.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*6.0f;
|
||||
pos.y += 11.0f;
|
||||
|
|
|
@ -193,7 +193,7 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 24.5f;
|
||||
m_angleYfinal = Math::RotateAngle(m_targetPos.x-pos.x, pos.z-m_targetPos.z); // CW !
|
||||
m_angleYfinal += Math::PI*2.0f;
|
||||
|
@ -235,7 +235,7 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
power->SetEnergy(energy);
|
||||
}
|
||||
|
||||
m_sound->Play(SOUND_GGG, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_GGG, m_object->GetPosition());
|
||||
|
||||
m_phase = ATP_FIRE;
|
||||
m_progress = 0.0f;
|
||||
|
@ -247,7 +247,7 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_progress == 0.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 24.5f;
|
||||
m_particle->CreateRay(pos, m_targetPos, Gfx::PARTIRAY1,
|
||||
Math::Point(5.0f, 5.0f), 1.5f);
|
||||
|
@ -268,7 +268,7 @@ bool CAutoTower::EventProcess(const Event &event)
|
|||
|
||||
CObject* CAutoTower::SearchTarget(Math::Vector &impact)
|
||||
{
|
||||
Math::Vector iPos = m_object->GetPosition(0);
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
float min = 1000000.0f;
|
||||
|
||||
CObject* best = nullptr;
|
||||
|
@ -307,7 +307,7 @@ CObject* CAutoTower::SearchTarget(Math::Vector &impact)
|
|||
}
|
||||
if ( best == nullptr ) return nullptr;
|
||||
|
||||
impact = best->GetPosition(0);
|
||||
impact = best->GetPosition();
|
||||
return best;
|
||||
}
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ bool CAutoVault::EventProcess(const Event &event)
|
|||
{
|
||||
LockKeys();
|
||||
|
||||
m_channelSound = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 1.0f, 0.25f, true);
|
||||
m_channelSound = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 1.0f, 0.25f, true);
|
||||
m_sound->AddEnvelope(m_channelSound, 1.0f, 2.00f, OPEN_DELAY, SOPER_STOP);
|
||||
|
||||
m_phase = ASAP_OPEN;
|
||||
|
@ -172,7 +172,7 @@ bool CAutoVault::EventProcess(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_channelSound = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 1.0f, 0.25f, true);
|
||||
m_channelSound = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 1.0f, 0.25f, true);
|
||||
m_sound->AddEnvelope(m_channelSound, 1.0f, 0.35f, 0.5f, SOPER_STOP);
|
||||
}
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ bool CAutoVault::EventProcess(const Event &event)
|
|||
|
||||
for ( i=0 ; i<10 ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*10.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*10.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*4.0f;
|
||||
|
@ -206,7 +206,7 @@ bool CAutoVault::EventProcess(const Event &event)
|
|||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIBLUE, 1.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*10.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*10.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*4.0f;
|
||||
|
@ -242,7 +242,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_sound->Play(SOUND_FINDING, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_FINDING, m_object->GetPosition());
|
||||
|
||||
m_phase = ASAP_FINISH;
|
||||
m_progress = 0.0f;
|
||||
|
@ -384,7 +384,7 @@ bool CAutoVault::Read(CLevelParserLine* line)
|
|||
|
||||
int CAutoVault::CountKeys()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
float cAngle = m_object->GetAngleY(0);
|
||||
|
||||
for (int index = 0; index < 4; index++)
|
||||
|
@ -403,7 +403,7 @@ int CAutoVault::CountKeys()
|
|||
oType != OBJECT_KEYc &&
|
||||
oType != OBJECT_KEYd ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
@ -462,7 +462,7 @@ int CAutoVault::CountKeys()
|
|||
|
||||
void CAutoVault::LockKeys()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -474,7 +474,7 @@ void CAutoVault::LockKeys()
|
|||
oType != OBJECT_KEYc &&
|
||||
oType != OBJECT_KEYd ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
@ -486,7 +486,7 @@ void CAutoVault::LockKeys()
|
|||
|
||||
void CAutoVault::DownKeys(float progress)
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
|
@ -498,7 +498,7 @@ void CAutoVault::DownKeys(float progress)
|
|||
oType != OBJECT_KEYc &&
|
||||
oType != OBJECT_KEYd ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
@ -511,7 +511,7 @@ void CAutoVault::DownKeys(float progress)
|
|||
|
||||
void CAutoVault::DeleteKeys()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
bool haveDeleted = false;
|
||||
do
|
||||
|
@ -527,7 +527,7 @@ void CAutoVault::DeleteKeys()
|
|||
oType != OBJECT_KEYc &&
|
||||
oType != OBJECT_KEYd ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
|
@ -543,14 +543,14 @@ void CAutoVault::DeleteKeys()
|
|||
|
||||
CObject* CAutoVault::SearchVehicle()
|
||||
{
|
||||
Math::Vector cPos = m_object->GetPosition(0);
|
||||
Math::Vector cPos = m_object->GetPosition();
|
||||
|
||||
for (CObject* obj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
{
|
||||
if ( obj == m_object ) continue;
|
||||
if (IsObjectBeingTransported(obj)) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, cPos);
|
||||
if ( dist <= 4.0f ) return obj;
|
||||
}
|
||||
|
|
|
@ -873,7 +873,7 @@ bool CBrain::EventProcess(const Event &event)
|
|||
{
|
||||
Math::Vector p1, p2;
|
||||
float h;
|
||||
p1 = m_object->GetPosition(0);
|
||||
p1 = m_object->GetPosition();
|
||||
h = m_terrain->GetFloorLevel(p1);
|
||||
p2 = p1;
|
||||
p1.x -= 20.0f;
|
||||
|
@ -886,7 +886,7 @@ bool CBrain::EventProcess(const Event &event)
|
|||
{
|
||||
Math::Vector p1, p2;
|
||||
float h;
|
||||
p1 = m_object->GetPosition(0);
|
||||
p1 = m_object->GetPosition();
|
||||
h = m_terrain->GetFloorLevel(p1);
|
||||
p2 = p1;
|
||||
p1.x -= 20.0f;
|
||||
|
@ -916,7 +916,7 @@ bool CBrain::EventFrame(const Event &event)
|
|||
|
||||
if ( m_soundChannelAlarm != -1 )
|
||||
{
|
||||
m_sound->Position(m_soundChannelAlarm, m_object->GetPosition(0));
|
||||
m_sound->Position(m_soundChannelAlarm, m_object->GetPosition());
|
||||
}
|
||||
|
||||
if ( m_studio != 0 ) // current edition?
|
||||
|
@ -1306,13 +1306,13 @@ void CBrain::GroundFlat()
|
|||
if ( !m_physics->GetLand() )
|
||||
{
|
||||
err = ERR_FLAG_FLY;
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( pos.y < m_water->GetLevel() ) err = ERR_FLAG_WATER;
|
||||
m_main->DisplayError(err, m_object);
|
||||
return;
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_terrain->ShowFlatGround(pos);
|
||||
m_sound->Play(SOUND_GFLAT, pos);
|
||||
|
||||
|
@ -2162,7 +2162,7 @@ void CBrain::UpdateInterface(float rTime)
|
|||
}
|
||||
if ( m_soundChannelAlarm == -1 )
|
||||
{
|
||||
m_soundChannelAlarm = m_sound->Play(SOUND_ALARMt, m_object->GetPosition(0), 0.0f, 0.1f, true);
|
||||
m_soundChannelAlarm = m_sound->Play(SOUND_ALARMt, m_object->GetPosition(), 0.0f, 0.1f, true);
|
||||
m_sound->AddEnvelope(m_soundChannelAlarm, 1.0f, 1.0f, 1.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannelAlarm, 1.0f, 1.0f, 1.0f, SOPER_LOOP);
|
||||
}
|
||||
|
@ -2936,7 +2936,7 @@ void CBrain::TraceRecordStart()
|
|||
|
||||
m_traceOper = TO_STOP;
|
||||
|
||||
m_tracePos = m_object->GetPosition(0);
|
||||
m_tracePos = m_object->GetPosition();
|
||||
m_traceAngle = m_object->GetAngleY(0);
|
||||
|
||||
if ( motionVehicle->GetTraceDown() ) // pencil down?
|
||||
|
@ -2987,7 +2987,7 @@ void CBrain::TraceRecordFrame()
|
|||
if ( m_traceOper == TO_ADVANCE ||
|
||||
m_traceOper == TO_RECEDE )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
len = Math::DistanceProjected(pos, m_tracePos);
|
||||
TraceRecordOper(m_traceOper, len);
|
||||
}
|
||||
|
@ -3003,7 +3003,7 @@ void CBrain::TraceRecordFrame()
|
|||
}
|
||||
|
||||
m_traceOper = oper;
|
||||
m_tracePos = m_object->GetPosition(0);
|
||||
m_tracePos = m_object->GetPosition();
|
||||
m_traceAngle = m_object->GetAngleY(0);
|
||||
m_traceColor = color;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ bool CMotion::EventProcess(const Event &event)
|
|||
m_progress += event.rTime*m_actionTime;
|
||||
if ( m_progress > 1.0f ) m_progress = 1.0f; // (*)
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( pos.y < m_water->GetLevel(m_object) ) // underwater?
|
||||
{
|
||||
time = event.rTime*3.0f; // everything is slower
|
||||
|
|
|
@ -253,7 +253,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
CreatePhysics();
|
||||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -431,7 +431,7 @@ bool CMotionAnt::EventFrame(const Event &event)
|
|||
bool bStop;
|
||||
|
||||
if ( m_engine->GetPause() ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition(0)) ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition()) ) return true;
|
||||
|
||||
s = m_physics->GetLinMotionX(MO_MOTSPEED)*1.5f;
|
||||
a = fabs(m_physics->GetCirMotionY(MO_MOTSPEED)*2.0f);
|
||||
|
@ -643,7 +643,7 @@ bool CMotionAnt::EventFrame(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_armTimeAbs;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.y = Math::Rand()*5.0f;
|
||||
|
@ -687,7 +687,7 @@ bool CMotionAnt::EventFrame(const Event &event)
|
|||
|
||||
if ( rand()%10 == 0 )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.y -= 1.0f;
|
||||
|
@ -734,7 +734,7 @@ bool CMotionAnt::EventFrame(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_armTimeAbs;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.y = Math::Rand()*5.0f;
|
||||
|
|
|
@ -272,7 +272,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
CreatePhysics();
|
||||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -413,7 +413,7 @@ bool CMotionBee::EventFrame(const Event &event)
|
|||
bool bStop;
|
||||
|
||||
if ( m_engine->GetPause() ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition(0)) ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition()) ) return true;
|
||||
|
||||
s = m_physics->GetLinMotionX(MO_MOTSPEED)*0.30f;
|
||||
a = fabs(m_physics->GetCirMotionY(MO_MOTSPEED)*2.00f);
|
||||
|
@ -599,7 +599,7 @@ bool CMotionBee::EventFrame(const Event &event)
|
|||
m_object->SetAngleY(1, sinf(m_armTimeAbs*2.1f)*0.50f); // head
|
||||
|
||||
#if 0
|
||||
h = m_terrain->GetFloorHeight(GetPosition(0));
|
||||
h = m_terrain->GetFloorHeight(GetPosition());
|
||||
radius = 4.0f+h/4.0f;
|
||||
color.r = 0.3f+h/80.0f;
|
||||
color.g = color.r;
|
||||
|
|
|
@ -322,7 +322,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
CreatePhysics(type);
|
||||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -884,7 +884,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
if ( m_physics->GetLand() ) // on the ground?
|
||||
{
|
||||
a = m_object->GetAngleY(0);
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_terrain->AdjustToFloor(pos);
|
||||
|
||||
pf.x = pos.x+cosf(a+Math::PI*1.5f)*0.7f;
|
||||
|
@ -1271,7 +1271,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
|
||||
for ( i=0 ; i<10 ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*4.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*4.0f;
|
||||
m_terrain->AdjustToFloor(pos);
|
||||
|
@ -1280,7 +1280,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f, 0.0f, 0.0f);
|
||||
}
|
||||
m_sound->Play(SOUND_BOUMv, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_BOUMv, m_object->GetPosition());
|
||||
|
||||
SetAction(MHS_DEADg2, 1.0f); // expects knees
|
||||
}
|
||||
|
@ -1341,7 +1341,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
|
||||
for ( i=0 ; i<20 ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*8.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*8.0f;
|
||||
m_terrain->AdjustToFloor(pos);
|
||||
|
@ -1350,7 +1350,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTICRASH, 2.0f, 0.0f, 0.0f);
|
||||
}
|
||||
m_sound->Play(SOUND_BOUMv, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_BOUMv, m_object->GetPosition());
|
||||
|
||||
SetAction(MHS_DEADg4, 3.0f); // expects face down
|
||||
}
|
||||
|
@ -1405,7 +1405,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
}
|
||||
else if ( m_actionType == MHS_DEADw ) // drowned?
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
level = m_water->GetLevel()-0.5f;
|
||||
if ( pos.y < level )
|
||||
{
|
||||
|
@ -1648,7 +1648,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
sound[0] = SOUND_CLICK;
|
||||
sound[1] = SOUND_CLICK;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
|
||||
level = m_water->GetLevel();
|
||||
if ( pos.y <= level+3.0f ) // underwater?
|
||||
|
@ -1705,7 +1705,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
if ( fabs(m_lastSoundMarch-time) > 0.9f &&
|
||||
Math::Mod(time, 1.0f) < 0.1f )
|
||||
{
|
||||
m_sound->Play(SOUND_SWIM, m_object->GetPosition(0), 0.5f);
|
||||
m_sound->Play(SOUND_SWIM, m_object->GetPosition(), 0.5f);
|
||||
m_lastSoundMarch = time;
|
||||
}
|
||||
}
|
||||
|
@ -1715,7 +1715,7 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
m_object->GetSelect() &&
|
||||
m_object->GetOption() == 0 ) // helmet?
|
||||
{
|
||||
m_sound->Play(SOUND_HUMAN1, m_object->GetPosition(0), (0.5f+m_tired*0.2f));
|
||||
m_sound->Play(SOUND_HUMAN1, m_object->GetPosition(), (0.5f+m_tired*0.2f));
|
||||
m_lastSoundHhh = (4.0f-m_tired*2.5f)+(4.0f-m_tired*2.5f)*Math::Rand();
|
||||
}
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
CreatePhysics();
|
||||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -363,7 +363,7 @@ bool CMotionQueen::EventFrame(const Event &event)
|
|||
bool bStop;
|
||||
|
||||
if ( m_engine->GetPause() ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition(0)) ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition()) ) return true;
|
||||
|
||||
s = m_physics->GetLinMotionX(MO_MOTSPEED)*1.5f;
|
||||
a = fabs(m_physics->GetCirMotionY(MO_MOTSPEED)*26.0f);
|
||||
|
|
|
@ -185,7 +185,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
CreatePhysics();
|
||||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -368,7 +368,7 @@ bool CMotionSpider::EventFrame(const Event &event)
|
|||
bool bStop;
|
||||
|
||||
if ( m_engine->GetPause() ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition(0)) ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition()) ) return true;
|
||||
|
||||
s = m_physics->GetLinMotionX(MO_MOTSPEED)*1.5f;
|
||||
a = fabs(m_physics->GetCirMotionY(MO_MOTSPEED)*2.0f);
|
||||
|
@ -571,7 +571,7 @@ bool CMotionSpider::EventFrame(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_armTimeAbs;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.y = Math::Rand()*5.0f;
|
||||
|
@ -615,7 +615,7 @@ bool CMotionSpider::EventFrame(const Event &event)
|
|||
|
||||
if ( rand()%10 == 0 )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*8.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*8.0f;
|
||||
pos.y -= 1.0f;
|
||||
|
@ -662,7 +662,7 @@ bool CMotionSpider::EventFrame(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_armTimeAbs;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*10.0f;
|
||||
speed.y = Math::Rand()*5.0f;
|
||||
|
|
|
@ -173,7 +173,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetZoom(0, 0.5f); // is little
|
||||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -267,7 +267,7 @@ bool CMotionToto::EventFrame(const Event &event)
|
|||
|
||||
if ( bHidden )
|
||||
{
|
||||
nPos = m_object->GetPosition(0);
|
||||
nPos = m_object->GetPosition();
|
||||
m_terrain->AdjustToFloor(nPos, true);
|
||||
nPos.y -= 100.0f; // hidden under the ground!
|
||||
m_object->SetPosition(0, nPos);
|
||||
|
@ -379,7 +379,7 @@ bool CMotionToto::EventFrame(const Event &event)
|
|||
m_clownRadius = 0.0f;
|
||||
m_clownDelay = 2.0f+Math::Rand()*2.0f;
|
||||
}
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( pos.y < m_water->GetLevel() ) // underwater?
|
||||
{
|
||||
m_clownRadius /= 1.5f;
|
||||
|
@ -417,7 +417,7 @@ bool CMotionToto::EventFrame(const Event &event)
|
|||
}
|
||||
else
|
||||
{
|
||||
aPos = m_object->GetPosition(0);
|
||||
aPos = m_object->GetPosition();
|
||||
if ( m_actionType == -1 )
|
||||
{
|
||||
level = 4.0f;
|
||||
|
@ -712,7 +712,7 @@ bool CMotionToto::EventFrame(const Event &event)
|
|||
if ( m_bDisplayInfo ) sheet = Gfx::SH_FRONT;
|
||||
else sheet = Gfx::SH_WORLD;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( !m_bDisplayInfo &&
|
||||
pos.y < m_water->GetLevel() ) // underwater?
|
||||
{
|
||||
|
@ -810,7 +810,7 @@ bool CMotionToto::EventFrame(const Event &event)
|
|||
// Move the sound.
|
||||
if ( m_soundChannel != -1 )
|
||||
{
|
||||
if ( !m_sound->Position(m_soundChannel, m_object->GetPosition(0)) )
|
||||
if ( !m_sound->Position(m_soundChannel, m_object->GetPosition()) )
|
||||
{
|
||||
m_soundChannel = -1;
|
||||
}
|
||||
|
@ -838,7 +838,7 @@ Error CMotionToto::SetAction(int action, float time)
|
|||
|
||||
if ( sound != SOUND_CLICK )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(sound, m_object->GetPosition(0));
|
||||
m_soundChannel = m_sound->Play(sound, m_object->GetPosition());
|
||||
}
|
||||
|
||||
return ERR_OK;
|
||||
|
|
|
@ -947,7 +947,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
dynamic_cast<CPoweredObject*>(m_object)->SetPower(powerCell);
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); //to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -1267,7 +1267,7 @@ bool CMotionVehicle::EventFrame(const Event &event)
|
|||
float back, front, dist, radius, limit[2];
|
||||
|
||||
if ( m_engine->GetPause() ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition(0)) ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition()) ) return true;
|
||||
|
||||
type = m_object->GetType();
|
||||
|
||||
|
@ -1328,8 +1328,8 @@ bool CMotionVehicle::EventFrame(const Event &event)
|
|||
m_object->SetAngleY(13, m_object->GetAngleY(9)+(m_wheelTurn[3]-m_object->GetAngleY(9))*event.rTime*8.0f+Math::PI);
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
angle = m_object->GetAngle(0);
|
||||
pos = m_object->GetPosition();
|
||||
angle = m_object->GetRotation();
|
||||
if ( pos.x != m_wheelLastPos.x ||
|
||||
pos.y != m_wheelLastPos.y ||
|
||||
pos.z != m_wheelLastPos.z ||
|
||||
|
@ -1456,8 +1456,8 @@ bool CMotionVehicle::EventFrame(const Event &event)
|
|||
|
||||
UpdateTrackMapping(m_posTrackLeft, m_posTrackRight, type);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
angle = m_object->GetAngle(0);
|
||||
pos = m_object->GetPosition();
|
||||
angle = m_object->GetRotation();
|
||||
if ( pos.x != m_wheelLastPos.x ||
|
||||
pos.y != m_wheelLastPos.y ||
|
||||
pos.z != m_wheelLastPos.z ||
|
||||
|
@ -1592,8 +1592,8 @@ bool CMotionVehicle::EventFrameFly(const Event &event)
|
|||
float hope[3], actual, final, h, a;
|
||||
int i;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
angle = m_object->GetAngle(0);
|
||||
pos = m_object->GetPosition();
|
||||
angle = m_object->GetRotation();
|
||||
if ( m_bFlyFix &&
|
||||
pos.x == m_wheelLastPos.x &&
|
||||
pos.y == m_wheelLastPos.y &&
|
||||
|
@ -1843,7 +1843,7 @@ bool CMotionVehicle::EventFrameCanoni(const Event &event)
|
|||
{
|
||||
m_lastTimeCanon = m_engine->ParticuleAdapt(0.5f+Math::Rand()*0.5f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 8.0f;
|
||||
speed.y = 7.0f+Math::Rand()*3.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*2.0f;
|
||||
|
|
|
@ -136,7 +136,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
CreatePhysics();
|
||||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
|
@ -277,9 +277,9 @@ bool CMotionWorm::EventFrame(const Event &event)
|
|||
}
|
||||
m_object->SetVisible(under!=WORM_PART+2);
|
||||
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition(0)) ) return true;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition()) ) return true;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
floor = m_terrain->GetFloorLevel(pos, true);
|
||||
|
||||
mat = m_object->GetWorldMatrix(0);
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
//! Returns current object's position
|
||||
virtual Math::Vector GetPosition() const;
|
||||
using COldObjectInterface::GetPosition;
|
||||
using COldObjectInterface::GetPosition; // temporarily
|
||||
//! Returns current object's rotation (Euler angles)
|
||||
virtual Math::Vector GetRotation() const;
|
||||
//! Returns current object's scale
|
||||
|
|
|
@ -1067,7 +1067,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
|
|||
}
|
||||
#endif
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
|
@ -1190,7 +1190,7 @@ CObjectUPtr CObjectFactory::CreateResource(const ObjectCreateParams& params)
|
|||
m_engine->LoadAllTextures();
|
||||
obj->FloorAdjust();
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
|
@ -1251,7 +1251,7 @@ CObjectUPtr CObjectFactory::CreateFlag(const ObjectCreateParams& params)
|
|||
m_engine->LoadAllTextures();
|
||||
obj->FloorAdjust();
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
return std::move(obj);
|
||||
|
@ -1340,14 +1340,14 @@ CObjectUPtr CObjectFactory::CreateBarrier(const ObjectCreateParams& params)
|
|||
obj->CreateShadowCircle(10.0f, 0.5f, Gfx::ENG_SHADOW_WORM);
|
||||
}
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
obj->SetFloorHeight(0.0f);
|
||||
AddObjectAuto(obj.get());
|
||||
obj->FloorAdjust();
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -1565,13 +1565,13 @@ CObjectUPtr CObjectFactory::CreatePlant(const ObjectCreateParams& params)
|
|||
obj->CreateShadowCircle(50.0f, 0.5f);
|
||||
}
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
obj->SetFloorHeight(0.0f);
|
||||
AddObjectAuto(obj.get());
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -1623,13 +1623,13 @@ CObjectUPtr CObjectFactory::CreateMushroom(const ObjectCreateParams& params)
|
|||
obj->CreateShadowCircle(5.0f, 0.5f);
|
||||
}
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
obj->SetFloorHeight(0.0f);
|
||||
AddObjectAuto(obj.get());
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -1706,13 +1706,13 @@ CObjectUPtr CObjectFactory::CreateQuartz(const ObjectCreateParams& params)
|
|||
obj->CreateShadowCircle(10.0f, 0.5f);
|
||||
}
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
obj->SetFloorHeight(0.0f);
|
||||
AddObjectAuto(obj.get());
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -1897,13 +1897,13 @@ CObjectUPtr CObjectFactory::CreateRoot(const ObjectCreateParams& params)
|
|||
obj->CreateShadowCircle(30.0f, 0.5f);
|
||||
}
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
obj->SetFloorHeight(0.0f);
|
||||
AddObjectAuto(obj.get());
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -1937,13 +1937,13 @@ CObjectUPtr CObjectFactory::CreateHome(const ObjectCreateParams& params)
|
|||
obj->CreateShadowCircle(16.0f, 0.5f);
|
||||
}
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
obj->SetFloorHeight(0.0f);
|
||||
AddObjectAuto(obj.get());
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2207,7 +2207,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
obj->CreateShadowCircle(30.0f, 1.0f);
|
||||
}
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); //to display the shadows immediately
|
||||
|
||||
obj->SetFloorHeight(0.0f);
|
||||
|
@ -2220,13 +2220,13 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
obj->FloorAdjust();
|
||||
}
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += height;
|
||||
obj->SetPosition(0, pos); //to display the shadows immediately
|
||||
|
||||
if ( type == OBJECT_RUINmobilew1 )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y -= 0.5f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2236,7 +2236,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINmobilew2 )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y -= 1.5f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2249,7 +2249,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINmobilet1 )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y -= 0.9f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2259,7 +2259,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINmobilet2 )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y -= 1.5f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2272,7 +2272,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINmobiler1 )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += 4.0f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2285,7 +2285,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINmobiler2 )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += 2.0f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2298,7 +2298,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINdoor )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y -= 0.5f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2308,7 +2308,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINsupport )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += 0.5f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2324,7 +2324,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINradar )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y -= 0.5f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2337,14 +2337,14 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINconvert )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y -= 1.0f;
|
||||
obj->SetPosition(0, pos);
|
||||
}
|
||||
|
||||
if ( type == OBJECT_RUINbase )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y -= 1.0f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2354,7 +2354,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
|
|||
|
||||
if ( type == OBJECT_RUINhead )
|
||||
{
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
pos.y += 8.0f;
|
||||
obj->SetPosition(0, pos);
|
||||
|
||||
|
@ -2538,7 +2538,7 @@ CObjectUPtr CObjectFactory::CreateApollo(const ObjectCreateParams& params)
|
|||
|
||||
AddObjectAuto(obj.get());
|
||||
|
||||
pos = obj->GetPosition(0);
|
||||
pos = obj->GetPosition();
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
return std::move(obj);
|
||||
|
|
|
@ -109,7 +109,7 @@ void uObject(CBotVar* botThis, void* user)
|
|||
}
|
||||
else
|
||||
{
|
||||
pos = object->GetPosition(0);
|
||||
pos = object->GetPosition();
|
||||
float waterLevel = Gfx::CEngine::GetInstancePointer()->GetWater()->GetLevel();
|
||||
pos.y -= waterLevel; // relative to sea level!
|
||||
pSub = pVar->GetItemList(); // "x"
|
||||
|
@ -121,7 +121,7 @@ void uObject(CBotVar* botThis, void* user)
|
|||
}
|
||||
|
||||
// Updates the angle.
|
||||
pos = object->GetAngle(0);
|
||||
pos = object->GetRotation();
|
||||
pos += object->GetTilt();
|
||||
pVar = pVar->GetNext(); // "orientation"
|
||||
pVar->SetValFloat(360.0f-Math::Mod(pos.y*180.0f/Math::PI, 360.0f));
|
||||
|
@ -355,7 +355,7 @@ void COldObject::DeleteObject(bool bAll)
|
|||
type == Gfx::CAM_TYPE_ONBOARD) &&
|
||||
m_camera->GetControllingObject() == this )
|
||||
{
|
||||
obj = m_main->SearchNearest(GetPosition(0), this);
|
||||
obj = m_main->SearchNearest(GetPosition(), this);
|
||||
if ( obj == 0 )
|
||||
{
|
||||
m_camera->SetControllingObject(0);
|
||||
|
@ -395,7 +395,7 @@ void COldObject::DeleteObject(bool bAll)
|
|||
m_type == OBJECT_START ||
|
||||
m_type == OBJECT_END ) // building?
|
||||
{
|
||||
m_terrain->DeleteBuildingLevel(GetPosition(0)); // flattens the field
|
||||
m_terrain->DeleteBuildingLevel(GetPosition()); // flattens the field
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1157,7 +1157,7 @@ void COldObject::FloorAdjust()
|
|||
Math::Point nn;
|
||||
float a;
|
||||
|
||||
pos = GetPosition(0);
|
||||
pos = GetPosition();
|
||||
if ( m_terrain->GetNormal(n, pos) )
|
||||
{
|
||||
#if 0
|
||||
|
@ -1650,7 +1650,7 @@ bool COldObject::CreateShadowLight(float height, Gfx::Color color)
|
|||
{
|
||||
if ( !m_engine->GetLightMode() ) return true;
|
||||
|
||||
Math::Vector pos = GetPosition(0);
|
||||
Math::Vector pos = GetPosition();
|
||||
m_shadowHeight = height;
|
||||
|
||||
Gfx::Light light;
|
||||
|
@ -2115,7 +2115,7 @@ bool COldObject::EventFrame(const Event &event)
|
|||
if ( m_bProxyActivate ) // active if it is near?
|
||||
{
|
||||
Math::Vector eye = m_engine->GetLookatPt();
|
||||
float dist = Math::Distance(eye, GetPosition(0));
|
||||
float dist = Math::Distance(eye, GetPosition());
|
||||
if ( dist < m_proxyDistance )
|
||||
{
|
||||
m_bProxyActivate = false;
|
||||
|
@ -2176,7 +2176,7 @@ void COldObject::VirusFrame(float rTime)
|
|||
if ( r == 8 ) type = Gfx::PARTIVIRUS9;
|
||||
if ( r == 9 ) type = Gfx::PARTIVIRUS10;
|
||||
|
||||
pos = GetPosition(0);
|
||||
pos = GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*10.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*10.0f;
|
||||
speed.x = (Math::Rand()-0.5f)*2.0f;
|
||||
|
@ -2586,7 +2586,7 @@ void COldObject::StartDetectEffect(CObject *target, bool bFound)
|
|||
}
|
||||
else
|
||||
{
|
||||
goal = target->GetPosition(0);
|
||||
goal = target->GetPosition();
|
||||
goal.y += 3.0f;
|
||||
goal = Math::SegmentPoint(pos, goal, Math::Distance(pos, goal)-3.0f);
|
||||
}
|
||||
|
@ -2597,7 +2597,7 @@ void COldObject::StartDetectEffect(CObject *target, bool bFound)
|
|||
|
||||
if ( target != 0 )
|
||||
{
|
||||
goal = target->GetPosition(0);
|
||||
goal = target->GetPosition();
|
||||
goal.y += 3.0f;
|
||||
goal = Math::SegmentPoint(pos, goal, Math::Distance(pos, goal)-1.0f);
|
||||
dim.x = 6.0f;
|
||||
|
@ -3058,7 +3058,7 @@ bool COldObject::StartShowLimit()
|
|||
{
|
||||
if ( m_showLimitRadius == 0.0f ) return false;
|
||||
|
||||
m_main->SetShowLimit(0, Gfx::PARTILIMIT1, this, GetPosition(0), m_showLimitRadius);
|
||||
m_main->SetShowLimit(0, Gfx::PARTILIMIT1, this, GetPosition(), m_showLimitRadius);
|
||||
m_bShowLimit = true;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -917,7 +917,7 @@ bool CRobotMain::ProcessEvent(Event &event)
|
|||
{
|
||||
CLevelParserLine* line = new CLevelParserLine("CreateObject");
|
||||
line->AddParam("type", CLevelParserParamUPtr{new CLevelParserParam(obj->GetType())});
|
||||
line->AddParam("pos", CLevelParserParamUPtr{new CLevelParserParam(obj->GetPosition(0))});
|
||||
line->AddParam("pos", CLevelParserParamUPtr{new CLevelParserParam(obj->GetPosition())});
|
||||
line->AddParam("dir", CLevelParserParamUPtr{new CLevelParserParam(obj->GetAngleZ(0)/(Math::PI/180.0f))});
|
||||
|
||||
std::stringstream ss;
|
||||
|
@ -1725,7 +1725,7 @@ void CRobotMain::StartDisplayVisit(EventType event)
|
|||
Math::Vector goal = m_displayText->GetVisitGoal(event);
|
||||
m_visitArrow = m_objMan->CreateObject(goal, 0.0f, OBJECT_SHOW, -1.0f, 1.0f, 10.0f);
|
||||
|
||||
m_visitPos = m_visitArrow->GetPosition(0);
|
||||
m_visitPos = m_visitArrow->GetPosition();
|
||||
m_visitPosArrow = m_visitPos;
|
||||
m_visitPosArrow.y += m_displayText->GetVisitHeight(event);
|
||||
m_visitArrow->SetPosition(0, m_visitPosArrow);
|
||||
|
@ -1971,7 +1971,7 @@ CObject* CRobotMain::SearchNearest(Math::Vector pos, CObject* exclu)
|
|||
ObjectType type = obj->GetType();
|
||||
if (type == OBJECT_TOTO) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::DistanceProjected(oPos, pos);
|
||||
if (dist < min)
|
||||
{
|
||||
|
@ -2567,7 +2567,7 @@ void CRobotMain::UpdateInfoText()
|
|||
CObject* obj = GetSelect();
|
||||
if (obj != nullptr)
|
||||
{
|
||||
Math::Vector pos = obj->GetPosition(0);
|
||||
Math::Vector pos = obj->GetPosition();
|
||||
m_engine->SetStatisticPos(pos);
|
||||
}
|
||||
}
|
||||
|
@ -3677,8 +3677,8 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
|
|||
dynamic_cast<CProgrammableObject*>(obj)->GetBrain()
|
||||
->SetSoluceName(const_cast<char*>(line->GetParam("soluce")->AsPath("ai").c_str()));
|
||||
|
||||
obj->SetResetPosition(obj->GetPosition(0));
|
||||
obj->SetResetAngle(obj->GetAngle(0));
|
||||
obj->SetResetPosition(obj->GetPosition());
|
||||
obj->SetResetAngle(obj->GetRotation());
|
||||
obj->SetResetRun(loadedPrograms[run]);
|
||||
if (line->GetParam("reset")->AsBool(false))
|
||||
obj->SetResetCap(RESET_MOVE);
|
||||
|
@ -3960,7 +3960,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
|
|||
|
||||
if (read[0] != 0 && sel != 0) // loading file?
|
||||
{
|
||||
Math::Vector pos = sel->GetPosition(0);
|
||||
Math::Vector pos = sel->GetPosition();
|
||||
m_camera->Init(pos, pos, 0.0f);
|
||||
m_camera->FixCamera();
|
||||
|
||||
|
@ -4202,7 +4202,7 @@ float CRobotMain::SearchNearestObject(Math::Vector center, CObject *exclu)
|
|||
|
||||
if (type == OBJECT_BASE)
|
||||
{
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
if (oPos.x != center.x ||
|
||||
oPos.z != center.z)
|
||||
{
|
||||
|
@ -4217,7 +4217,7 @@ float CRobotMain::SearchNearestObject(Math::Vector center, CObject *exclu)
|
|||
type == OBJECT_REPAIR ||
|
||||
type == OBJECT_DESTROYER)
|
||||
{
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(center, oPos)-8.0f;
|
||||
if (dist < 0.0f) dist = 0.0f;
|
||||
min = Math::Min(min, dist);
|
||||
|
@ -4335,7 +4335,7 @@ void CRobotMain::ShowDropZone(CObject* metal, CObject* transporter)
|
|||
{
|
||||
if (metal == nullptr) return;
|
||||
|
||||
Math::Vector center = metal->GetPosition(0);
|
||||
Math::Vector center = metal->GetPosition();
|
||||
|
||||
// Calculates the maximum radius possible depending on other items.
|
||||
float oMax = 30.0f; // radius to build the biggest building
|
||||
|
@ -4353,7 +4353,7 @@ void CRobotMain::ShowDropZone(CObject* metal, CObject* transporter)
|
|||
ObjectType type = obj->GetType();
|
||||
if (type == OBJECT_BASE)
|
||||
{
|
||||
oPos = obj->GetPosition(0);
|
||||
oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(center, oPos)-80.0f;
|
||||
oMax = Math::Min(oMax, dist);
|
||||
}
|
||||
|
@ -5359,8 +5359,8 @@ void CRobotMain::ResetObject()
|
|||
pos = obj->GetResetPosition();
|
||||
angle = obj->GetResetAngle();
|
||||
|
||||
if ( pos == obj->GetPosition(0) &&
|
||||
angle == obj->GetAngle(0) ) continue;
|
||||
if ( pos == obj->GetPosition() &&
|
||||
angle == obj->GetRotation() ) continue;
|
||||
brain->StartTaskReset(pos, angle);
|
||||
continue;
|
||||
}
|
||||
|
@ -5371,8 +5371,8 @@ void CRobotMain::ResetObject()
|
|||
pos = obj->GetResetPosition();
|
||||
angle = obj->GetResetAngle();
|
||||
|
||||
if ( pos == obj->GetPosition(0) &&
|
||||
angle == obj->GetAngle(0) ) continue;
|
||||
if ( pos == obj->GetPosition() &&
|
||||
angle == obj->GetRotation() ) continue;
|
||||
|
||||
pyro = new CPyro();
|
||||
pyro->Create(PT_RESET, obj);
|
||||
|
|
|
@ -116,9 +116,9 @@ int CSceneCondition::CountObjects()
|
|||
if (energyLevel < this->powermin || energyLevel > this->powermax) continue;
|
||||
|
||||
if (IsObjectBeingTransported(obj))
|
||||
oPos = dynamic_cast<CTransportableObject*>(obj)->GetTransporter()->GetPosition(0);
|
||||
oPos = dynamic_cast<CTransportableObject*>(obj)->GetTransporter()->GetPosition();
|
||||
else
|
||||
oPos = obj->GetPosition(0);
|
||||
oPos = obj->GetPosition();
|
||||
|
||||
oPos.y = 0.0f;
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ std::unique_ptr<CExchangePost> CExchangePost::Create(
|
|||
|
||||
obj->CreateShadowCircle(8.0f, 1.0f);
|
||||
|
||||
Math::Vector pos = obj->GetPosition(0);
|
||||
Math::Vector pos = obj->GetPosition();
|
||||
pos.y += params.height;
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
|
||||
|
@ -298,7 +298,7 @@ void CAutoInfo::Start(int param)
|
|||
}
|
||||
|
||||
m_lastParticle = 0;
|
||||
m_goal = m_object->GetPosition(0);
|
||||
m_goal = m_object->GetPosition();
|
||||
|
||||
Math::Vector pos, speed;
|
||||
Math::Point dim;
|
||||
|
|
|
@ -70,7 +70,7 @@ Error CTaskAdvance::Start(float length)
|
|||
m_direction = (length>=0.0f)?1.0f:-1.0f;
|
||||
m_totalLength = fabs(length);
|
||||
m_advanceLength = m_physics->GetLinLength(length);
|
||||
m_startPos = m_object->GetPosition(0);
|
||||
m_startPos = m_object->GetPosition();
|
||||
m_lastDist = 0.0f;
|
||||
m_fixTime = 0.0f;
|
||||
|
||||
|
@ -105,7 +105,7 @@ Error CTaskAdvance::IsEnded()
|
|||
return ERR_MOVE_IMPOSSIBLE;
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
length = Math::DistanceProjected(pos, m_startPos);
|
||||
|
||||
if ( length > m_lastDist ) // forward?
|
||||
|
|
|
@ -103,7 +103,7 @@ bool CTaskBuild::CreateBuilding(Math::Vector pos, float angle)
|
|||
if ( m_type == OBJECT_HUSTON ) m_buildingHeight = 45.0f;
|
||||
m_buildingHeight *= 0.25f;
|
||||
|
||||
m_buildingPos = m_building->GetPosition(0);
|
||||
m_buildingPos = m_building->GetPosition();
|
||||
m_buildingPos.y -= m_buildingHeight;
|
||||
m_building->SetPosition(0, m_buildingPos);
|
||||
return true;
|
||||
|
@ -121,7 +121,7 @@ void CTaskBuild::CreateLight()
|
|||
|
||||
if ( !m_engine->GetLightMode() ) return;
|
||||
|
||||
center = m_metal->GetPosition(0);
|
||||
center = m_metal->GetPosition();
|
||||
|
||||
angle = 0;
|
||||
for ( i=0 ; i<TBMAXLIGHT ; i++ )
|
||||
|
@ -218,7 +218,7 @@ bool CTaskBuild::EventProcess(const Event &event)
|
|||
|
||||
if ( m_phase == TBP_MOVE ) // preliminary forward/backward?
|
||||
{
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_metal->GetPosition(0));
|
||||
dist = Math::Distance(m_object->GetPosition(), m_metal->GetPosition());
|
||||
linSpeed = 0.0f;
|
||||
if ( dist > 30.0f ) linSpeed = 1.0f;
|
||||
if ( dist < 30.0f ) linSpeed = -1.0f;
|
||||
|
@ -251,7 +251,7 @@ bool CTaskBuild::EventProcess(const Event &event)
|
|||
{
|
||||
m_bBuild = true;
|
||||
|
||||
pos = m_metal->GetPosition(0);
|
||||
pos = m_metal->GetPosition();
|
||||
a = m_object->GetAngleY(0);
|
||||
if ( !CreateBuilding(pos, a+Math::PI) )
|
||||
{
|
||||
|
@ -266,7 +266,7 @@ bool CTaskBuild::EventProcess(const Event &event)
|
|||
m_camera->FlushEffect();
|
||||
Abort();
|
||||
m_bError = true;
|
||||
m_main->DisplayError(ERR_TOOMANY, m_object->GetPosition(0));
|
||||
m_main->DisplayError(ERR_TOOMANY, m_object->GetPosition());
|
||||
return false;
|
||||
}
|
||||
CreateLight();
|
||||
|
@ -295,7 +295,7 @@ bool CTaskBuild::EventProcess(const Event &event)
|
|||
{
|
||||
m_lastParticle = m_time;
|
||||
|
||||
pos = m_metal->GetPosition(0);
|
||||
pos = m_metal->GetPosition();
|
||||
speed.x = (Math::Rand()-0.5f)*20.0f;
|
||||
speed.z = (Math::Rand()-0.5f)*20.0f;
|
||||
speed.y = Math::Rand()*10.0f;
|
||||
|
@ -322,7 +322,7 @@ bool CTaskBuild::EventProcess(const Event &event)
|
|||
break;
|
||||
}
|
||||
pos = Transform(*mat, pos);
|
||||
speed = m_metal->GetPosition(0);
|
||||
speed = m_metal->GetPosition();
|
||||
speed.x += (Math::Rand()-0.5f)*5.0f;
|
||||
speed.z += (Math::Rand()-0.5f)*5.0f;
|
||||
speed -= pos;
|
||||
|
@ -332,7 +332,7 @@ bool CTaskBuild::EventProcess(const Event &event)
|
|||
|
||||
if ( Math::Rand() < 0.3f )
|
||||
{
|
||||
m_sound->Play(SOUND_BUILD, m_object->GetPosition(0), 0.5f, 1.0f*Math::Rand()*1.5f);
|
||||
m_sound->Play(SOUND_BUILD, m_object->GetPosition(), 0.5f, 1.0f*Math::Rand()*1.5f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ Error CTaskBuild::Start(ObjectType type)
|
|||
|
||||
m_bError = true; // operation impossible
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( pos.y < m_water->GetLevel() ) return ERR_BUILD_WATER;
|
||||
|
||||
if ( !m_physics->GetLand() ) return ERR_BUILD_FLY;
|
||||
|
@ -387,9 +387,9 @@ Error CTaskBuild::Start(ObjectType type)
|
|||
m_phase = TBP_TURN; // rotation necessary preliminary
|
||||
m_angleY = oAngle; // angle was reached
|
||||
|
||||
pv = m_object->GetPosition(0);
|
||||
pv = m_object->GetPosition();
|
||||
pv.y += 8.3f;
|
||||
pm = m_metal->GetPosition(0);
|
||||
pm = m_metal->GetPosition();
|
||||
m_angleZ = Math::RotateAngle(Math::DistanceProjected(pv, pm), fabs(pv.y-pm.y));
|
||||
|
||||
m_physics->SetFreeze(true); // it does not move
|
||||
|
@ -418,7 +418,7 @@ Error CTaskBuild::IsEnded()
|
|||
{
|
||||
m_physics->SetMotorSpeedZ(0.0f);
|
||||
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_metal->GetPosition(0));
|
||||
dist = Math::Distance(m_object->GetPosition(), m_metal->GetPosition());
|
||||
if ( dist > 30.0f )
|
||||
{
|
||||
time = m_physics->GetLinTimeLength(dist-30.0f, 1.0f);
|
||||
|
@ -437,7 +437,7 @@ Error CTaskBuild::IsEnded()
|
|||
|
||||
if ( m_phase == TBP_MOVE ) // preliminary forward/backward?
|
||||
{
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_metal->GetPosition(0));
|
||||
dist = Math::Distance(m_object->GetPosition(), m_metal->GetPosition());
|
||||
|
||||
if ( dist >= 25.0f && dist <= 35.0f )
|
||||
{
|
||||
|
@ -481,12 +481,12 @@ Error CTaskBuild::IsEnded()
|
|||
{
|
||||
if ( m_progress < 1.0f ) return ERR_CONTINUE;
|
||||
|
||||
m_soundChannel = m_sound->Play(SOUND_TREMBLE, m_object->GetPosition(0), 0.0f, 1.0f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_TREMBLE, m_object->GetPosition(), 0.0f, 1.0f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.7f, 1.0f, 1.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.7f, 1.5f, 7.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 1.5f, 2.0f, SOPER_STOP);
|
||||
|
||||
m_camera->StartEffect(Gfx::CAM_EFFECT_VIBRATION, m_metal->GetPosition(0), 1.0f);
|
||||
m_camera->StartEffect(Gfx::CAM_EFFECT_VIBRATION, m_metal->GetPosition(), 1.0f);
|
||||
|
||||
m_phase = TBP_BUILD;
|
||||
m_speed = 1.0f/10.f; // duration of 10s
|
||||
|
@ -497,7 +497,7 @@ Error CTaskBuild::IsEnded()
|
|||
{
|
||||
if ( m_progress < 1.0f ) return ERR_CONTINUE;
|
||||
|
||||
DeleteMark(m_metal->GetPosition(0), 20.0f);
|
||||
DeleteMark(m_metal->GetPosition(), 20.0f);
|
||||
|
||||
CObjectManager::GetInstancePointer()->DeleteObject(m_metal);
|
||||
m_metal = nullptr;
|
||||
|
@ -599,7 +599,7 @@ Error CTaskBuild::FlatFloor()
|
|||
if ( m_type == OBJECT_DESTROYER) radius = 20.0f;
|
||||
//if ( radius == 0.0f ) return ERR_GENERIC;
|
||||
|
||||
center = m_metal->GetPosition(0);
|
||||
center = m_metal->GetPosition();
|
||||
angle = m_terrain->GetFineSlope(center);
|
||||
bLittleFlat = ( angle < Gfx::TERRAIN_FLATLIMIT);
|
||||
|
||||
|
@ -625,7 +625,7 @@ Error CTaskBuild::FlatFloor()
|
|||
type = pObj->GetType();
|
||||
if ( type == OBJECT_BASE )
|
||||
{
|
||||
Math::Vector oPos = pObj->GetPosition(0);
|
||||
Math::Vector oPos = pObj->GetPosition();
|
||||
dist = Math::Distance(center, oPos)-80.0f;
|
||||
if ( dist < max )
|
||||
{
|
||||
|
@ -725,7 +725,7 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
|
|||
float min, iAngle, a, aa, aBest, distance, magic;
|
||||
bool bMetal;
|
||||
|
||||
iPos = m_object->GetPosition(0);
|
||||
iPos = m_object->GetPosition();
|
||||
iAngle = m_object->GetAngleY(0);
|
||||
iAngle = Math::NormAngle(iAngle); // 0..2*Math::PI
|
||||
|
||||
|
@ -742,7 +742,7 @@ CObject* CTaskBuild::SearchMetalObject(float &angle, float dMin, float dMax,
|
|||
|
||||
bMetal = true; // metal exists
|
||||
|
||||
oPos = pObj->GetPosition(0);
|
||||
oPos = pObj->GetPosition();
|
||||
distance = Math::Distance(oPos, iPos);
|
||||
a = Math::RotateAngle(oPos.x-iPos.x, iPos.z-oPos.z); // CW!
|
||||
|
||||
|
@ -797,7 +797,7 @@ void CTaskBuild::DeleteMark(Math::Vector pos, float radius)
|
|||
type != OBJECT_MARKKEYd &&
|
||||
type != OBJECT_MARKPOWER ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float distance = Math::Distance(oPos, pos);
|
||||
if ( distance <= radius )
|
||||
{
|
||||
|
|
|
@ -258,7 +258,7 @@ bool CTaskFire::EventProcess(const Event &event)
|
|||
if ( m_bRay && m_lastSound <= 0.0f )
|
||||
{
|
||||
m_lastSound = Math::Rand()*0.4f+0.4f;
|
||||
m_sound->Play(SOUND_FIREp, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_FIREp, m_object->GetPosition());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -331,7 +331,7 @@ Error CTaskFire::Start(float delay)
|
|||
|
||||
if ( m_bOrganic )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(SOUND_FIREi, m_object->GetPosition(0), 1.0f, 1.0f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_FIREi, m_object->GetPosition(), 1.0f, 1.0f, true);
|
||||
if ( m_soundChannel != -1 )
|
||||
{
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, m_delay, SOPER_CONTINUE);
|
||||
|
@ -343,7 +343,7 @@ Error CTaskFire::Start(float delay)
|
|||
}
|
||||
else
|
||||
{
|
||||
m_soundChannel = m_sound->Play(SOUND_FIRE, m_object->GetPosition(0), 1.0f, 1.0f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_FIRE, m_object->GetPosition(), 1.0f, 1.0f, true);
|
||||
if ( m_soundChannel != -1 )
|
||||
{
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, m_delay, SOPER_CONTINUE);
|
||||
|
|
|
@ -100,7 +100,7 @@ Error CTaskFireAnt::Start(Math::Vector impact)
|
|||
|
||||
m_physics->SetMotorSpeed(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_angle = Math::RotateAngle(m_impact.x-pos.x, pos.z-m_impact.z); // CW !
|
||||
|
||||
m_phase = TFA_TURN;
|
||||
|
|
|
@ -77,7 +77,7 @@ Error CTaskFlag::Start(TaskFlagOrder order, int rank)
|
|||
m_bError = true; // operation impossible
|
||||
if ( !m_physics->GetLand() )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( pos.y < m_water->GetLevel() ) return ERR_FLAG_WATER;
|
||||
return ERR_FLAG_FLY;
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ Error CTaskFlag::CreateFlag(int rank)
|
|||
CObject* pObj = SearchNearest(pos, OBJECT_NULL);
|
||||
if ( pObj != nullptr )
|
||||
{
|
||||
float dist = Math::Distance(pos, pObj->GetPosition(0));
|
||||
float dist = Math::Distance(pos, pObj->GetPosition());
|
||||
if ( dist < 10.0f )
|
||||
{
|
||||
return ERR_FLAG_PROXY;
|
||||
|
@ -224,7 +224,7 @@ Error CTaskFlag::DeleteFlag()
|
|||
Math::Vector iPos, oPos;
|
||||
float iAngle, angle, aLimit, dist;
|
||||
|
||||
iPos = m_object->GetPosition(0);
|
||||
iPos = m_object->GetPosition();
|
||||
iAngle = m_object->GetAngleY(0);
|
||||
iAngle = Math::NormAngle(iAngle); // 0..2*Math::PI
|
||||
|
||||
|
@ -233,13 +233,13 @@ Error CTaskFlag::DeleteFlag()
|
|||
{
|
||||
return ERR_FLAG_DELETE;
|
||||
}
|
||||
dist = Math::Distance(iPos, pObj->GetPosition(0));
|
||||
dist = Math::Distance(iPos, pObj->GetPosition());
|
||||
if ( dist > 10.0f )
|
||||
{
|
||||
return ERR_FLAG_DELETE;
|
||||
}
|
||||
|
||||
oPos = pObj->GetPosition(0);
|
||||
oPos = pObj->GetPosition();
|
||||
angle = Math::RotateAngle(oPos.x-iPos.x, iPos.z-oPos.z); // CW !
|
||||
aLimit = 45.0f*Math::PI/180.0f;
|
||||
if ( !Math::TestAngle(angle, iAngle-aLimit, iAngle+aLimit) )
|
||||
|
|
|
@ -95,7 +95,7 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
{
|
||||
m_leakTime += event.rTime;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
|
||||
rot.x = m_leakPos.x-pos.x;
|
||||
rot.y = m_leakPos.z-pos.z;
|
||||
|
@ -140,10 +140,10 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
if ( m_bmStep == 0 )
|
||||
{
|
||||
// Frees the area around the departure.
|
||||
BitmapClearCircle(m_object->GetPosition(0), BM_DIM_STEP*1.8f);
|
||||
BitmapClearCircle(m_object->GetPosition(), BM_DIM_STEP*1.8f);
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
|
||||
if ( m_bmCargoObject == 0 )
|
||||
{
|
||||
|
@ -163,7 +163,7 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
if ( m_physics->GetLand() ) m_phase = TGP_BEAMWCOLD;
|
||||
else m_phase = TGP_BEAMGOTO;
|
||||
m_bmIndex = 0;
|
||||
m_bmWatchDogPos = m_object->GetPosition(0);
|
||||
m_bmWatchDogPos = m_object->GetPosition();
|
||||
m_bmWatchDogTime = 0.0f;
|
||||
}
|
||||
if ( ret == ERR_GOTO_IMPOSSIBLE || ret == ERR_GOTO_ITER )
|
||||
|
@ -192,7 +192,7 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
m_physics->SetCollision(false); // there's more
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
|
||||
if ( m_physics->GetType() == TYPE_FLYING && m_altitude == 0.0f )
|
||||
{
|
||||
|
@ -314,7 +314,7 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
}
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
|
||||
if ( m_altitude > 0.0f )
|
||||
{
|
||||
|
@ -348,13 +348,13 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
m_physics->GetType() == TYPE_FLYING &&
|
||||
m_altitude > 0.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
dist = Math::DistanceProjected(m_goal, pos);
|
||||
factor = (dist-20.0f)/20.0f;
|
||||
if ( factor < 0.0f ) factor = 0.0f;
|
||||
if ( factor > 1.0f ) factor = 1.0f;
|
||||
|
||||
h = m_terrain->GetHeightToFloor(m_object->GetPosition(0), true, true);
|
||||
h = m_terrain->GetHeightToFloor(m_object->GetPosition(), true, true);
|
||||
linSpeed = 0.0f;
|
||||
if ( h < (m_altitude-0.5f)*factor && factor == 1.0f )
|
||||
{
|
||||
|
@ -381,7 +381,7 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
}
|
||||
|
||||
#if 0
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
a = m_object->GetAngleY(0);
|
||||
g = Math::RotateAngle(m_goal.x-pos.x, pos.z-m_goal.z); // CW !
|
||||
cirSpeed = Math::Direction(a, g)*1.0f;
|
||||
|
@ -397,7 +397,7 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
linSpeed = 0.0f; // turns first, then advance
|
||||
}
|
||||
#else
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
|
||||
rot.x = m_goal.x-pos.x;
|
||||
rot.y = m_goal.z-pos.z;
|
||||
|
@ -500,7 +500,7 @@ bool CTaskGoto::EventProcess(const Event &event)
|
|||
|
||||
CObject* CTaskGoto::WormSearch(Math::Vector &impact)
|
||||
{
|
||||
Math::Vector iPos = m_object->GetPosition(0);
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
float min = 1000000.0f;
|
||||
|
||||
CObject* best = nullptr;
|
||||
|
@ -565,7 +565,7 @@ CObject* CTaskGoto::WormSearch(Math::Vector &impact)
|
|||
}
|
||||
if ( best == nullptr ) return nullptr;
|
||||
|
||||
impact = best->GetPosition(0);
|
||||
impact = best->GetPosition();
|
||||
return best;
|
||||
}
|
||||
|
||||
|
@ -586,7 +586,7 @@ void CTaskGoto::WormFrame(float rTime)
|
|||
pObj = WormSearch(impact);
|
||||
if ( pObj != 0 )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
dist = Math::Distance(pos, impact);
|
||||
if ( dist <= 15.0f )
|
||||
{
|
||||
|
@ -651,7 +651,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude,
|
|||
m_bmCargoObject = 0;
|
||||
m_bmFinalMove = 0.0f;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
dist = Math::DistanceProjected(pos, m_goal);
|
||||
if ( dist < 10.0f && m_crashMode == TGC_BEAM )
|
||||
{
|
||||
|
@ -686,7 +686,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude,
|
|||
target = SearchTarget(goal, 1.0f);
|
||||
if ( target != 0 )
|
||||
{
|
||||
m_goal = target->GetPosition(0);
|
||||
m_goal = target->GetPosition();
|
||||
dist = 0.0f;
|
||||
if ( !AdjustBuilding(m_goal, 1.0f, dist) )
|
||||
{
|
||||
|
@ -705,7 +705,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude,
|
|||
target = SearchTarget(goal, 1.0f);
|
||||
if ( target != 0 )
|
||||
{
|
||||
m_goal = target->GetPosition(0);
|
||||
m_goal = target->GetPosition();
|
||||
dist = 4.0f;
|
||||
if ( AdjustBuilding(m_goal, 1.0f, dist) )
|
||||
{
|
||||
|
@ -728,7 +728,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude,
|
|||
|
||||
if ( m_physics->GetType() == TYPE_FLYING && m_altitude == 0.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
dist = Math::DistanceProjected(pos, m_goal);
|
||||
if ( dist > FLY_DIST_GROUND ) // over 20 meters?
|
||||
{
|
||||
|
@ -763,7 +763,7 @@ Error CTaskGoto::IsEnded()
|
|||
if ( m_engine->GetPause() ) return ERR_CONTINUE;
|
||||
if ( m_error != ERR_OK ) return m_error;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
|
||||
if ( m_phase == TGP_BEAMLEAK ) // leak?
|
||||
{
|
||||
|
@ -922,7 +922,7 @@ Error CTaskGoto::IsEnded()
|
|||
m_physics->SetMotorSpeedZ(0.0f); // stops the rotation
|
||||
if ( m_bmFinalMove == 0.0f ) return ERR_STOP;
|
||||
|
||||
m_bmFinalPos = m_object->GetPosition(0);
|
||||
m_bmFinalPos = m_object->GetPosition();
|
||||
m_bmFinalDist = m_physics->GetLinLength(m_bmFinalMove);
|
||||
m_bmTimeLimit = m_physics->GetLinTimeLength(fabs(m_bmFinalMove))*1.5f;
|
||||
if ( m_bmTimeLimit < 0.5f ) m_bmTimeLimit = 0.5f;
|
||||
|
@ -1013,7 +1013,7 @@ Error CTaskGoto::IsEnded()
|
|||
return ERR_STOP;
|
||||
}
|
||||
|
||||
dist = Math::Distance(m_bmFinalPos, m_object->GetPosition(0));
|
||||
dist = Math::Distance(m_bmFinalPos, m_object->GetPosition());
|
||||
if ( dist < m_bmFinalDist ) return ERR_CONTINUE;
|
||||
m_physics->SetMotorSpeedX(0.0f); // stops the advance
|
||||
return ERR_STOP;
|
||||
|
@ -1045,7 +1045,7 @@ bool CTaskGoto::AdjustTarget(CObject* pObj, Math::Vector &pos, float &distance)
|
|||
if ( type == OBJECT_BEE ||
|
||||
type == OBJECT_WORM )
|
||||
{
|
||||
pos = pObj->GetPosition(0);
|
||||
pos = pObj->GetPosition();
|
||||
return false; // single approach
|
||||
}
|
||||
|
||||
|
@ -1077,8 +1077,8 @@ bool CTaskGoto::AdjustTarget(CObject* pObj, Math::Vector &pos, float &distance)
|
|||
type == OBJECT_RUINmobiler1 ||
|
||||
type == OBJECT_RUINmobiler2 )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
goal = pObj->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
goal = pObj->GetPosition();
|
||||
dist = Math::Distance(goal, pos);
|
||||
pos = (pos-goal)*(TAKE_DIST+distance)/dist + goal;
|
||||
return true; // approach from all sites
|
||||
|
@ -1086,8 +1086,8 @@ bool CTaskGoto::AdjustTarget(CObject* pObj, Math::Vector &pos, float &distance)
|
|||
|
||||
if ( type == OBJECT_BASE )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
goal = pObj->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
goal = pObj->GetPosition();
|
||||
dist = Math::Distance(goal, pos);
|
||||
pos = (pos-goal)*(TAKE_DIST+distance)/dist + goal;
|
||||
return true; // approach from all sites
|
||||
|
@ -1136,7 +1136,7 @@ bool CTaskGoto::AdjustTarget(CObject* pObj, Math::Vector &pos, float &distance)
|
|||
return false; // single approach
|
||||
}
|
||||
|
||||
pos = pObj->GetPosition(0);
|
||||
pos = pObj->GetPosition();
|
||||
distance = 0.0f;
|
||||
return false; // single approach
|
||||
}
|
||||
|
@ -1363,7 +1363,7 @@ void CTaskGoto::ComputeRepulse(Math::Point &dir)
|
|||
if ( pObj == m_object ) continue;
|
||||
if (IsObjectBeingTransported(pObj)) continue;
|
||||
|
||||
oPos = pObj->GetPosition(0);
|
||||
oPos = pObj->GetPosition();
|
||||
dist = Math::Distance(oPos, m_goalObject);
|
||||
if ( dist <= 1.0f ) continue;
|
||||
|
||||
|
@ -1627,7 +1627,7 @@ void CTaskGoto::BeamStart()
|
|||
BitmapOpen();
|
||||
BitmapObject();
|
||||
|
||||
min = m_object->GetPosition(0);
|
||||
min = m_object->GetPosition();
|
||||
max = m_goal;
|
||||
if ( min.x > max.x ) Math::Swap(min.x, max.x);
|
||||
if ( min.z > max.z ) Math::Swap(min.z, max.z);
|
||||
|
@ -1881,7 +1881,7 @@ void CTaskGoto::BitmapObject()
|
|||
if ( pObj == m_bmCargoObject ) continue;
|
||||
if (IsObjectBeingTransported(pObj)) continue;
|
||||
|
||||
float h = m_terrain->GetFloorLevel(pObj->GetPosition(0), false);
|
||||
float h = m_terrain->GetFloorLevel(pObj->GetPosition(), false);
|
||||
if ( m_physics->GetType() == TYPE_FLYING && m_altitude > 0.0f )
|
||||
{
|
||||
h += m_altitude;
|
||||
|
|
|
@ -114,7 +114,7 @@ Error CTaskGunGoal::Start(float dirV, float dirH)
|
|||
if ( m_finalDirV != m_initialDirV ||
|
||||
m_finalDirH != m_initialDirH )
|
||||
{
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.3f, 1.5f, true);
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.3f, 1.5f, true);
|
||||
m_sound->AddEnvelope(i, 0.3f, 1.5f, 1.0f/m_speed, SOPER_STOP);
|
||||
}
|
||||
|
||||
|
|
|
@ -98,17 +98,17 @@ Error CTaskInfo::Start(const char *name, float value, float power, bool send)
|
|||
Math::Vector pos, goal;
|
||||
if (op == 0) // transmission?
|
||||
{
|
||||
pos = exchangePost->GetPosition(0);
|
||||
pos = exchangePost->GetPosition();
|
||||
pos.y += 9.5f;
|
||||
goal = m_object->GetPosition(0);
|
||||
goal = m_object->GetPosition();
|
||||
goal.y += 4.0f;
|
||||
m_particle->CreateRay(pos, goal, Gfx::PARTIRAY3, Math::Point(2.0f, 2.0f), 1.0f);
|
||||
}
|
||||
if (op == 2) // reception?
|
||||
{
|
||||
goal = exchangePost->GetPosition(0);
|
||||
goal = exchangePost->GetPosition();
|
||||
goal.y += 9.5f;
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 4.0f;
|
||||
m_particle->CreateRay(pos, goal, Gfx::PARTIRAY3, Math::Point(2.0f, 2.0f), 1.0f);
|
||||
}
|
||||
|
|
|
@ -336,11 +336,11 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
|||
|
||||
m_carrierObject->SetCargo(nullptr); // lick the ball
|
||||
dynamic_cast<CTransportableObject*>(other)->SetTransporter(nullptr);
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y -= 3.0f;
|
||||
other->SetPosition(0, pos);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 2.0f;
|
||||
m_object->SetPosition(0, pos); // against the top of jump
|
||||
|
||||
|
@ -485,7 +485,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
|||
}
|
||||
}
|
||||
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_targetPos);
|
||||
dist = Math::Distance(m_object->GetPosition(), m_targetPos);
|
||||
len = dist-TAKE_DIST;
|
||||
if ( m_arm == TMA_OTHER ) len -= TAKE_DIST_OTHER;
|
||||
if ( len < 0.0f ) len = 0.0f;
|
||||
|
@ -572,7 +572,7 @@ Error CTaskManip::IsEnded()
|
|||
if ( m_timeLimit <= 0.0f )
|
||||
{
|
||||
//OK 1.9
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_targetPos);
|
||||
dist = Math::Distance(m_object->GetPosition(), m_targetPos);
|
||||
if ( dist <= m_advanceLength + 2.0f )
|
||||
{
|
||||
m_move = 0.0f; // advance ended
|
||||
|
@ -590,7 +590,7 @@ Error CTaskManip::IsEnded()
|
|||
}
|
||||
}
|
||||
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_targetPos);
|
||||
dist = Math::Distance(m_object->GetPosition(), m_targetPos);
|
||||
if ( dist <= m_advanceLength )
|
||||
{
|
||||
m_move = 0.0f; // advance ended
|
||||
|
@ -640,7 +640,7 @@ Error CTaskManip::IsEnded()
|
|||
(m_cargoType == OBJECT_POWER ||
|
||||
m_cargoType == OBJECT_ATOMIC ) )
|
||||
{
|
||||
m_sound->Play(SOUND_POWEROFF, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_POWEROFF, m_object->GetPosition());
|
||||
}
|
||||
m_arm = TMA_STOCK;
|
||||
InitAngle();
|
||||
|
@ -663,7 +663,7 @@ Error CTaskManip::IsEnded()
|
|||
(m_cargoType == OBJECT_POWER ||
|
||||
m_cargoType == OBJECT_ATOMIC ) )
|
||||
{
|
||||
m_sound->Play(SOUND_POWERON, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_POWERON, m_object->GetPosition());
|
||||
}
|
||||
if (cargo != nullptr && m_cargoType == OBJECT_METAL && m_arm == TMA_FFRONT)
|
||||
{
|
||||
|
@ -728,7 +728,7 @@ CObject* CTaskManip::SearchTakeUnderObject(Math::Vector &pos, float dLimit)
|
|||
ObjectType type;
|
||||
float min, distance;
|
||||
|
||||
iPos = m_object->GetPosition(0);
|
||||
iPos = m_object->GetPosition();
|
||||
|
||||
min = 1000000.0f;
|
||||
pBest = 0;
|
||||
|
@ -754,7 +754,7 @@ CObject* CTaskManip::SearchTakeUnderObject(Math::Vector &pos, float dLimit)
|
|||
if ( pObj->GetLock() ) continue;
|
||||
if ( pObj->GetZoomY(0) != 1.0f ) continue;
|
||||
|
||||
oPos = pObj->GetPosition(0);
|
||||
oPos = pObj->GetPosition();
|
||||
distance = Math::Distance(oPos, iPos);
|
||||
if ( distance <= dLimit &&
|
||||
distance < min )
|
||||
|
@ -765,7 +765,7 @@ CObject* CTaskManip::SearchTakeUnderObject(Math::Vector &pos, float dLimit)
|
|||
}
|
||||
if ( pBest != 0 )
|
||||
{
|
||||
pos = pBest->GetPosition(0);
|
||||
pos = pBest->GetPosition();
|
||||
}
|
||||
return pBest;
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ CObject* CTaskManip::SearchTakeFrontObject(bool bAdvance, Math::Vector &pos,
|
|||
ObjectType type;
|
||||
float min, iAngle, bAngle, aLimit, dLimit, f;
|
||||
|
||||
iPos = m_object->GetPosition(0);
|
||||
iPos = m_object->GetPosition();
|
||||
iAngle = m_object->GetAngleY(0);
|
||||
iAngle = Math::NormAngle(iAngle); // 0..2*Math::PI
|
||||
|
||||
|
@ -826,7 +826,7 @@ CObject* CTaskManip::SearchTakeFrontObject(bool bAdvance, Math::Vector &pos,
|
|||
if ( pObj->GetLock() ) continue;
|
||||
if ( pObj->GetZoomY(0) != 1.0f ) continue;
|
||||
|
||||
oPos = pObj->GetPosition(0);
|
||||
oPos = pObj->GetPosition();
|
||||
distance = fabs(Math::Distance(oPos, iPos)-TAKE_DIST);
|
||||
f = 1.0f-distance/50.0f;
|
||||
if ( f < 0.5f ) f = 0.5f;
|
||||
|
@ -851,7 +851,7 @@ CObject* CTaskManip::SearchTakeFrontObject(bool bAdvance, Math::Vector &pos,
|
|||
}
|
||||
else
|
||||
{
|
||||
pos = pBest->GetPosition(0);
|
||||
pos = pBest->GetPosition();
|
||||
distance = min;
|
||||
angle = bAngle;
|
||||
}
|
||||
|
@ -868,7 +868,7 @@ CObject* CTaskManip::SearchTakeBackObject(bool bAdvance, Math::Vector &pos,
|
|||
ObjectType type;
|
||||
float min, iAngle, bAngle, aLimit, dLimit, f;
|
||||
|
||||
iPos = m_object->GetPosition(0);
|
||||
iPos = m_object->GetPosition();
|
||||
iAngle = m_object->GetAngleY(0)+Math::PI;
|
||||
iAngle = Math::NormAngle(iAngle); // 0..2*Math::PI
|
||||
|
||||
|
@ -913,7 +913,7 @@ CObject* CTaskManip::SearchTakeBackObject(bool bAdvance, Math::Vector &pos,
|
|||
if ( pObj->GetLock() ) continue;
|
||||
if ( pObj->GetZoomY(0) != 1.0f ) continue;
|
||||
|
||||
oPos = pObj->GetPosition(0);
|
||||
oPos = pObj->GetPosition();
|
||||
distance = fabs(Math::Distance(oPos, iPos)-TAKE_DIST);
|
||||
f = 1.0f-distance/50.0f;
|
||||
if ( f < 0.5f ) f = 0.5f;
|
||||
|
@ -938,7 +938,7 @@ CObject* CTaskManip::SearchTakeBackObject(bool bAdvance, Math::Vector &pos,
|
|||
}
|
||||
else
|
||||
{
|
||||
pos = pBest->GetPosition(0);
|
||||
pos = pBest->GetPosition();
|
||||
distance = min;
|
||||
angle = bAngle;
|
||||
}
|
||||
|
@ -1364,7 +1364,7 @@ bool CTaskManip::IsFreeDeposeObject(Math::Vector pos)
|
|||
|
||||
void CTaskManip::SoundManip(float time, float amplitude, float frequency)
|
||||
{
|
||||
int i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f*frequency, true);
|
||||
int i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.3f*frequency, true);
|
||||
m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, 0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, time-0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.0f, 0.3f*frequency, 0.1f, SOPER_STOP);
|
||||
|
|
|
@ -243,7 +243,7 @@ void CTaskPen::SoundManip(float time, float amplitude, float frequency)
|
|||
{
|
||||
int i;
|
||||
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f*frequency, true);
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.3f*frequency, true);
|
||||
m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, 0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.5f*amplitude, 1.0f*frequency, time-0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.0f, 0.3f*frequency, 0.1f, SOPER_STOP);
|
||||
|
|
|
@ -93,7 +93,7 @@ bool CTaskRecover::EventProcess(const Event &event)
|
|||
|
||||
if ( m_phase == TRP_MOVE ) // preliminary forward/backward?
|
||||
{
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_ruin->GetPosition(0));
|
||||
dist = Math::Distance(m_object->GetPosition(), m_ruin->GetPosition());
|
||||
linSpeed = 0.0f;
|
||||
if ( dist > RECOVER_DIST ) linSpeed = 1.0f;
|
||||
if ( dist < RECOVER_DIST ) linSpeed = -1.0f;
|
||||
|
@ -200,8 +200,8 @@ Error CTaskRecover::Start()
|
|||
if ( m_ruin == 0 ) return ERR_RECOVER_NULL;
|
||||
m_ruin->SetLock(true); // ruin no longer usable
|
||||
|
||||
Math::Vector iPos = m_object->GetPosition(0);
|
||||
Math::Vector oPos = m_ruin->GetPosition(0);
|
||||
Math::Vector iPos = m_object->GetPosition();
|
||||
Math::Vector oPos = m_ruin->GetPosition();
|
||||
m_angle = Math::RotateAngle(oPos.x-iPos.x, iPos.z-oPos.z); // CW !
|
||||
|
||||
m_metal = 0;
|
||||
|
@ -240,7 +240,7 @@ Error CTaskRecover::IsEnded()
|
|||
{
|
||||
m_physics->SetMotorSpeedZ(0.0f);
|
||||
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_ruin->GetPosition(0));
|
||||
dist = Math::Distance(m_object->GetPosition(), m_ruin->GetPosition());
|
||||
if ( dist > RECOVER_DIST )
|
||||
{
|
||||
time = m_physics->GetLinTimeLength(dist-RECOVER_DIST, 1.0f);
|
||||
|
@ -259,7 +259,7 @@ Error CTaskRecover::IsEnded()
|
|||
|
||||
if ( m_phase == TRP_MOVE ) // preliminary advance?
|
||||
{
|
||||
dist = Math::Distance(m_object->GetPosition(0), m_ruin->GetPosition(0));
|
||||
dist = Math::Distance(m_object->GetPosition(), m_ruin->GetPosition());
|
||||
|
||||
if ( dist >= RECOVER_DIST-1.0f &&
|
||||
dist <= RECOVER_DIST+1.0f )
|
||||
|
@ -271,7 +271,7 @@ Error CTaskRecover::IsEnded()
|
|||
pos = Transform(*mat, pos); // position in front
|
||||
m_recoverPos = pos;
|
||||
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.9f, true);
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.9f, true);
|
||||
m_sound->AddEnvelope(i, 1.0f, 1.5f, 0.3f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 1.0f, 1.5f, 1.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.0f, 0.9f, 0.3f, SOPER_STOP);
|
||||
|
@ -310,7 +310,7 @@ Error CTaskRecover::IsEnded()
|
|||
m_particle->CreateRay(pos, goal, Gfx::PARTIRAY2,
|
||||
Math::Point(2.0f, 2.0f), 8.0f);
|
||||
|
||||
m_soundChannel = m_sound->Play(SOUND_RECOVER, m_ruin->GetPosition(0), 0.0f, 1.0f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_RECOVER, m_ruin->GetPosition(), 0.0f, 1.0f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.6f, 1.0f, 2.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.6f, 1.0f, 4.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.7f, 2.0f, SOPER_STOP);
|
||||
|
@ -329,7 +329,7 @@ Error CTaskRecover::IsEnded()
|
|||
|
||||
m_soundChannel = -1;
|
||||
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.9f, true);
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.9f, true);
|
||||
m_sound->AddEnvelope(i, 1.0f, 1.5f, 0.3f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 1.0f, 1.5f, 1.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.0f, 0.9f, 0.3f, SOPER_STOP);
|
||||
|
|
|
@ -193,7 +193,7 @@ Error CTaskReset::Start(Math::Vector goal, Math::Vector angle)
|
|||
return ERR_OK;
|
||||
}
|
||||
|
||||
m_begin = m_object->GetPosition(0);
|
||||
m_begin = m_object->GetPosition();
|
||||
m_goal = goal;
|
||||
m_angle = angle;
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ Error CTaskSearch::Start()
|
|||
|
||||
m_camera->StartCentering(m_object, Math::PI*0.50f, 99.9f, 0.0f, 1.0f);
|
||||
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f, true);
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.3f, true);
|
||||
m_sound->AddEnvelope(i, 0.5f, 1.0f, 0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.5f, 1.0f, 0.9f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.0f, 0.3f, 0.1f, SOPER_STOP);
|
||||
|
@ -186,7 +186,7 @@ Error CTaskSearch::IsEnded()
|
|||
|
||||
if ( m_phase == TSP_DOWN )
|
||||
{
|
||||
m_sound->Play(SOUND_REPAIR, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_REPAIR, m_object->GetPosition());
|
||||
|
||||
m_phase = TSP_SEARCH;
|
||||
m_speed = 1.0f/4.0f;
|
||||
|
@ -200,7 +200,7 @@ Error CTaskSearch::IsEnded()
|
|||
m_hand = TSH_UP;
|
||||
InitAngle();
|
||||
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(0), 0.0f, 0.3f, true);
|
||||
i = m_sound->Play(SOUND_MANIP, m_object->GetPosition(), 0.0f, 0.3f, true);
|
||||
m_sound->AddEnvelope(i, 0.5f, 1.0f, 0.1f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.5f, 1.0f, 0.9f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(i, 0.0f, 0.3f, 0.1f, SOPER_STOP);
|
||||
|
|
|
@ -558,7 +558,7 @@ void CTaskShield::IncreaseShield()
|
|||
type == OBJECT_BEE ||
|
||||
type == OBJECT_WORM ) continue;
|
||||
|
||||
Math::Vector oPos = obj->GetPosition(0);
|
||||
Math::Vector oPos = obj->GetPosition();
|
||||
float dist = Math::Distance(oPos, m_shieldPos);
|
||||
if ( dist <= GetRadius()+10.0f )
|
||||
{
|
||||
|
|
|
@ -102,7 +102,7 @@ Error CTaskTake::Start()
|
|||
m_bError = true; // operation impossible
|
||||
if ( !m_physics->GetLand() )
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
float h = m_water->GetLevel(m_object);
|
||||
if ( pos.y < h ) return ERR_MANIP_WATER; // impossible under water
|
||||
return ERR_MANIP_FLY;
|
||||
|
@ -122,7 +122,7 @@ Error CTaskTake::Start()
|
|||
|
||||
if ( m_order == TTO_TAKE )
|
||||
{
|
||||
Math::Vector pos = m_object->GetPosition(0);
|
||||
Math::Vector pos = m_object->GetPosition();
|
||||
float h = m_water->GetLevel(m_object);
|
||||
if ( pos.y < h ) return ERR_MANIP_WATER; // impossible under water
|
||||
|
||||
|
@ -244,7 +244,7 @@ Error CTaskTake::IsEnded()
|
|||
(m_cargoType == OBJECT_POWER ||
|
||||
m_cargoType == OBJECT_ATOMIC ) )
|
||||
{
|
||||
m_sound->Play(SOUND_POWEROFF, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_POWEROFF, m_object->GetPosition());
|
||||
}
|
||||
}
|
||||
m_motion->SetAction(MHS_UPRIGHT, 0.4f); // gets up
|
||||
|
@ -265,7 +265,7 @@ Error CTaskTake::IsEnded()
|
|||
(m_cargoType == OBJECT_POWER ||
|
||||
m_cargoType == OBJECT_ATOMIC ) )
|
||||
{
|
||||
m_sound->Play(SOUND_POWERON, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_POWERON, m_object->GetPosition());
|
||||
}
|
||||
if ( cargo != nullptr && m_cargoType == OBJECT_METAL && m_arm == TTA_FFRONT )
|
||||
{
|
||||
|
@ -304,7 +304,7 @@ CObject* CTaskTake::SearchTakeObject(float &angle,
|
|||
ObjectType type;
|
||||
float min, iAngle, bAngle, a, distance;
|
||||
|
||||
iPos = m_object->GetPosition(0);
|
||||
iPos = m_object->GetPosition();
|
||||
iAngle = m_object->GetAngleY(0);
|
||||
iAngle = Math::NormAngle(iAngle); // 0..2*Math::PI
|
||||
|
||||
|
@ -333,7 +333,7 @@ CObject* CTaskTake::SearchTakeObject(float &angle,
|
|||
if ( pObj->GetLock() ) continue;
|
||||
if ( pObj->GetZoomY(0) != 1.0f ) continue;
|
||||
|
||||
oPos = pObj->GetPosition(0);
|
||||
oPos = pObj->GetPosition();
|
||||
distance = Math::Distance(oPos, iPos);
|
||||
if ( distance >= 4.0f-dLimit &&
|
||||
distance <= 4.0f+dLimit )
|
||||
|
|
|
@ -83,7 +83,7 @@ bool CTaskTerraform::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_soundChannel == -1 )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(SOUND_GGG, m_object->GetPosition(0), 1.0f, 0.5f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_GGG, m_object->GetPosition(), 1.0f, 0.5f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 2.0f, 4.0f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 0.0f, 0.5f, 0.5f, SOPER_STOP);
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ bool CTaskTerraform::EventProcess(const Event &event)
|
|||
speed.z = Math::Rand()*2.0f;
|
||||
speed.y = 2.5f+Math::Rand()*1.0f;
|
||||
speed = Math::Transform(*mat, speed);
|
||||
speed -= m_object->GetPosition(0);
|
||||
speed -= m_object->GetPosition();
|
||||
dim.x = Math::Rand()*1.0f+1.0f;
|
||||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE1, 3.0f);
|
||||
|
@ -179,7 +179,7 @@ bool CTaskTerraform::EventProcess(const Event &event)
|
|||
speed.z = -Math::Rand()*2.0f;
|
||||
speed.y = 2.5f+Math::Rand()*1.0f;
|
||||
speed = Math::Transform(*mat, speed);
|
||||
speed -= m_object->GetPosition(0);
|
||||
speed -= m_object->GetPosition();
|
||||
dim.x = Math::Rand()*1.0f+1.0f;
|
||||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTISMOKE1, 3.0f);
|
||||
|
@ -362,7 +362,7 @@ bool CTaskTerraform::Terraform()
|
|||
// This was used by Ceebot-Teen to destroy objects hit by the Thumper
|
||||
// The old Teen objects are removed, but this code might be reused at some point, e.g. to add destruction of resources like empty batteries
|
||||
|
||||
dist = Math::Distance(m_terraPos, pObj->GetPosition(0));
|
||||
dist = Math::Distance(m_terraPos, pObj->GetPosition());
|
||||
if ( dist > 20.0f ) continue;
|
||||
|
||||
m_engine->GetPyroManager()->Create(Gfx::PT_FRAGT, pObj);
|
||||
|
@ -372,7 +372,7 @@ bool CTaskTerraform::Terraform()
|
|||
motion = pObj->GetMotion();
|
||||
if ( motion == 0 ) continue;
|
||||
|
||||
dist = Math::Distance(m_terraPos, pObj->GetPosition(0));
|
||||
dist = Math::Distance(m_terraPos, pObj->GetPosition());
|
||||
if ( dist > ACTION_RADIUS ) continue;
|
||||
|
||||
if ( type == OBJECT_ANT )
|
||||
|
|
|
@ -883,7 +883,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime)
|
|||
|
||||
if ( m_type == TYPE_FLYING && !m_bLand && motorSpeed.y > 0.0f )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
h = m_terrain->GetFlyingLimit(pos, type==OBJECT_BEE);
|
||||
h += m_object->GetCharacter()->height;
|
||||
if ( pos.y > h-40.0f ) // almost at the top?
|
||||
|
@ -909,7 +909,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime)
|
|||
m_reactorRange = 1.0f;
|
||||
if ( m_bLowLevel && m_object->GetSelect() ) // beep cool?
|
||||
{
|
||||
m_sound->Play(SOUND_INFO, m_object->GetPosition(0), 1.0f, 2.0f);
|
||||
m_sound->Play(SOUND_INFO, m_object->GetPosition(), 1.0f, 2.0f);
|
||||
m_bLowLevel = false;
|
||||
}
|
||||
}
|
||||
|
@ -999,7 +999,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime)
|
|||
m_linMotion.motorAccel.x = m_linMotion.stopAccel.x*factor;
|
||||
m_cirMotion.motorAccel.y = m_cirMotion.stopAccel.y*factor;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
h = m_terrain->GetFlyingLimit(pos, type==OBJECT_BEE);
|
||||
h += m_object->GetCharacter()->height;
|
||||
if ( motorSpeed.y > 0.0f && m_reactorRange > 0.1f && pos.y < h )
|
||||
|
@ -1058,7 +1058,7 @@ void CPhysics::EffectUpdate(float aTime, float rTime)
|
|||
ObjectType type;
|
||||
bool bOnBoard;
|
||||
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition(0)) ) return;
|
||||
if ( !m_engine->IsVisiblePoint(m_object->GetPosition()) ) return;
|
||||
|
||||
type = m_object->GetType();
|
||||
character = m_object->GetCharacter();
|
||||
|
@ -1497,8 +1497,8 @@ bool CPhysics::EventFrame(const Event &event)
|
|||
EffectUpdate(m_time, event.rTime);
|
||||
WaterFrame(m_time, event.rTime);
|
||||
|
||||
iPos = pos = m_object->GetPosition(0);
|
||||
iAngle = angle = m_object->GetAngle(0);
|
||||
iPos = pos = m_object->GetPosition();
|
||||
iAngle = angle = m_object->GetRotation();
|
||||
|
||||
// Accelerate is the descent, brake is the ascent.
|
||||
if ( m_bFreeze || m_object->GetDead() )
|
||||
|
@ -1619,7 +1619,7 @@ bool CPhysics::EventFrame(const Event &event)
|
|||
|
||||
if ( m_bLand && m_fallingHeight != 0.0f ) // if fell
|
||||
{
|
||||
float force = (m_fallingHeight - m_object->GetPosition(0).y) * m_fallDamageFraction;
|
||||
float force = (m_fallingHeight - m_object->GetPosition().y) * m_fallDamageFraction;
|
||||
m_object->ExplodeObject(ExplosionType::Bang, force);
|
||||
m_fallingHeight = 0.0f;
|
||||
}
|
||||
|
@ -1642,7 +1642,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f && m_object->GetActive() )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTm, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_INSECTm, m_object->GetPosition());
|
||||
if ( m_bMotor ) m_lastSoundInsect = 0.4f+Math::Rand()*2.5f;
|
||||
else m_lastSoundInsect = 1.5f+Math::Rand()*4.0f;
|
||||
}
|
||||
|
@ -1654,7 +1654,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTa, m_object->GetPosition(0), 1.0f, 1.5f+Math::Rand()*0.5f);
|
||||
m_sound->Play(SOUND_INSECTa, m_object->GetPosition(), 1.0f, 1.5f+Math::Rand()*0.5f);
|
||||
m_lastSoundInsect = 0.4f+Math::Rand()*0.6f;
|
||||
}
|
||||
}
|
||||
|
@ -1662,7 +1662,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTa, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_INSECTa, m_object->GetPosition());
|
||||
if ( m_bMotor ) m_lastSoundInsect = 0.4f+Math::Rand()*2.5f;
|
||||
else m_lastSoundInsect = 1.5f+Math::Rand()*4.0f;
|
||||
}
|
||||
|
@ -1674,7 +1674,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTb, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_INSECTb, m_object->GetPosition());
|
||||
if ( m_bMotor ) m_lastSoundInsect = 0.4f+Math::Rand()*2.5f;
|
||||
else m_lastSoundInsect = 1.5f+Math::Rand()*4.0f;
|
||||
}
|
||||
|
@ -1683,7 +1683,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTb, m_object->GetPosition(0), 1.0f, 1.5f+Math::Rand()*0.5f);
|
||||
m_sound->Play(SOUND_INSECTb, m_object->GetPosition(), 1.0f, 1.5f+Math::Rand()*0.5f);
|
||||
m_lastSoundInsect = 0.3f+Math::Rand()*0.5f;
|
||||
}
|
||||
}
|
||||
|
@ -1694,7 +1694,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTw, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_INSECTw, m_object->GetPosition());
|
||||
if ( m_bMotor ) m_lastSoundInsect = 0.4f+Math::Rand()*2.5f;
|
||||
else m_lastSoundInsect = 1.5f+Math::Rand()*4.0f;
|
||||
}
|
||||
|
@ -1703,7 +1703,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTw, m_object->GetPosition(0), 1.0f, 1.5f+Math::Rand()*0.5f);
|
||||
m_sound->Play(SOUND_INSECTw, m_object->GetPosition(), 1.0f, 1.5f+Math::Rand()*0.5f);
|
||||
m_lastSoundInsect = 0.2f+Math::Rand()*0.2f;
|
||||
}
|
||||
}
|
||||
|
@ -1715,7 +1715,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTs, m_object->GetPosition(0), 1.0f, 1.5f+Math::Rand()*0.5f);
|
||||
m_sound->Play(SOUND_INSECTs, m_object->GetPosition(), 1.0f, 1.5f+Math::Rand()*0.5f);
|
||||
m_lastSoundInsect = 0.4f+Math::Rand()*0.6f;
|
||||
}
|
||||
}
|
||||
|
@ -1723,7 +1723,7 @@ void CPhysics::SoundMotor(float rTime)
|
|||
{
|
||||
if ( m_lastSoundInsect <= 0.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_INSECTs, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_INSECTs, m_object->GetPosition());
|
||||
if ( m_bMotor ) m_lastSoundInsect = 0.4f+Math::Rand()*2.5f;
|
||||
else m_lastSoundInsect = 1.5f+Math::Rand()*4.0f;
|
||||
}
|
||||
|
@ -1782,7 +1782,7 @@ void CPhysics::WaterFrame(float aTime, float rTime)
|
|||
if (IsObjectBeingTransported(m_object)) return;
|
||||
|
||||
// Management of flames into the lava.
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( m_water->GetLava() &&
|
||||
pos.y-m_object->GetCharacter()->height <= level )
|
||||
{
|
||||
|
@ -1790,7 +1790,7 @@ void CPhysics::WaterFrame(float aTime, float rTime)
|
|||
{
|
||||
m_lastFlameParticle = aTime;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*3.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*3.0f;
|
||||
speed.x = 0.0f;
|
||||
|
@ -1800,7 +1800,7 @@ void CPhysics::WaterFrame(float aTime, float rTime)
|
|||
dim.y = dim.x;
|
||||
m_particle->CreateParticle(pos, speed, dim, Gfx::PARTIFLAME, 2.0f, 0.0f, 0.2f);
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y -= 2.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*5.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*5.0f;
|
||||
|
@ -1813,7 +1813,7 @@ void CPhysics::WaterFrame(float aTime, float rTime)
|
|||
}
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( pos.y >= m_water->GetLevel(m_object) ) return; // out of water?
|
||||
|
||||
type = m_object->GetType();
|
||||
|
@ -1871,13 +1871,13 @@ void CPhysics::SoundMotorFull(float rTime, ObjectType type)
|
|||
{
|
||||
if ( m_soundChannel == -1 )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(SOUND_MOTORi, m_object->GetPosition(0), 0.0f, 1.0f, true);
|
||||
m_soundChannel = m_sound->Play(SOUND_MOTORi, m_object->GetPosition(), 0.0f, 1.0f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, 0.2f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, 1.0f, SOPER_LOOP);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sound->Position(m_soundChannel, m_object->GetPosition(0));
|
||||
m_sound->Position(m_soundChannel, m_object->GetPosition());
|
||||
}
|
||||
|
||||
freq = 1.0f+m_linMotion.terrainSpeed.x/50.0f;
|
||||
|
@ -1944,13 +1944,13 @@ void CPhysics::SoundMotorFull(float rTime, ObjectType type)
|
|||
|
||||
if ( m_soundChannel == -1 )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(sound, m_object->GetPosition(0), 0.0f, 0.5f, true);
|
||||
m_soundChannel = m_sound->Play(sound, m_object->GetPosition(), 0.0f, 0.5f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, amplitude, freq, time, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, amplitude, freq, 1.0f, SOPER_LOOP);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sound->Position(m_soundChannel, m_object->GetPosition(0));
|
||||
m_sound->Position(m_soundChannel, m_object->GetPosition());
|
||||
|
||||
if ( m_bSoundSlow ) // in slow motion?
|
||||
{
|
||||
|
@ -2038,13 +2038,13 @@ void CPhysics::SoundMotorSlow(float rTime, ObjectType type)
|
|||
|
||||
if ( m_soundChannel == -1 )
|
||||
{
|
||||
m_soundChannel = m_sound->Play(sound, m_object->GetPosition(0), 0.0f, 0.25f, true);
|
||||
m_soundChannel = m_sound->Play(sound, m_object->GetPosition(), 0.0f, 0.25f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, amplitude, 0.5f, 0.2f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, amplitude, 0.5f, 1.0f, SOPER_LOOP);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sound->Position(m_soundChannel, m_object->GetPosition(0));
|
||||
m_sound->Position(m_soundChannel, m_object->GetPosition());
|
||||
|
||||
if ( !m_bSoundSlow ) // full power?
|
||||
{
|
||||
|
@ -2066,8 +2066,8 @@ void CPhysics::SoundMotorSlow(float rTime, ObjectType type)
|
|||
{
|
||||
amplitude = 0.5f-m_soundTimePshhh*0.08f;
|
||||
if ( amplitude > 1.0f ) amplitude = 1.0f;
|
||||
//? m_sound->Play(SOUND_PSHHH, m_object->GetPosition(0), amplitude);
|
||||
m_sound->Play(SOUND_PSHHH, m_object->GetPosition(0), 1.0f);
|
||||
//? m_sound->Play(SOUND_PSHHH, m_object->GetPosition(), amplitude);
|
||||
m_sound->Play(SOUND_PSHHH, m_object->GetPosition(), 1.0f);
|
||||
|
||||
m_soundTimePshhh = 4.0f+4.0f*Math::Rand();
|
||||
|
||||
|
@ -2156,13 +2156,13 @@ void CPhysics::SoundReactorFull(float rTime, ObjectType type)
|
|||
sound = SOUND_FLY;
|
||||
}
|
||||
|
||||
m_soundChannel = m_sound->Play(sound, m_object->GetPosition(0), 0.0f, 1.0f, true);
|
||||
m_soundChannel = m_sound->Play(sound, m_object->GetPosition(), 0.0f, 1.0f, true);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, 0.6f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannel, 1.0f, 1.0f, 1.0f, SOPER_LOOP);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sound->Position(m_soundChannel, m_object->GetPosition(0));
|
||||
m_sound->Position(m_soundChannel, m_object->GetPosition());
|
||||
}
|
||||
|
||||
freq = 1.0f + m_linMotion.realSpeed.y/100.0f;
|
||||
|
@ -2181,8 +2181,8 @@ void CPhysics::SoundReactorFull(float rTime, ObjectType type)
|
|||
if ( m_timeReactorFail <= m_time )
|
||||
{
|
||||
freq = 1.0f+Math::Rand()*0.5f;
|
||||
m_sound->Play(SOUND_FLYf, m_object->GetPosition(0), 1.0f, freq);
|
||||
m_camera->StartEffect(Gfx::CAM_EFFECT_PET, m_object->GetPosition(0), 1.0f);
|
||||
m_sound->Play(SOUND_FLYf, m_object->GetPosition(), 1.0f, freq);
|
||||
m_camera->StartEffect(Gfx::CAM_EFFECT_PET, m_object->GetPosition(), 1.0f);
|
||||
|
||||
for ( i=0 ; i<5 ; i++ )
|
||||
{
|
||||
|
@ -2266,11 +2266,11 @@ void CPhysics::SoundReactorStop(float rTime, ObjectType type)
|
|||
{
|
||||
if ( m_soundChannelSlide == -1 )
|
||||
{
|
||||
m_soundChannelSlide = m_sound->Play(SOUND_SLIDE, m_object->GetPosition(0), 0.0f, 1.0f, true);
|
||||
m_soundChannelSlide = m_sound->Play(SOUND_SLIDE, m_object->GetPosition(), 0.0f, 1.0f, true);
|
||||
m_sound->AddEnvelope(m_soundChannelSlide, 0.5f, 1.0f, 0.3f, SOPER_CONTINUE);
|
||||
m_sound->AddEnvelope(m_soundChannelSlide, 0.5f, 1.0f, 1.0f, SOPER_LOOP);
|
||||
}
|
||||
m_sound->Position(m_soundChannelSlide, m_object->GetPosition(0));
|
||||
m_sound->Position(m_soundChannelSlide, m_object->GetPosition());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2349,7 +2349,7 @@ void CPhysics::FloorAdapt(float aTime, float rTime,
|
|||
m_soundTimeBoum = aTime;
|
||||
}
|
||||
|
||||
//? pos = m_object->GetPosition(0); // gives position before collision
|
||||
//? pos = m_object->GetPosition(); // gives position before collision
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2519,7 +2519,7 @@ int CPhysics::ObjectAdapt(const Math::Vector &pos, const Math::Vector &angle)
|
|||
Math::Vector iiPos = firstCrashSphere.sphere.pos;
|
||||
float iRad = firstCrashSphere.sphere.radius;
|
||||
|
||||
iPos = iiPos + (pos - m_object->GetPosition(0));
|
||||
iPos = iiPos + (pos - m_object->GetPosition());
|
||||
iType = m_object->GetType();
|
||||
|
||||
for (CObject* pObj : CObjectManager::GetInstancePointer()->GetAllObjects())
|
||||
|
@ -2575,22 +2575,22 @@ int CPhysics::ObjectAdapt(const Math::Vector &pos, const Math::Vector &angle)
|
|||
!m_object->GetResetBusy() &&
|
||||
m_object->GetTrainer() ) // driving vehicle?
|
||||
{
|
||||
Math::Vector oPos = pObj->GetPosition(0);
|
||||
Math::Vector oPos = pObj->GetPosition();
|
||||
distance = Math::DistanceProjected(oPos, iPos);
|
||||
if ( distance < 4.0f )
|
||||
{
|
||||
m_sound->Play(SOUND_WAYPOINT, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_WAYPOINT, m_object->GetPosition());
|
||||
m_engine->GetPyroManager()->Create(Gfx::PT_WPCHECK, pObj);
|
||||
}
|
||||
}
|
||||
|
||||
if ( oType == OBJECT_TARGET2 )
|
||||
{
|
||||
Math::Vector oPos = pObj->GetPosition(0);
|
||||
Math::Vector oPos = pObj->GetPosition();
|
||||
distance = Math::Distance(oPos, iPos);
|
||||
if ( distance < 10.0f*1.5f )
|
||||
{
|
||||
m_sound->Play(SOUND_WAYPOINT, m_object->GetPosition(0));
|
||||
m_sound->Play(SOUND_WAYPOINT, m_object->GetPosition());
|
||||
m_engine->GetPyroManager()->Create(Gfx::PT_WPCHECK, pObj);
|
||||
}
|
||||
}
|
||||
|
@ -2631,11 +2631,11 @@ int CPhysics::ObjectAdapt(const Math::Vector &pos, const Math::Vector &angle)
|
|||
if ( volume > 1.0f ) volume = 1.0f;
|
||||
if ( crashSphere.sound != SOUND_CLICK )
|
||||
{
|
||||
m_sound->Play(crashSphere.sound, m_object->GetPosition(0), volume);
|
||||
m_sound->Play(crashSphere.sound, m_object->GetPosition(), volume);
|
||||
}
|
||||
if ( iType == OBJECT_HUMAN && volume > 0.5f )
|
||||
{
|
||||
m_sound->Play(SOUND_AIE, m_object->GetPosition(0), volume);
|
||||
m_sound->Play(SOUND_AIE, m_object->GetPosition(), volume);
|
||||
}
|
||||
|
||||
if ( m_repeatCollision > 0 )
|
||||
|
@ -2660,7 +2660,7 @@ int CPhysics::ObjectAdapt(const Math::Vector &pos, const Math::Vector &angle)
|
|||
ph = pObj->GetPhysics();
|
||||
if ( ph != 0 )
|
||||
{
|
||||
oAngle = pObj->GetAngle(0);
|
||||
oAngle = pObj->GetRotation();
|
||||
oSpeed = Normalize(oPos-iPos)*force;
|
||||
Math::LoadRotationXZYMatrix(matRotate, -oAngle);
|
||||
oSpeed = Transform(matRotate, oSpeed);
|
||||
|
@ -2728,7 +2728,7 @@ bool CPhysics::JostleObject(CObject* pObj, float force)
|
|||
if ( m_soundTimeJostle >= 0.20f )
|
||||
{
|
||||
m_soundTimeJostle = 0.0f;
|
||||
m_sound->Play(SOUND_JOSTLE, pObj->GetPosition(0), force);
|
||||
m_sound->Play(SOUND_JOSTLE, pObj->GetPosition(), force);
|
||||
}
|
||||
|
||||
return jostleableObject->JostleObject(force);
|
||||
|
@ -3095,7 +3095,7 @@ void CPhysics::CrashParticle(float crash)
|
|||
|
||||
if ( crash < 0.2f ) return;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
m_camera->StartEffect(Gfx::CAM_EFFECT_CRASH, pos, crash);
|
||||
|
||||
//? max = (int)(crash*50.0f);
|
||||
|
@ -3156,7 +3156,7 @@ void CPhysics::MotorParticle(float aTime, float rTime)
|
|||
nb = static_cast<int>(20.0f-(20.0f/delay)*m_timeUnderWater);
|
||||
for ( i=0 ; i<nb ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += (Math::Rand()-0.5f)*4.0f;
|
||||
pos.y += (Math::Rand()-0.5f)*4.0f;
|
||||
pos.z += (Math::Rand()-0.5f)*4.0f;
|
||||
|
@ -3171,7 +3171,7 @@ void CPhysics::MotorParticle(float aTime, float rTime)
|
|||
}
|
||||
|
||||
level = m_water->GetLevel();
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( type == OBJECT_HUMAN ) pos.y -= 2.0f;
|
||||
if ( pos.y < level ) // underwater?
|
||||
{
|
||||
|
@ -3195,7 +3195,7 @@ void CPhysics::MotorParticle(float aTime, float rTime)
|
|||
nb = static_cast<int>(8.0f*m_absorbWater);
|
||||
for ( i=0 ; i<nb ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
if ( type == OBJECT_HUMAN ) pos.y -= Math::Rand()*2.0f;
|
||||
else pos.y += Math::Rand()*2.0f;
|
||||
pos.x += (Math::Rand()-0.5f)*2.0f;
|
||||
|
@ -3542,7 +3542,7 @@ void CPhysics::MotorParticle(float aTime, float rTime)
|
|||
if ( aTime-m_lastSoundWater > 1.5f )
|
||||
{
|
||||
m_lastSoundWater = aTime;
|
||||
m_sound->Play(SOUND_BLUP, m_object->GetPosition(0), 0.5f+Math::Rand()*0.5f);
|
||||
m_sound->Play(SOUND_BLUP, m_object->GetPosition(), 0.5f+Math::Rand()*0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3568,7 +3568,7 @@ void CPhysics::MotorParticle(float aTime, float rTime)
|
|||
if ( aTime-m_lastSoundWater > 1.5f )
|
||||
{
|
||||
m_lastSoundWater = aTime;
|
||||
m_sound->Play(SOUND_BLUP, m_object->GetPosition(0), 0.5f+Math::Rand()*0.5f);
|
||||
m_sound->Play(SOUND_BLUP, m_object->GetPosition(), 0.5f+Math::Rand()*0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3683,7 +3683,7 @@ void CPhysics::WaterParticle(float aTime, Math::Vector pos, ObjectType type,
|
|||
force *= 1.3f; // a robot is heavier
|
||||
}
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y = m_water->GetLevel()-1.0f;
|
||||
dim.x = 2.0f*force; // height
|
||||
dim.y = diam; // diameter
|
||||
|
@ -3734,7 +3734,7 @@ void CPhysics::WaterParticle(float aTime, Math::Vector pos, ObjectType type,
|
|||
force = (advance+turn)*0.16f;
|
||||
if ( force < 0.001f ) return;
|
||||
|
||||
pos = m_object->GetPosition(0);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y = level+0.1f;
|
||||
if ( advance == 0 )
|
||||
{
|
||||
|
@ -3871,7 +3871,7 @@ Error CPhysics::GetError()
|
|||
void CPhysics::SetFalling()
|
||||
{
|
||||
if (m_fallingHeight == 0.0f && m_floorHeight >= m_minFallingHeight)
|
||||
m_fallingHeight = m_object->GetPosition(0).y;
|
||||
m_fallingHeight = m_object->GetPosition().y;
|
||||
}
|
||||
|
||||
float CPhysics::GetFallingHeight()
|
||||
|
|
|
@ -1131,7 +1131,7 @@ bool CScriptFunctions::rSearch(CBotVar* var, CBotVar* result, int& exception, vo
|
|||
}
|
||||
else
|
||||
{
|
||||
pos = pThis->GetPosition(0);
|
||||
pos = pThis->GetPosition();
|
||||
}
|
||||
|
||||
std::vector<ObjectType> type_v;
|
||||
|
@ -1469,7 +1469,7 @@ bool CScriptFunctions::rDirection(CBotVar* var, CBotVar* result, int& exception,
|
|||
|
||||
if ( !GetPoint(var, exception, oPos) ) return true;
|
||||
|
||||
iPos = pThis->GetPosition(0);
|
||||
iPos = pThis->GetPosition();
|
||||
|
||||
a = pThis->GetAngleY(0);
|
||||
g = Math::RotateAngle(oPos.x-iPos.x, iPos.z-oPos.z); // CW !
|
||||
|
@ -1693,9 +1693,9 @@ bool CScriptFunctions::rProduce(CBotVar* var, CBotVar* result, int& exception, v
|
|||
type = static_cast<ObjectType>(var->GetValInt());
|
||||
var = var->GetNext();
|
||||
|
||||
pos = me->GetPosition(0);
|
||||
pos = me->GetPosition();
|
||||
|
||||
Math::Vector rotation = me->GetAngle(0) + me->GetTilt();
|
||||
Math::Vector rotation = me->GetRotation() + me->GetTilt();
|
||||
angle = rotation.y;
|
||||
|
||||
if ( var != nullptr )
|
||||
|
@ -1871,7 +1871,7 @@ bool CScriptFunctions::rSpace(CBotVar* var, CBotVar* result, int& exception, voi
|
|||
|
||||
if ( var == 0 )
|
||||
{
|
||||
center = pThis->GetPosition(0);
|
||||
center = pThis->GetPosition();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -118,7 +118,7 @@ void CDisplayText::DisplayError(Error err, CObject* pObj, float time)
|
|||
|
||||
if ( pObj == 0 ) return;
|
||||
|
||||
pos = pObj->GetPosition(0);
|
||||
pos = pObj->GetPosition();
|
||||
h = GetIdealHeight(pObj);
|
||||
d = GetIdealDist(pObj);
|
||||
DisplayError(err, pos, h, d, time);
|
||||
|
@ -178,7 +178,7 @@ void CDisplayText::DisplayText(const char *text, CObject* pObj,
|
|||
|
||||
if ( pObj == 0 ) return;
|
||||
|
||||
pos = pObj->GetPosition(0);
|
||||
pos = pObj->GetPosition();
|
||||
h = GetIdealHeight(pObj);
|
||||
d = GetIdealDist(pObj);
|
||||
DisplayText(text, pos, h, d, time, type);
|
||||
|
|
|
@ -1150,7 +1150,7 @@ void CMap::UpdateObject(CObject* pObj)
|
|||
if (IsObjectBeingTransported(pObj)) return;
|
||||
|
||||
type = pObj->GetType();
|
||||
pos = pObj->GetPosition(0);
|
||||
pos = pObj->GetPosition();
|
||||
dir = -(pObj->GetAngleY(0)+Math::PI/2.0f);
|
||||
|
||||
if ( m_angle != 0.0f )
|
||||
|
|
Loading…
Reference in New Issue