Refactor old Get/SetPosition -> Get/SetPartPosition
parent
7c229b4e83
commit
1183ed1980
|
@ -904,7 +904,7 @@ bool CPyro::EventProcess(const Event &event)
|
|||
|
||||
Math::Vector pos = m_pos;
|
||||
pos.y += factor;
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
|
||||
if ( m_progress > 0.85f )
|
||||
{
|
||||
|
@ -1570,7 +1570,9 @@ void CPyro::ExploStart()
|
|||
m_engine->ChangeSecondTexture(objRank, "dirty04.png");
|
||||
}
|
||||
|
||||
Math::Vector pos = m_object->GetPosition(i);
|
||||
// TODO: temporary hack (hopefully)
|
||||
assert(m_object->Implements(ObjectInterfaceType::Old));
|
||||
Math::Vector pos = dynamic_cast<COldObject*>(m_object)->GetPartPosition(i);
|
||||
|
||||
Math::Vector speed;
|
||||
float weight;
|
||||
|
@ -2084,7 +2086,11 @@ void CPyro::BurnAddPart(int part, Math::Vector pos, Math::Vector angle)
|
|||
{
|
||||
int i = m_burnPartTotal;
|
||||
m_burnPart[i].part = part;
|
||||
m_burnPart[i].initialPos = m_object->GetPosition(part);
|
||||
|
||||
// TODO: temporary hack (hopefully)
|
||||
assert(m_object->Implements(ObjectInterfaceType::Old));
|
||||
m_burnPart[i].initialPos = dynamic_cast<COldObject*>(m_object)->GetPartPosition(part);
|
||||
|
||||
m_burnPart[i].finalPos = m_burnPart[i].initialPos+pos;
|
||||
m_burnPart[i].initialAngle = m_object->GetAngle(part);
|
||||
m_burnPart[i].finalAngle = m_burnPart[i].initialAngle+angle;
|
||||
|
@ -2103,7 +2109,10 @@ void CPyro::BurnProgress()
|
|||
if ( h > m_burnFall ) h = m_burnFall;
|
||||
pos.y -= h;
|
||||
}
|
||||
m_object->SetPosition(m_burnPart[i].part, pos);
|
||||
|
||||
// TODO: temporary hack (hopefully)
|
||||
assert(m_object->Implements(ObjectInterfaceType::Old));
|
||||
dynamic_cast<COldObject*>(m_object)->SetPartPosition(m_burnPart[i].part, pos);
|
||||
|
||||
pos = m_burnPart[i].initialAngle + m_progress*(m_burnPart[i].finalAngle-m_burnPart[i].initialAngle);
|
||||
m_object->SetAngle(m_burnPart[i].part, pos);
|
||||
|
@ -2298,7 +2307,7 @@ void CPyro::FallProgress(float rTime)
|
|||
pos.y = m_fallFloor;
|
||||
floor = true;
|
||||
}
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
|
||||
if (m_object->GetType() == OBJECT_BULLET)
|
||||
{
|
||||
|
|
|
@ -152,8 +152,8 @@ begin:
|
|||
m_object->SetAngleZ(1+i, Math::PI/2.0f-124.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(18+i, 10.0f*Math::PI/180.0f);
|
||||
m_object->SetPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
}
|
||||
|
||||
pObj = m_main->GetSelectObject();
|
||||
|
@ -183,8 +183,8 @@ begin:
|
|||
m_object->SetAngleZ(1+i, Math::PI/2.0f-124.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(18+i, 10.0f*Math::PI/180.0f);
|
||||
m_object->SetPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,7 +231,7 @@ begin:
|
|||
m_finalPos = pos;
|
||||
pos.z += BASE_PORTICO_TIME_MOVE*5.0f; // back
|
||||
pos.y += 10.0f; // rises (the gate)
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
MoveCargo(); // all cargo moves
|
||||
|
||||
m_phase = ABP_PORTICO_MOVE;
|
||||
|
@ -253,7 +253,7 @@ begin:
|
|||
pos = m_object->GetPosition();
|
||||
pos.y += 10000.0f; // in space
|
||||
m_finalPos = pos;
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
|
||||
m_main->SetMovieLock(true); // blocks everything until the end of the landing
|
||||
m_bMotor = true; // lights the jet engine
|
||||
|
@ -328,7 +328,7 @@ begin:
|
|||
{
|
||||
pos = m_pos;
|
||||
pos.y += powf(1.0f-m_progress, 2.0f)*300.0f;
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
MoveCargo(); // all cargo moves
|
||||
|
||||
vibCir.z = sinf(m_time*Math::PI* 2.01f)*(Math::PI/150.0f)+
|
||||
|
@ -405,7 +405,7 @@ begin:
|
|||
{
|
||||
m_bMotor = false; // put out the reactor
|
||||
|
||||
m_object->SetPosition(0, m_pos); // setting down
|
||||
m_object->SetPosition(m_pos); // setting down
|
||||
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
MoveCargo(); // all cargo moves
|
||||
|
||||
|
@ -536,8 +536,8 @@ begin:
|
|||
len = 7.0f-m_progress*(7.0f+11.5f);
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPosition(10+i, Math::Vector(23.5f, 0.0f, len));
|
||||
m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, -len));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, len));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, -len));
|
||||
m_object->SetAngleX(10+i, -10.0f*Math::PI/180.0f*m_progress);
|
||||
m_object->SetAngleX(18+i, 10.0f*Math::PI/180.0f*m_progress);
|
||||
}
|
||||
|
@ -561,8 +561,8 @@ begin:
|
|||
{
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetAngleX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(18+i, 10.0f*Math::PI/180.0f);
|
||||
}
|
||||
|
@ -615,8 +615,8 @@ begin:
|
|||
len = 7.0f-(1.0f-m_progress)*(7.0f+11.5f);
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPosition(10+i, Math::Vector(23.5f, 0.0f, len));
|
||||
m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, -len));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, len));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, -len));
|
||||
m_object->SetAngleX(10+i, -10.0f*Math::PI/180.0f*(1.0f-m_progress));
|
||||
m_object->SetAngleX(18+i, 10.0f*Math::PI/180.0f*(1.0f-m_progress));
|
||||
}
|
||||
|
@ -625,8 +625,8 @@ begin:
|
|||
{
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
{
|
||||
m_object->SetPosition(10+i, Math::Vector(23.5f, 0.0f, 7.0f));
|
||||
m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, -7.0f));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, 7.0f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, -7.0f));
|
||||
m_object->SetAngleX(10+i, 0.0f);
|
||||
m_object->SetAngleX(18+i, 0.0f);
|
||||
}
|
||||
|
@ -736,7 +736,7 @@ begin:
|
|||
{
|
||||
pos = m_pos;
|
||||
pos.y += powf(m_progress, 2.0f)*600.0f;
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
MoveCargo(); // all cargo moves
|
||||
|
||||
vibCir.z = sinf(m_time*Math::PI*19.01f)*(Math::PI/400.0f);
|
||||
|
@ -818,7 +818,7 @@ begin:
|
|||
{
|
||||
pos = m_object->GetPosition();
|
||||
pos.z -= event.rTime*5.0f;
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
MoveCargo(); // all cargo moves
|
||||
}
|
||||
else
|
||||
|
@ -845,7 +845,7 @@ begin:
|
|||
{
|
||||
pos = m_object->GetPosition();
|
||||
pos.y -= event.rTime*(10.0f/BASE_PORTICO_TIME_DOWN);
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
MoveCargo(); // all cargo moves
|
||||
}
|
||||
else
|
||||
|
@ -901,7 +901,7 @@ begin:
|
|||
{
|
||||
pos = m_object->GetPosition();
|
||||
pos.x += event.rTime*(2000.0f/BASE_TRANSIT_TIME);
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
pos.x += 60.0f;
|
||||
m_camera->SetScriptLookat(pos);
|
||||
}
|
||||
|
@ -1079,7 +1079,7 @@ bool CAutoBase::Abort()
|
|||
|
||||
if ( m_param == PARAM_PORTICO ) // gate on the porch?
|
||||
{
|
||||
m_object->SetPosition(0, m_finalPos);
|
||||
m_object->SetPosition(m_finalPos);
|
||||
MoveCargo(); // all cargo moves
|
||||
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
|
@ -1087,8 +1087,8 @@ bool CAutoBase::Abort()
|
|||
m_object->SetAngleZ(1+i, Math::PI/2.0f-124.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(18+i, 10.0f*Math::PI/180.0f);
|
||||
m_object->SetPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1101,7 +1101,7 @@ bool CAutoBase::Abort()
|
|||
m_bMotor = false; // put out the jet engine
|
||||
m_bOpen = true;
|
||||
|
||||
m_object->SetPosition(0, m_pos); // setting down
|
||||
m_object->SetPosition(m_pos); // setting down
|
||||
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
MoveCargo(); // all cargo moves
|
||||
for ( i=0 ; i<8 ; i++ )
|
||||
|
@ -1109,8 +1109,8 @@ bool CAutoBase::Abort()
|
|||
m_object->SetAngleZ(1+i, Math::PI/2.0f-124.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(10+i, -10.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleX(18+i, 10.0f*Math::PI/180.0f);
|
||||
m_object->SetPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(23.5f, 0.0f, -11.5f));
|
||||
m_object->SetPartPosition(18+i, Math::Vector(23.5f, 0.0f, 11.5f));
|
||||
}
|
||||
|
||||
m_main->SetMovieLock(false); // you can play!
|
||||
|
@ -1272,7 +1272,7 @@ void CAutoBase::MoveCargo()
|
|||
oPos.y += obj->GetCharacter()->height;
|
||||
oPos.x += sPos.x-m_lastPos.x;
|
||||
oPos.z += sPos.z-m_lastPos.z;
|
||||
obj->SetPosition(0, oPos);
|
||||
obj->SetPosition(oPos);
|
||||
}
|
||||
|
||||
m_lastPos = sPos;
|
||||
|
|
|
@ -157,7 +157,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
pos.x = 0.0f;
|
||||
pos.z = 0.0f;
|
||||
pos.y = -2.0f*Math::Rand();
|
||||
m_object->SetPosition(1, pos); // up / down the drill
|
||||
m_object->SetPartPosition(1, pos); // up / down the drill
|
||||
|
||||
m_object->SetAngleY(1, Math::Rand()*0.5f); // rotates the drill
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
pos.x = 0.0f;
|
||||
pos.z = 0.0f;
|
||||
pos.y = -m_progress*16.0f;
|
||||
m_object->SetPosition(1, pos); // down the drill
|
||||
m_object->SetPartPosition(1, pos); // down the drill
|
||||
|
||||
angle = m_object->GetAngleY(1);
|
||||
angle += event.rTime*8.0f;
|
||||
|
@ -273,7 +273,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
pos.x = 0.0f;
|
||||
pos.z = 0.0f;
|
||||
pos.y = -(1.0f-m_progress)*16.0f;
|
||||
m_object->SetPosition(1, pos); // back the drill
|
||||
m_object->SetPartPosition(1, pos); // back the drill
|
||||
|
||||
angle = m_object->GetAngleY(1);
|
||||
angle -= event.rTime*2.0f;
|
||||
|
@ -368,7 +368,7 @@ bool CAutoDerrick::EventProcess(const Event &event)
|
|||
pos.y = m_cargoPos.y;
|
||||
cargo->SetLock(false); // object usable
|
||||
}
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -505,7 +505,7 @@ void CAutoDerrick::CreateCargo(Math::Vector pos, float angle, ObjectType type,
|
|||
|
||||
pos = cargo->GetPosition();
|
||||
pos.y += height;
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
}
|
||||
|
||||
// Look if there is already a key.
|
||||
|
|
|
@ -176,11 +176,11 @@ bool CAutoDestroyer::EventProcess(const Event &event)
|
|||
{
|
||||
pos = Math::Vector(0.0f, -10.0f, 0.0f);
|
||||
pos.y = -Math::Bounce(m_progress, 0.3f)*10.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, -10.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, -10.0f, 0.0f));
|
||||
m_sound->Play(SOUND_REPAIR, m_object->GetPosition());
|
||||
|
||||
m_phase = ADEP_REPAIR;
|
||||
|
@ -210,11 +210,11 @@ bool CAutoDestroyer::EventProcess(const Event &event)
|
|||
{
|
||||
pos = Math::Vector(0.0f, -10.0f, 0.0f);
|
||||
pos.y = -(1.0f-m_progress)*10.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
|
||||
m_phase = ADEP_WAIT;
|
||||
m_progress = 0.0f;
|
||||
|
|
|
@ -238,11 +238,11 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
pos.x = -9.0f;
|
||||
pos.y = 3.0f+m_progress*10.0f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPosition(1, Math::Vector(-9.0f, 13.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(-9.0f, 13.0f, 0.0f));
|
||||
|
||||
SoundManip(1.5f, 1.0f, 0.5f);
|
||||
m_phase = ALAP_OPEN3;
|
||||
|
@ -398,11 +398,11 @@ bool CAutoLabo::EventProcess(const Event &event)
|
|||
pos.x = -9.0f;
|
||||
pos.y = 3.0f+(1.0f-m_progress)*10.0f;;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPosition(1, Math::Vector(-9.0f, 3.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(-9.0f, 3.0f, 0.0f));
|
||||
|
||||
SoundManip(1.0f, 1.0f, 1.0f);
|
||||
m_phase = ALAP_CLOSE3;
|
||||
|
|
|
@ -387,7 +387,7 @@ void CAutoNuclearPlant::CreatePower()
|
|||
CObject* power = CObjectManager::GetInstancePointer()->CreateObject(pos, angle, OBJECT_ATOMIC, powerLevel);
|
||||
|
||||
dynamic_cast<CTransportableObject*>(power)->SetTransporter(m_object);
|
||||
power->SetPosition(0, Math::Vector(22.0f, 3.0f, 0.0f));
|
||||
power->SetPosition(Math::Vector(22.0f, 3.0f, 0.0f));
|
||||
m_object->SetPower(power);
|
||||
}
|
||||
|
||||
|
|
|
@ -110,10 +110,10 @@ void CAutoPortico::Start(int param)
|
|||
pos = m_object->GetPosition();
|
||||
m_finalPos = pos;
|
||||
pos.z += PORTICO_TIME_MOVE*5.0f; // back to start
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_finalPos.z += PORTICO_TIME_OPEN*5.3f;
|
||||
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, PORTICO_POSa, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, PORTICO_POSa, 0.0f));
|
||||
m_object->SetAngleY(2, PORTICO_ANGLE1a);
|
||||
m_object->SetAngleY(3, PORTICO_ANGLE2a);
|
||||
m_object->SetAngleY(4, PORTICO_ANGLE3a);
|
||||
|
@ -198,7 +198,7 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
{
|
||||
pos = m_object->GetPosition();
|
||||
pos.z -= event.rTime*5.0f; // advance
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
|
||||
m_posTrack += event.rTime*0.5f;
|
||||
UpdateTrackMapping(m_posTrack, m_posTrack);
|
||||
|
@ -233,14 +233,14 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
pos.x = 0.0f;
|
||||
pos.y = Progress(PORTICO_POSa, PORTICO_POSb, m_progress);
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
pos.x = 0.0f;
|
||||
pos.y = PORTICO_POSb;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
|
||||
m_phase = APOP_WAIT2;
|
||||
m_progress = 0.0f;
|
||||
|
@ -274,7 +274,7 @@ bool CAutoPortico::EventProcess(const Event &event)
|
|||
{
|
||||
pos = m_object->GetPosition();
|
||||
pos.z += event.rTime*5.3f; // back
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
|
||||
m_posTrack -= event.rTime*1.0f;
|
||||
UpdateTrackMapping(m_posTrack, m_posTrack);
|
||||
|
@ -353,8 +353,8 @@ bool CAutoPortico::Abort()
|
|||
{
|
||||
CObject* pObj;
|
||||
|
||||
m_object->SetPosition(0, m_finalPos);
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, PORTICO_POSb, 0.0f));
|
||||
m_object->SetPosition(m_finalPos);
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, PORTICO_POSb, 0.0f));
|
||||
m_object->SetAngleY(2, PORTICO_ANGLE1b);
|
||||
m_object->SetAngleY(3, PORTICO_ANGLE2b);
|
||||
m_object->SetAngleY(4, PORTICO_ANGLE3b);
|
||||
|
|
|
@ -322,7 +322,7 @@ bool CAutoPowerPlant::EventProcess(const Event &event)
|
|||
cargo->SetZoom(0, 1.0f);
|
||||
cargo->SetLock(false); // usable battery
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(m_object);
|
||||
cargo->SetPosition(0, Math::Vector(0.0f, 3.0f, 0.0f));
|
||||
cargo->SetPosition(Math::Vector(0.0f, 3.0f, 0.0f));
|
||||
m_object->SetPower(cargo);
|
||||
|
||||
m_main->DisplayError(INFO_ENERGY, m_object);
|
||||
|
@ -454,7 +454,7 @@ void CAutoPowerPlant::CreatePower()
|
|||
|
||||
pos = power->GetPosition();
|
||||
pos.y += 3.0f;
|
||||
power->SetPosition(0, pos);
|
||||
power->SetPosition(pos);
|
||||
}
|
||||
|
||||
// Seeking the battery during manufacture.
|
||||
|
|
|
@ -439,7 +439,7 @@ int CAutoVault::CountKeys()
|
|||
oPos.x = rot.x;
|
||||
oPos.z = rot.y;
|
||||
oPos.y = cPos.y+1.0f;
|
||||
obj->SetPosition(0, oPos);
|
||||
obj->SetPosition(oPos);
|
||||
obj->SetAngleY(0, oAngle+cAngle);
|
||||
m_keyPos[index] = oPos;
|
||||
|
||||
|
@ -499,7 +499,7 @@ void CAutoVault::DownKeys(float progress)
|
|||
if ( dist > 20.0f ) continue;
|
||||
|
||||
oPos.y = cPos.y+1.0f-progress*2.2f;
|
||||
obj->SetPosition(0, oPos);
|
||||
obj->SetPosition(oPos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_VEHICLE); // this is a moving object
|
||||
m_object->SetObjectRank(0, rank);
|
||||
modelManager->AddModelReference("ant1.mod", false, rank);
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_object->SetAngleY(0, angle);
|
||||
|
||||
// A vehicle must have necessarily a collision
|
||||
|
@ -96,7 +96,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("ant2.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(2.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(2.0f, 0.0f, 0.0f));
|
||||
|
||||
// Creates the tail.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -104,7 +104,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("ant3.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(-1.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(-1.0f, 0.0f, 0.0f));
|
||||
|
||||
// Creates a right-back thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -112,7 +112,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(-0.4f, -0.1f, -0.3f));
|
||||
m_object->SetPartPosition(3, Math::Vector(-0.4f, -0.1f, -0.3f));
|
||||
|
||||
// Creates a right-back leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -120,7 +120,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(4, rank);
|
||||
m_object->SetObjectParent(4, 3);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(4, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(4, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates a right-back foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -128,7 +128,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(5, rank);
|
||||
m_object->SetObjectParent(5, 4);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(5, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(5, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates two middle-right thighs.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -136,7 +136,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(0.1f, -0.1f, -0.4f));
|
||||
m_object->SetPartPosition(6, Math::Vector(0.1f, -0.1f, -0.4f));
|
||||
|
||||
// Creates two middle-right legs.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -144,7 +144,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 6);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates two middle-right foots.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -152,7 +152,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 7);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(8, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(8, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates the right front thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -160,7 +160,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(9, rank);
|
||||
m_object->SetObjectParent(9, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(9, Math::Vector(1.4f, -0.1f, -0.6f));
|
||||
m_object->SetPartPosition(9, Math::Vector(1.4f, -0.1f, -0.6f));
|
||||
|
||||
// Creates the right front leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -168,7 +168,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(10, rank);
|
||||
m_object->SetObjectParent(10, 9);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(10, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(10, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates the right front foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -176,7 +176,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(11, rank);
|
||||
m_object->SetObjectParent(11, 10);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(11, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(11, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates a left-back thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -184,7 +184,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(12, rank);
|
||||
m_object->SetObjectParent(12, 0);
|
||||
modelManager->AddModelReference("ant4.mod", true, rank);
|
||||
m_object->SetPosition(12, Math::Vector(-0.4f, -0.1f, 0.3f));
|
||||
m_object->SetPartPosition(12, Math::Vector(-0.4f, -0.1f, 0.3f));
|
||||
|
||||
// Creates a left-back leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -192,7 +192,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(13, rank);
|
||||
m_object->SetObjectParent(13, 12);
|
||||
modelManager->AddModelReference("ant5.mod", true, rank);
|
||||
m_object->SetPosition(13, Math::Vector(0.0f, 0.0f, 1.0f));
|
||||
m_object->SetPartPosition(13, Math::Vector(0.0f, 0.0f, 1.0f));
|
||||
|
||||
// Creates a left-back foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -200,7 +200,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(14, rank);
|
||||
m_object->SetObjectParent(14, 13);
|
||||
modelManager->AddModelReference("ant6.mod", true, rank);
|
||||
m_object->SetPosition(14, Math::Vector(0.0f, 0.0f, 2.0f));
|
||||
m_object->SetPartPosition(14, Math::Vector(0.0f, 0.0f, 2.0f));
|
||||
|
||||
// Creates two middle-left thighs.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -208,7 +208,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(15, rank);
|
||||
m_object->SetObjectParent(15, 0);
|
||||
modelManager->AddModelReference("ant4.mod", true, rank);
|
||||
m_object->SetPosition(15, Math::Vector(0.1f, -0.1f, 0.4f));
|
||||
m_object->SetPartPosition(15, Math::Vector(0.1f, -0.1f, 0.4f));
|
||||
|
||||
// Creates two middle-left legs.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -216,7 +216,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(16, rank);
|
||||
m_object->SetObjectParent(16, 15);
|
||||
modelManager->AddModelReference("ant5.mod", true, rank);
|
||||
m_object->SetPosition(16, Math::Vector(0.0f, 0.0f, 1.0f));
|
||||
m_object->SetPartPosition(16, Math::Vector(0.0f, 0.0f, 1.0f));
|
||||
|
||||
// Creates two middle-left foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -224,7 +224,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(17, rank);
|
||||
m_object->SetObjectParent(17, 16);
|
||||
modelManager->AddModelReference("ant6.mod", true, rank);
|
||||
m_object->SetPosition(17, Math::Vector(0.0f, 0.0f, 2.0f));
|
||||
m_object->SetPartPosition(17, Math::Vector(0.0f, 0.0f, 2.0f));
|
||||
|
||||
// Creates the left front thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -232,7 +232,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(18, rank);
|
||||
m_object->SetObjectParent(18, 0);
|
||||
modelManager->AddModelReference("ant4.mod", true, rank);
|
||||
m_object->SetPosition(18, Math::Vector(1.4f, -0.1f, 0.6f));
|
||||
m_object->SetPartPosition(18, Math::Vector(1.4f, -0.1f, 0.6f));
|
||||
|
||||
// Creates the left front leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -240,7 +240,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(19, rank);
|
||||
m_object->SetObjectParent(19, 18);
|
||||
modelManager->AddModelReference("ant5.mod", true, rank);
|
||||
m_object->SetPosition(19, Math::Vector(0.0f, 0.0f, 1.0f));
|
||||
m_object->SetPartPosition(19, Math::Vector(0.0f, 0.0f, 1.0f));
|
||||
|
||||
// Creates the left front foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -248,7 +248,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(20, rank);
|
||||
m_object->SetObjectParent(20, 19);
|
||||
modelManager->AddModelReference("ant6.mod", true, rank);
|
||||
m_object->SetPosition(20, Math::Vector(0.0f, 0.0f, 2.0f));
|
||||
m_object->SetPartPosition(20, Math::Vector(0.0f, 0.0f, 2.0f));
|
||||
|
||||
m_object->CreateShadowCircle(4.0f, 0.5f);
|
||||
|
||||
|
@ -256,7 +256,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
m_object->SetPosition(pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_VEHICLE); // this is a moving object
|
||||
m_object->SetObjectRank(0, rank);
|
||||
modelManager->AddModelReference("bee1.mod", false, rank);
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_object->SetAngleY(0, angle);
|
||||
|
||||
// A vehicle must have an obligatory collision
|
||||
|
@ -94,7 +94,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("bee2.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(1.6f, 0.3f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(1.6f, 0.3f, 0.0f));
|
||||
|
||||
// Creates the tail.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -102,7 +102,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("bee3.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(-0.8f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(-0.8f, 0.0f, 0.0f));
|
||||
|
||||
// Creates a right-back thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -110,7 +110,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(-0.3f, -0.1f, -0.2f));
|
||||
m_object->SetPartPosition(3, Math::Vector(-0.3f, -0.1f, -0.2f));
|
||||
|
||||
// Creates a right-back leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -118,7 +118,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(4, rank);
|
||||
m_object->SetObjectParent(4, 3);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(4, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(4, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates a right-back foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -126,7 +126,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(5, rank);
|
||||
m_object->SetObjectParent(5, 4);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(5, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(5, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates two middle-right thighs.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -134,7 +134,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(0.3f, -0.1f, -0.4f));
|
||||
m_object->SetPartPosition(6, Math::Vector(0.3f, -0.1f, -0.4f));
|
||||
|
||||
// Creates two middle-right legs.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -142,7 +142,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 6);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates two middle-right feet.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -150,7 +150,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 7);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(8, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(8, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates the right front thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -158,7 +158,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(9, rank);
|
||||
m_object->SetObjectParent(9, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(9, Math::Vector(1.0f, -0.1f, -0.7f));
|
||||
m_object->SetPartPosition(9, Math::Vector(1.0f, -0.1f, -0.7f));
|
||||
|
||||
// Creates the right front leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -166,7 +166,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(10, rank);
|
||||
m_object->SetObjectParent(10, 9);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(10, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(10, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates the right front foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -174,7 +174,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(11, rank);
|
||||
m_object->SetObjectParent(11, 10);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(11, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(11, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates a left-back thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -182,7 +182,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(12, rank);
|
||||
m_object->SetObjectParent(12, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(12, Math::Vector(-0.3f, -0.1f, 0.2f));
|
||||
m_object->SetPartPosition(12, Math::Vector(-0.3f, -0.1f, 0.2f));
|
||||
m_object->SetAngleY(12, Math::PI);
|
||||
|
||||
// Creates a left-back leg.
|
||||
|
@ -191,7 +191,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(13, rank);
|
||||
m_object->SetObjectParent(13, 12);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(13, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(13, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates a left-back foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -199,7 +199,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(14, rank);
|
||||
m_object->SetObjectParent(14, 13);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(14, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(14, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates two middle-left thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -207,7 +207,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(15, rank);
|
||||
m_object->SetObjectParent(15, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(15, Math::Vector(0.3f, -0.1f, 0.4f));
|
||||
m_object->SetPartPosition(15, Math::Vector(0.3f, -0.1f, 0.4f));
|
||||
m_object->SetAngleY(15, Math::PI);
|
||||
|
||||
// Creates two middle-left legs.
|
||||
|
@ -216,7 +216,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(16, rank);
|
||||
m_object->SetObjectParent(16, 15);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(16, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(16, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates two middle-left feet.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -224,7 +224,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(17, rank);
|
||||
m_object->SetObjectParent(17, 16);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(17, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(17, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates front-left thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -232,7 +232,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(18, rank);
|
||||
m_object->SetObjectParent(18, 0);
|
||||
modelManager->AddModelReference("ant4.mod", false, rank);
|
||||
m_object->SetPosition(18, Math::Vector(1.0f, -0.1f, 0.7f));
|
||||
m_object->SetPartPosition(18, Math::Vector(1.0f, -0.1f, 0.7f));
|
||||
m_object->SetAngleY(18, Math::PI);
|
||||
|
||||
// Creates front-left leg.
|
||||
|
@ -241,7 +241,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(19, rank);
|
||||
m_object->SetObjectParent(19, 18);
|
||||
modelManager->AddModelReference("ant5.mod", false, rank);
|
||||
m_object->SetPosition(19, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
m_object->SetPartPosition(19, Math::Vector(0.0f, 0.0f, -1.0f));
|
||||
|
||||
// Creates front-left foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -249,7 +249,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(20, rank);
|
||||
m_object->SetObjectParent(20, 19);
|
||||
modelManager->AddModelReference("ant6.mod", false, rank);
|
||||
m_object->SetPosition(20, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
m_object->SetPartPosition(20, Math::Vector(0.0f, 0.0f, -2.0f));
|
||||
|
||||
// Creates the right wing.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -257,7 +257,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(21, rank);
|
||||
m_object->SetObjectParent(21, 0);
|
||||
modelManager->AddModelReference("bee7.mod", false, rank);
|
||||
m_object->SetPosition(21, Math::Vector(0.8f, 0.4f, -0.5f));
|
||||
m_object->SetPartPosition(21, Math::Vector(0.8f, 0.4f, -0.5f));
|
||||
|
||||
// Creates the left wing.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -265,7 +265,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(22, rank);
|
||||
m_object->SetObjectParent(22, 0);
|
||||
modelManager->AddModelReference("bee7.mod", true, rank);
|
||||
m_object->SetPosition(22, Math::Vector(0.8f, 0.4f, 0.5f));
|
||||
m_object->SetPartPosition(22, Math::Vector(0.8f, 0.4f, 0.5f));
|
||||
|
||||
m_object->CreateShadowCircle(6.0f, 0.5f);
|
||||
|
||||
|
@ -273,7 +273,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
m_object->SetPosition(pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
else if (option == 2) // without a backpack?
|
||||
modelManager->AddModelReference("human1v.mod", false, rank);
|
||||
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_object->SetAngleY(0, angle);
|
||||
|
||||
// A vehicle must have an obligatory collision with a sphere of center (0, y, 0) (see GetCrashSphere).
|
||||
|
@ -181,7 +181,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
modelManager->AddModelReference("human2t.mod", false, rank);
|
||||
}
|
||||
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, 2.7f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 2.7f, 0.0f));
|
||||
if (option == 1 || // head without helmet?
|
||||
option == 2) // without a backpack?
|
||||
{
|
||||
|
@ -206,7 +206,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("human3.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(0.0f, 2.3f, -1.2f));
|
||||
m_object->SetPartPosition(2, Math::Vector(0.0f, 2.3f, -1.2f));
|
||||
m_object->SetAngle(2, Math::Vector(90.0f*Math::PI/180.0f, 90.0f*Math::PI/180.0f, -50.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates the right forearm.
|
||||
|
@ -215,7 +215,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 2);
|
||||
modelManager->AddModelReference("human4r.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(1.3f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(3, Math::Vector(1.3f, 0.0f, 0.0f));
|
||||
m_object->SetAngle(3, Math::Vector(0.0f*Math::PI/180.0f, -20.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates right hand.
|
||||
|
@ -224,7 +224,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(4, rank);
|
||||
m_object->SetObjectParent(4, 3);
|
||||
modelManager->AddModelReference("human5.mod", false, rank);
|
||||
m_object->SetPosition(4, Math::Vector(1.2f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(4, Math::Vector(1.2f, 0.0f, 0.0f));
|
||||
|
||||
// Creates the right thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -232,7 +232,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(5, rank);
|
||||
m_object->SetObjectParent(5, 0);
|
||||
modelManager->AddModelReference("human6.mod", false, rank);
|
||||
m_object->SetPosition(5, Math::Vector(0.0f, 0.0f, -0.7f));
|
||||
m_object->SetPartPosition(5, Math::Vector(0.0f, 0.0f, -0.7f));
|
||||
m_object->SetAngle(5, Math::Vector(10.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates the right leg.
|
||||
|
@ -241,7 +241,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 5);
|
||||
modelManager->AddModelReference("human7.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(0.0f, -1.5f, 0.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(0.0f, -1.5f, 0.0f));
|
||||
m_object->SetAngle(6, Math::Vector(0.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, -10.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates the right foot.
|
||||
|
@ -250,7 +250,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 6);
|
||||
modelManager->AddModelReference("human8.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, -1.5f, 0.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, -1.5f, 0.0f));
|
||||
m_object->SetAngle(7, Math::Vector(-10.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates the left arm.
|
||||
|
@ -259,7 +259,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 0);
|
||||
modelManager->AddModelReference("human3.mod", true, rank);
|
||||
m_object->SetPosition(8, Math::Vector(0.0f, 2.3f, 1.2f));
|
||||
m_object->SetPartPosition(8, Math::Vector(0.0f, 2.3f, 1.2f));
|
||||
m_object->SetAngle(8, Math::Vector(-90.0f*Math::PI/180.0f, -90.0f*Math::PI/180.0f, -50.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates the left forearm.
|
||||
|
@ -268,7 +268,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(9, rank);
|
||||
m_object->SetObjectParent(9, 8);
|
||||
modelManager->AddModelReference("human4l.mod", true, rank);
|
||||
m_object->SetPosition(9, Math::Vector(1.3f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(9, Math::Vector(1.3f, 0.0f, 0.0f));
|
||||
m_object->SetAngle(9, Math::Vector(0.0f*Math::PI/180.0f, 20.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates left hand.
|
||||
|
@ -277,7 +277,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(10, rank);
|
||||
m_object->SetObjectParent(10, 9);
|
||||
modelManager->AddModelReference("human5.mod", true, rank);
|
||||
m_object->SetPosition(10, Math::Vector(1.2f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(10, Math::Vector(1.2f, 0.0f, 0.0f));
|
||||
|
||||
// Creates the left thigh.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -285,7 +285,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(11, rank);
|
||||
m_object->SetObjectParent(11, 0);
|
||||
modelManager->AddModelReference("human6.mod", true, rank);
|
||||
m_object->SetPosition(11, Math::Vector(0.0f, 0.0f, 0.7f));
|
||||
m_object->SetPartPosition(11, Math::Vector(0.0f, 0.0f, 0.7f));
|
||||
m_object->SetAngle(11, Math::Vector(-10.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates the left leg.
|
||||
|
@ -294,7 +294,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(12, rank);
|
||||
m_object->SetObjectParent(12, 11);
|
||||
modelManager->AddModelReference("human7.mod", true, rank);
|
||||
m_object->SetPosition(12, Math::Vector(0.0f, -1.5f, 0.0f));
|
||||
m_object->SetPartPosition(12, Math::Vector(0.0f, -1.5f, 0.0f));
|
||||
m_object->SetAngle(12, Math::Vector(0.0f*Math::PI/180.0f, 0.0f*Math::PI/180.0f, -10.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates the left foot.
|
||||
|
@ -303,7 +303,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(13, rank);
|
||||
m_object->SetObjectParent(13, 12);
|
||||
modelManager->AddModelReference("human8.mod", true, rank);
|
||||
m_object->SetPosition(13, Math::Vector(0.0f, -1.5f, 0.0f));
|
||||
m_object->SetPartPosition(13, Math::Vector(0.0f, -1.5f, 0.0f));
|
||||
m_object->SetAngle(13, Math::Vector(10.0f*Math::PI/180.0f, -5.0f*Math::PI/180.0f, 5.0f*Math::PI/180.0f));
|
||||
|
||||
// Creates the neutron gun.
|
||||
|
@ -314,7 +314,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(14, rank);
|
||||
m_object->SetObjectParent(14, 0);
|
||||
modelManager->AddModelReference("human9.mod", false, rank);
|
||||
m_object->SetPosition(14, Math::Vector(-1.5f, 0.3f, -1.35f));
|
||||
m_object->SetPartPosition(14, Math::Vector(-1.5f, 0.3f, -1.35f));
|
||||
m_object->SetAngleZ(14, Math::PI);
|
||||
}
|
||||
|
||||
|
@ -324,7 +324,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
m_object->SetPosition(pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
}
|
||||
|
@ -1043,17 +1043,17 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
if ( a < -0.2f ) a = -0.2f;
|
||||
if ( a > 0.2f ) a = 0.2f;
|
||||
|
||||
pos = m_object->GetPosition(ii+0);
|
||||
pos = m_object->GetPartPosition(ii+0);
|
||||
pos.y = 0.0f+a;
|
||||
m_object->SetPosition(ii+0, pos); // lengthens / shortcuts thigh
|
||||
m_object->SetPartPosition(ii+0, pos); // lengthens / shortcuts thigh
|
||||
|
||||
pos = m_object->GetPosition(ii+1);
|
||||
pos = m_object->GetPartPosition(ii+1);
|
||||
pos.y = -1.5f+a;
|
||||
m_object->SetPosition(ii+1, pos); // lengthens / shortcuts leg
|
||||
m_object->SetPartPosition(ii+1, pos); // lengthens / shortcuts leg
|
||||
|
||||
pos = m_object->GetPosition(ii+2);
|
||||
pos = m_object->GetPartPosition(ii+2);
|
||||
pos.y = -1.5f+a;
|
||||
m_object->SetPosition(ii+2, pos); // lengthens / shortcuts foot
|
||||
m_object->SetPartPosition(ii+2, pos); // lengthens / shortcuts foot
|
||||
|
||||
if ( i == 1 ) // right leg?
|
||||
{
|
||||
|
@ -1412,13 +1412,13 @@ bool CMotionHuman::EventFrame(const Event &event)
|
|||
{
|
||||
pos.y += 4.0f*event.rTime; // back to the surface
|
||||
if ( pos.y > level ) pos.y = level;
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
}
|
||||
if ( pos.y > level )
|
||||
{
|
||||
pos.y -= 10.0f*event.rTime; // down quickly
|
||||
if ( pos.y < level ) pos.y = level;
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
}
|
||||
|
||||
prog = m_progress;
|
||||
|
|
|
@ -81,7 +81,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_VEHICLE); // this is a moving object
|
||||
m_object->SetObjectRank(0, rank);
|
||||
modelManager->AddModelReference("mother1.mod", false, rank);
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_object->SetAngleY(0, angle);
|
||||
|
||||
// A vehicle must have a obligatory collision
|
||||
|
@ -95,7 +95,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("mother2.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(16.0f, 3.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(16.0f, 3.0f, 0.0f));
|
||||
|
||||
// Creates a right-back leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -103,7 +103,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("mother3.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(-5.0f, -1.0f, -12.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(-5.0f, -1.0f, -12.0f));
|
||||
|
||||
// Creates a right-back foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -111,7 +111,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 2);
|
||||
modelManager->AddModelReference("mother4.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
m_object->SetPartPosition(3, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
|
||||
// Creates a middle-right leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -119,7 +119,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(4, rank);
|
||||
m_object->SetObjectParent(4, 0);
|
||||
modelManager->AddModelReference("mother3.mod", false, rank);
|
||||
m_object->SetPosition(4, Math::Vector(3.5f, -1.0f, -12.0f));
|
||||
m_object->SetPartPosition(4, Math::Vector(3.5f, -1.0f, -12.0f));
|
||||
|
||||
// Creates a middle-right foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -127,7 +127,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(5, rank);
|
||||
m_object->SetObjectParent(5, 4);
|
||||
modelManager->AddModelReference("mother4.mod", false, rank);
|
||||
m_object->SetPosition(5, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
m_object->SetPartPosition(5, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
|
||||
// Creates a right-front leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -135,7 +135,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelReference("mother3.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(10.0f, -1.0f, -10.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(10.0f, -1.0f, -10.0f));
|
||||
|
||||
// Creates a right-front foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -143,7 +143,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 6);
|
||||
modelManager->AddModelReference("mother4.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
|
||||
// Creates a left-back leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -151,7 +151,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 0);
|
||||
modelManager->AddModelReference("mother3.mod", false, rank);
|
||||
m_object->SetPosition(8, Math::Vector(-5.0f, -1.0f, 12.0f));
|
||||
m_object->SetPartPosition(8, Math::Vector(-5.0f, -1.0f, 12.0f));
|
||||
m_object->SetAngleY(8, Math::PI);
|
||||
|
||||
// Creates a left-back foot.
|
||||
|
@ -160,7 +160,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(9, rank);
|
||||
m_object->SetObjectParent(9, 8);
|
||||
modelManager->AddModelReference("mother4.mod", false, rank);
|
||||
m_object->SetPosition(9, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
m_object->SetPartPosition(9, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
|
||||
// Creates a middle-left leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -168,7 +168,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(10, rank);
|
||||
m_object->SetObjectParent(10, 0);
|
||||
modelManager->AddModelReference("mother3.mod", false, rank);
|
||||
m_object->SetPosition(10, Math::Vector(3.5f, -1.0f, 12.0f));
|
||||
m_object->SetPartPosition(10, Math::Vector(3.5f, -1.0f, 12.0f));
|
||||
m_object->SetAngleY(10, Math::PI);
|
||||
|
||||
// Creates a middle-left foot.
|
||||
|
@ -177,7 +177,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(11, rank);
|
||||
m_object->SetObjectParent(11, 10);
|
||||
modelManager->AddModelReference("mother4.mod", false, rank);
|
||||
m_object->SetPosition(11, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
m_object->SetPartPosition(11, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
|
||||
// Creates a left-front leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -185,7 +185,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(12, rank);
|
||||
m_object->SetObjectParent(12, 0);
|
||||
modelManager->AddModelReference("mother3.mod", false, rank);
|
||||
m_object->SetPosition(12, Math::Vector(10.0f, -1.0f, 10.0f));
|
||||
m_object->SetPartPosition(12, Math::Vector(10.0f, -1.0f, 10.0f));
|
||||
m_object->SetAngleY(12, Math::PI);
|
||||
|
||||
// Creates a left-front foot.
|
||||
|
@ -194,7 +194,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(13, rank);
|
||||
m_object->SetObjectParent(13, 12);
|
||||
modelManager->AddModelReference("mother4.mod", false, rank);
|
||||
m_object->SetPosition(13, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
m_object->SetPartPosition(13, Math::Vector(0.0f, 0.0f, -8.5f));
|
||||
|
||||
// Creates the right antenna.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -202,14 +202,14 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(14, rank);
|
||||
m_object->SetObjectParent(14, 1);
|
||||
modelManager->AddModelReference("mother5.mod", false, rank);
|
||||
m_object->SetPosition(14, Math::Vector(6.0f, 1.0f, -2.5f));
|
||||
m_object->SetPartPosition(14, Math::Vector(6.0f, 1.0f, -2.5f));
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
m_object->SetObjectRank(15, rank);
|
||||
m_object->SetObjectParent(15, 14);
|
||||
modelManager->AddModelReference("mother6.mod", false, rank);
|
||||
m_object->SetPosition(15, Math::Vector(8.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(15, Math::Vector(8.0f, 0.0f, 0.0f));
|
||||
|
||||
// Creates the left antenna.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -217,14 +217,14 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(16, rank);
|
||||
m_object->SetObjectParent(16, 1);
|
||||
modelManager->AddModelReference("mother5.mod", false, rank);
|
||||
m_object->SetPosition(16, Math::Vector(6.0f, 1.0f, 2.5f));
|
||||
m_object->SetPartPosition(16, Math::Vector(6.0f, 1.0f, 2.5f));
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
m_object->SetObjectRank(17, rank);
|
||||
m_object->SetObjectParent(17, 16);
|
||||
modelManager->AddModelReference("mother6.mod", false, rank);
|
||||
m_object->SetPosition(17, Math::Vector(8.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(17, Math::Vector(8.0f, 0.0f, 0.0f));
|
||||
|
||||
// Creates the right claw.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -232,7 +232,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(18, rank);
|
||||
m_object->SetObjectParent(18, 1);
|
||||
modelManager->AddModelReference("mother7.mod", false, rank);
|
||||
m_object->SetPosition(18, Math::Vector(-4.0f, -3.5f, -8.0f));
|
||||
m_object->SetPartPosition(18, Math::Vector(-4.0f, -3.5f, -8.0f));
|
||||
m_object->SetZoomX(18, 1.2f);
|
||||
|
||||
// Creates the left claw.
|
||||
|
@ -241,7 +241,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(19, rank);
|
||||
m_object->SetObjectParent(19, 1);
|
||||
modelManager->AddModelReference("mother7.mod", true, rank);
|
||||
m_object->SetPosition(19, Math::Vector(-4.0f, -3.5f, 8.0f));
|
||||
m_object->SetPartPosition(19, Math::Vector(-4.0f, -3.5f, 8.0f));
|
||||
m_object->SetZoomX(19, 1.2f);
|
||||
|
||||
m_object->CreateShadowCircle(18.0f, 0.8f);
|
||||
|
@ -250,7 +250,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
m_object->SetPosition(pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_VEHICLE); // this is a moving object
|
||||
m_object->SetObjectRank(0, rank);
|
||||
// This is an "empty" object, without triangles
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_object->SetAngleY(0, angle);
|
||||
|
||||
// A vehicle must have a obligatory collision
|
||||
|
@ -121,7 +121,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("spider1.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(1.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(1.0f, 0.0f, 0.0f));
|
||||
|
||||
// Creates the head.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -129,7 +129,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("spider2.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(1.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(1.0f, 0.0f, 0.0f));
|
||||
|
||||
// Creates legs.
|
||||
for ( i=0 ; i<4 ; i++ )
|
||||
|
@ -149,7 +149,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
pos.x = table[i*12+j*3+0];
|
||||
pos.y = table[i*12+j*3+1];
|
||||
pos.z = table[i*12+j*3+2];
|
||||
m_object->SetPosition(3+i*4+j, pos);
|
||||
m_object->SetPartPosition(3+i*4+j, pos);
|
||||
|
||||
// Creates the left leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -162,7 +162,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
pos.x = table[i*12+j*3+0];
|
||||
pos.y = table[i*12+j*3+1];
|
||||
pos.z = -table[i*12+j*3+2];
|
||||
m_object->SetPosition(19+i*4+j, pos);
|
||||
m_object->SetPartPosition(19+i*4+j, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -172,7 +172,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(35, rank);
|
||||
m_object->SetObjectParent(35, 1);
|
||||
modelManager->AddModelReference("spider7.mod", false, rank);
|
||||
m_object->SetPosition(35, Math::Vector(0.0f, 0.0f, -0.3f));
|
||||
m_object->SetPartPosition(35, Math::Vector(0.0f, 0.0f, -0.3f));
|
||||
|
||||
// Creates the left mandible.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -180,7 +180,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(36, rank);
|
||||
m_object->SetObjectParent(36, 1);
|
||||
modelManager->AddModelReference("spider7.mod", true, rank);
|
||||
m_object->SetPosition(36, Math::Vector(0.0f, 0.0f, 0.3f));
|
||||
m_object->SetPartPosition(36, Math::Vector(0.0f, 0.0f, 0.3f));
|
||||
|
||||
m_object->CreateShadowCircle(4.0f, 0.5f);
|
||||
|
||||
|
@ -188,7 +188,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
m_object->SetPosition(pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_VEHICLE); // this is a moving object
|
||||
m_object->SetObjectRank(0, rank);
|
||||
modelManager->AddModelReference("toto1.mod", false, rank);
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_object->SetAngleY(0, angle);
|
||||
|
||||
// Creates mouth.
|
||||
|
@ -101,7 +101,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("toto2.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(1.00f, 0.17f, 0.00f));
|
||||
m_object->SetPartPosition(1, Math::Vector(1.00f, 0.17f, 0.00f));
|
||||
|
||||
// Creates the left eye.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -109,7 +109,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("toto3.mod", true, rank);
|
||||
m_object->SetPosition(2, Math::Vector(0.85f, 1.04f, 0.25f));
|
||||
m_object->SetPartPosition(2, Math::Vector(0.85f, 1.04f, 0.25f));
|
||||
m_object->SetAngleY(2, -20.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates the right eye.
|
||||
|
@ -118,7 +118,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 0);
|
||||
modelManager->AddModelReference("toto3.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(0.85f, 1.04f, -0.25f));
|
||||
m_object->SetPartPosition(3, Math::Vector(0.85f, 1.04f, -0.25f));
|
||||
m_object->SetAngleY(3, 20.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates left antenna.
|
||||
|
@ -127,7 +127,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(4, rank);
|
||||
m_object->SetObjectParent(4, 0);
|
||||
modelManager->AddModelReference("toto4.mod", false, rank);
|
||||
m_object->SetPosition(4, Math::Vector(0.0f, 1.9f, 0.3f));
|
||||
m_object->SetPartPosition(4, Math::Vector(0.0f, 1.9f, 0.3f));
|
||||
m_object->SetAngleX(4, 30.0f*Math::PI/180.0f);
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -135,7 +135,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(5, rank);
|
||||
m_object->SetObjectParent(5, 4);
|
||||
modelManager->AddModelReference("toto4.mod", false, rank);
|
||||
m_object->SetPosition(5, Math::Vector(0.0f, 0.67f, 0.0f));
|
||||
m_object->SetPartPosition(5, Math::Vector(0.0f, 0.67f, 0.0f));
|
||||
m_object->SetAngleX(5, 30.0f*Math::PI/180.0f);
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -143,7 +143,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 5);
|
||||
modelManager->AddModelReference("toto5.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(0.0f, 0.70f, 0.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(0.0f, 0.70f, 0.0f));
|
||||
m_object->SetAngleX(6, 30.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates right antenna.
|
||||
|
@ -152,7 +152,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelReference("toto4.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, 1.9f, -0.3f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, 1.9f, -0.3f));
|
||||
m_object->SetAngleX(7, -30.0f*Math::PI/180.0f);
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -160,7 +160,7 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 7);
|
||||
modelManager->AddModelReference("toto4.mod", false, rank);
|
||||
m_object->SetPosition(8, Math::Vector(0.0f, 0.67f, 0.0f));
|
||||
m_object->SetPartPosition(8, Math::Vector(0.0f, 0.67f, 0.0f));
|
||||
m_object->SetAngleX(8, -30.0f*Math::PI/180.0f);
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -168,14 +168,14 @@ void CMotionToto::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(9, rank);
|
||||
m_object->SetObjectParent(9, 8);
|
||||
modelManager->AddModelReference("toto5.mod", false, rank);
|
||||
m_object->SetPosition(9, Math::Vector(0.0f, 0.70f, 0.0f));
|
||||
m_object->SetPartPosition(9, Math::Vector(0.0f, 0.70f, 0.0f));
|
||||
m_object->SetAngleX(9, -30.0f*Math::PI/180.0f);
|
||||
|
||||
m_object->SetZoom(0, 0.5f); // is little
|
||||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
m_object->SetPosition(pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ bool CMotionToto::EventFrame(const Event &event)
|
|||
nPos = m_object->GetPosition();
|
||||
m_terrain->AdjustToFloor(nPos, true);
|
||||
nPos.y -= 100.0f; // hidden under the ground!
|
||||
m_object->SetPosition(0, nPos);
|
||||
m_object->SetPosition(nPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -572,7 +572,7 @@ bool CMotionToto::EventFrame(const Event &event)
|
|||
}
|
||||
nPos.y -= vibLin.y;
|
||||
}
|
||||
m_object->SetPosition(0, nPos);
|
||||
m_object->SetPosition(nPos);
|
||||
m_object->SetAngleY(0, nAngle);
|
||||
|
||||
SetLinVibration(vibLin);
|
||||
|
|
|
@ -182,7 +182,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
modelManager->AddModelReference("apolloj1.mod", false, rank);
|
||||
}
|
||||
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_object->SetAngleY(0, angle);
|
||||
|
||||
// A vehicle must have a obligatory collision
|
||||
|
@ -226,7 +226,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("lem2.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetAngleZ(1, ARM_NEUTRAL_ANGLE1);
|
||||
|
||||
// Creates the forearm.
|
||||
|
@ -235,7 +235,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 1);
|
||||
modelManager->AddModelReference("lem3.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(5.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(5.0f, 0.0f, 0.0f));
|
||||
m_object->SetAngleZ(2, ARM_NEUTRAL_ANGLE2);
|
||||
|
||||
// Creates the hand.
|
||||
|
@ -244,7 +244,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 2);
|
||||
modelManager->AddModelReference("lem4.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(3.5f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(3, Math::Vector(3.5f, 0.0f, 0.0f));
|
||||
m_object->SetAngleZ(3, ARM_NEUTRAL_ANGLE3);
|
||||
m_object->SetAngleX(3, Math::PI/2.0f);
|
||||
|
||||
|
@ -254,7 +254,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(4, rank);
|
||||
m_object->SetObjectParent(4, 3);
|
||||
modelManager->AddModelReference("lem5.mod", false, rank);
|
||||
m_object->SetPosition(4, Math::Vector(1.5f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(4, Math::Vector(1.5f, 0.0f, 0.0f));
|
||||
m_object->SetAngleZ(4, -Math::PI*0.10f);
|
||||
|
||||
// Creates the remote clamp.
|
||||
|
@ -263,7 +263,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(5, rank);
|
||||
m_object->SetObjectParent(5, 3);
|
||||
modelManager->AddModelReference("lem6.mod", false, rank);
|
||||
m_object->SetPosition(5, Math::Vector(1.5f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(5, Math::Vector(1.5f, 0.0f, 0.0f));
|
||||
m_object->SetAngleZ(5, Math::PI*0.10f);
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("lem2.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetAngleZ(1, 110.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates the forearm.
|
||||
|
@ -287,7 +287,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 1);
|
||||
modelManager->AddModelReference("lem3.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(5.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(5.0f, 0.0f, 0.0f));
|
||||
m_object->SetAngleZ(2, -110.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates the sensor.
|
||||
|
@ -296,7 +296,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 2);
|
||||
modelManager->AddModelReference("lem4s.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(3.5f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(3, Math::Vector(3.5f, 0.0f, 0.0f));
|
||||
m_object->SetAngleZ(3, -65.0f*Math::PI/180.0f);
|
||||
}
|
||||
|
||||
|
@ -311,8 +311,8 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("canon.mod", false, rank);
|
||||
//? m_object->SetPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
//? m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetAngleZ(1, 0.0f);
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("canoni1.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 5.3f, 0.0f));
|
||||
m_object->SetAngleZ(1, 0.0f);
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -335,7 +335,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 1);
|
||||
modelManager->AddModelReference("canoni2.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(0.0f, 2.5f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(0.0f, 2.5f, 0.0f));
|
||||
m_object->SetAngleZ(2, 0.0f);
|
||||
}
|
||||
|
||||
|
@ -351,7 +351,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelReference("lem2w.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(-3.0f, 1.0f, -3.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(-3.0f, 1.0f, -3.0f));
|
||||
|
||||
// Creates the left-back wheel.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -359,7 +359,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelReference("lem2w.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(-3.0f, 1.0f, 3.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(-3.0f, 1.0f, 3.0f));
|
||||
m_object->SetAngleY(7, Math::PI);
|
||||
|
||||
// Creates the right-front wheel.
|
||||
|
@ -368,7 +368,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 0);
|
||||
modelManager->AddModelReference("lem2w.mod", false, rank);
|
||||
m_object->SetPosition(8, Math::Vector(2.0f, 1.0f, -3.0f));
|
||||
m_object->SetPartPosition(8, Math::Vector(2.0f, 1.0f, -3.0f));
|
||||
|
||||
// Creates the left-front wheel.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -376,7 +376,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(9, rank);
|
||||
m_object->SetObjectParent(9, 0);
|
||||
modelManager->AddModelReference("lem2w.mod", false, rank);
|
||||
m_object->SetPosition(9, Math::Vector(2.0f, 1.0f, 3.0f));
|
||||
m_object->SetPartPosition(9, Math::Vector(2.0f, 1.0f, 3.0f));
|
||||
m_object->SetAngleY(9, Math::PI);
|
||||
}
|
||||
|
||||
|
@ -388,7 +388,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelReference("lem2w.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(-2.0f, 1.0f, -3.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(-2.0f, 1.0f, -3.0f));
|
||||
|
||||
// Creates the left-back wheel.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -396,7 +396,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelReference("lem2w.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(-2.0f, 1.0f, 3.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(-2.0f, 1.0f, 3.0f));
|
||||
m_object->SetAngleY(7, Math::PI);
|
||||
|
||||
// Creates the right-front wheel.
|
||||
|
@ -405,7 +405,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 0);
|
||||
modelManager->AddModelReference("lem2w.mod", false, rank);
|
||||
m_object->SetPosition(8, Math::Vector(3.0f, 1.0f, -3.0f));
|
||||
m_object->SetPartPosition(8, Math::Vector(3.0f, 1.0f, -3.0f));
|
||||
|
||||
// Creates the left-front wheel.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -413,7 +413,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(9, rank);
|
||||
m_object->SetObjectParent(9, 0);
|
||||
modelManager->AddModelReference("lem2w.mod", false, rank);
|
||||
m_object->SetPosition(9, Math::Vector(3.0f, 1.0f, 3.0f));
|
||||
m_object->SetPartPosition(9, Math::Vector(3.0f, 1.0f, 3.0f));
|
||||
m_object->SetAngleY(9, Math::PI);
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelCopy("lem2t.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(0.0f, 2.0f, -3.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(0.0f, 2.0f, -3.0f));
|
||||
|
||||
// Creates the left caterpillar.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -436,7 +436,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelCopy("lem3t.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, 2.0f, 3.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, 2.0f, 3.0f));
|
||||
}
|
||||
|
||||
if (type == OBJECT_MOBILErt ||
|
||||
|
@ -450,7 +450,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelCopy("roller2.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(0.0f, 2.0f, -3.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(0.0f, 2.0f, -3.0f));
|
||||
|
||||
// Creates the left caterpillar.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -458,7 +458,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelCopy("roller3.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, 2.0f, 3.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, 2.0f, 3.0f));
|
||||
}
|
||||
|
||||
if (type == OBJECT_MOBILEsa) // underwater caterpillars?
|
||||
|
@ -469,7 +469,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelCopy("subm4.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(0.0f, 1.0f, -3.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(0.0f, 1.0f, -3.0f));
|
||||
|
||||
// Creates the left caterpillar.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -477,7 +477,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelCopy("subm5.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, 1.0f, 3.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, 1.0f, 3.0f));
|
||||
}
|
||||
|
||||
if (type == OBJECT_MOBILEdr) // caterpillars?
|
||||
|
@ -488,7 +488,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelCopy("drawer2.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(0.0f, 1.0f, -3.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(0.0f, 1.0f, -3.0f));
|
||||
|
||||
// Creates the left caterpillar.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -496,7 +496,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelCopy("drawer3.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(0.0f, 1.0f, 3.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(0.0f, 1.0f, 3.0f));
|
||||
}
|
||||
|
||||
if (type == OBJECT_MOBILEfa ||
|
||||
|
@ -511,7 +511,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelReference("lem2f.mod", false, rank);
|
||||
m_object->SetPosition(6, Math::Vector(1.7f, 3.0f, 0.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(1.7f, 3.0f, 0.0f));
|
||||
|
||||
// Creates the right-back foot.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -519,7 +519,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelReference("lem2f.mod", false, rank);
|
||||
m_object->SetPosition(7, Math::Vector(-1.8f, 3.0f, -1.5f));
|
||||
m_object->SetPartPosition(7, Math::Vector(-1.8f, 3.0f, -1.5f));
|
||||
m_object->SetAngleY(7, 120.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates the left-back foot.
|
||||
|
@ -528,7 +528,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 0);
|
||||
modelManager->AddModelReference("lem2f.mod", false, rank);
|
||||
m_object->SetPosition(8, Math::Vector(-1.8f, 3.0f, 1.5f));
|
||||
m_object->SetPartPosition(8, Math::Vector(-1.8f, 3.0f, 1.5f));
|
||||
m_object->SetAngleY(8, -120.0f*Math::PI/180.0f);
|
||||
}
|
||||
|
||||
|
@ -570,7 +570,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
pos.x = table[i*9+j*3+0];
|
||||
pos.y = table[i*9+j*3+1];
|
||||
pos.z = table[i*9+j*3+2];
|
||||
m_object->SetPosition(6+i*3+j, pos);
|
||||
m_object->SetPartPosition(6+i*3+j, pos);
|
||||
|
||||
// Creates the left leg.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -583,7 +583,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
pos.x = table[i*9+j*3+0];
|
||||
pos.y = table[i*9+j*3+1];
|
||||
pos.z = -table[i*9+j*3+2];
|
||||
m_object->SetPosition(15+i*3+j, pos);
|
||||
m_object->SetPartPosition(15+i*3+j, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -596,7 +596,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("roller2t.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetAngleZ(1, 0.0f);
|
||||
|
||||
// Creates the pestle.
|
||||
|
@ -605,7 +605,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("roller3t.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(9.0f, 4.0f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(9.0f, 4.0f, 0.0f));
|
||||
m_object->SetAngleZ(2, 0.0f);
|
||||
}
|
||||
|
||||
|
@ -617,7 +617,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("roller2c.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(3.0f, 4.6f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(3.0f, 4.6f, 0.0f));
|
||||
m_object->SetAngleZ(1, Math::PI/8.0f);
|
||||
|
||||
// Creates the cannon.
|
||||
|
@ -626,7 +626,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("roller3p.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(7.0f, 6.5f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(7.0f, 6.5f, 0.0f));
|
||||
m_object->SetAngleZ(2, 0.0f);
|
||||
}
|
||||
|
||||
|
@ -638,7 +638,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("recover1.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(2.0f, 5.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(2.0f, 5.0f, 0.0f));
|
||||
|
||||
// Creates the right arm.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -646,7 +646,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 1);
|
||||
modelManager->AddModelReference("recover2.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(0.1f, 0.0f, -5.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(0.1f, 0.0f, -5.0f));
|
||||
m_object->SetAngleZ(2, 126.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates the right forearm.
|
||||
|
@ -655,7 +655,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 2);
|
||||
modelManager->AddModelReference("recover3.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(5.0f, 0.0f, -0.5f));
|
||||
m_object->SetPartPosition(3, Math::Vector(5.0f, 0.0f, -0.5f));
|
||||
m_object->SetAngleZ(3, -144.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates the left arm.
|
||||
|
@ -664,7 +664,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(4, rank);
|
||||
m_object->SetObjectParent(4, 1);
|
||||
modelManager->AddModelReference("recover2.mod", true, rank);
|
||||
m_object->SetPosition(4, Math::Vector(0.1f, 0.0f, 5.0f));
|
||||
m_object->SetPartPosition(4, Math::Vector(0.1f, 0.0f, 5.0f));
|
||||
m_object->SetAngleZ(4, 126.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates the left forearm.
|
||||
|
@ -673,7 +673,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(5, rank);
|
||||
m_object->SetObjectParent(5, 4);
|
||||
modelManager->AddModelReference("recover3.mod", true, rank);
|
||||
m_object->SetPosition(5, Math::Vector(5.0f, 0.0f, 0.5f));
|
||||
m_object->SetPartPosition(5, Math::Vector(5.0f, 0.0f, 0.5f));
|
||||
m_object->SetAngleZ(5, -144.0f*Math::PI/180.0f);
|
||||
}
|
||||
|
||||
|
@ -685,7 +685,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("roller2s.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetAngleZ(1, 0.0f);
|
||||
|
||||
// Creates the intermediate piston.
|
||||
|
@ -694,7 +694,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 1);
|
||||
modelManager->AddModelReference("roller3s.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(7.0f, 4.5f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(7.0f, 4.5f, 0.0f));
|
||||
m_object->SetAngleZ(2, 0.0f);
|
||||
|
||||
// Creates the piston with the sphere.
|
||||
|
@ -703,7 +703,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 2);
|
||||
modelManager->AddModelReference("roller4s.mod", false, rank);
|
||||
m_object->SetPosition(3, Math::Vector(0.0f, 1.0f, 0.0f));
|
||||
m_object->SetPartPosition(3, Math::Vector(0.0f, 1.0f, 0.0f));
|
||||
m_object->SetAngleZ(3, 0.0f);
|
||||
}
|
||||
|
||||
|
@ -715,7 +715,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("subm2.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(4.2f, 3.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(4.2f, 3.0f, 0.0f));
|
||||
|
||||
// Creates the right tong.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -723,7 +723,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 1);
|
||||
modelManager->AddModelReference("subm3.mod", false, rank);
|
||||
m_object->SetPosition(2, Math::Vector(0.5f, 0.0f, -1.5f));
|
||||
m_object->SetPartPosition(2, Math::Vector(0.5f, 0.0f, -1.5f));
|
||||
|
||||
// Creates the left tong.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -731,7 +731,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(3, rank);
|
||||
m_object->SetObjectParent(3, 1);
|
||||
modelManager->AddModelReference("subm3.mod", true, rank);
|
||||
m_object->SetPosition(3, Math::Vector(0.5f, 0.0f, 1.5f));
|
||||
m_object->SetPartPosition(3, Math::Vector(0.5f, 0.0f, 1.5f));
|
||||
}
|
||||
|
||||
if (type == OBJECT_MOBILEdr)
|
||||
|
@ -742,7 +742,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("drawer4.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(-3.0f, 3.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(-3.0f, 3.0f, 0.0f));
|
||||
|
||||
// Creates the key.
|
||||
if ( m_object->GetToy() )
|
||||
|
@ -753,7 +753,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("drawer5.mod", false, rank);
|
||||
m_posKey = Math::Vector(3.0f, 5.7f, 0.0f);
|
||||
m_object->SetPosition(2, m_posKey);
|
||||
m_object->SetPartPosition(2, m_posKey);
|
||||
m_object->SetAngleY(2, 90.0f*Math::PI/180.0f);
|
||||
}
|
||||
|
||||
|
@ -766,7 +766,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectParent(10+i, 1);
|
||||
sprintf(name, "drawer%d.mod", 10+i);
|
||||
modelManager->AddModelReference(name, false, rank);
|
||||
m_object->SetPosition(10+i, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(10+i, Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetAngleY(10+i, 45.0f*Math::PI/180.0f*i);
|
||||
}
|
||||
}
|
||||
|
@ -782,7 +782,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("drawer5.mod", false, rank);
|
||||
m_posKey = Math::Vector(0.2f, 4.1f, 0.0f);
|
||||
m_object->SetPosition(2, m_posKey);
|
||||
m_object->SetPartPosition(2, m_posKey);
|
||||
m_object->SetAngleY(2, 90.0f*Math::PI/180.0f);
|
||||
}
|
||||
}
|
||||
|
@ -795,7 +795,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("apolloj2.mod", false, rank); // antenna
|
||||
m_object->SetPosition(1, Math::Vector(5.5f, 8.8f, 2.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(5.5f, 8.8f, 2.0f));
|
||||
m_object->SetAngleY(1, -120.0f*Math::PI/180.0f);
|
||||
m_object->SetAngleZ(1, 45.0f*Math::PI/180.0f);
|
||||
|
||||
|
@ -804,7 +804,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2, rank);
|
||||
m_object->SetObjectParent(2, 0);
|
||||
modelManager->AddModelReference("apolloj3.mod", false, rank); // camera
|
||||
m_object->SetPosition(2, Math::Vector(5.5f, 2.8f, -2.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(5.5f, 2.8f, -2.0f));
|
||||
m_object->SetAngleY(2, 30.0f*Math::PI/180.0f);
|
||||
|
||||
// Creates the wheels.
|
||||
|
@ -813,28 +813,28 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(6, rank);
|
||||
m_object->SetObjectParent(6, 0);
|
||||
modelManager->AddModelReference("apolloj4.mod", false, rank); // wheel
|
||||
m_object->SetPosition(6, Math::Vector(-5.75f, 1.65f, -5.0f));
|
||||
m_object->SetPartPosition(6, Math::Vector(-5.75f, 1.65f, -5.0f));
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
m_object->SetObjectRank(7, rank);
|
||||
m_object->SetObjectParent(7, 0);
|
||||
modelManager->AddModelReference("apolloj4.mod", false, rank); // wheel
|
||||
m_object->SetPosition(7, Math::Vector(-5.75f, 1.65f, 5.0f));
|
||||
m_object->SetPartPosition(7, Math::Vector(-5.75f, 1.65f, 5.0f));
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
m_object->SetObjectRank(8, rank);
|
||||
m_object->SetObjectParent(8, 0);
|
||||
modelManager->AddModelReference("apolloj4.mod", false, rank); // wheel
|
||||
m_object->SetPosition(8, Math::Vector(5.75f, 1.65f, -5.0f));
|
||||
m_object->SetPartPosition(8, Math::Vector(5.75f, 1.65f, -5.0f));
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
m_object->SetObjectRank(9, rank);
|
||||
m_object->SetObjectParent(9, 0);
|
||||
modelManager->AddModelReference("apolloj4.mod", false, rank); // wheel
|
||||
m_object->SetPosition(9, Math::Vector(5.75f, 1.65f, 5.00f));
|
||||
m_object->SetPartPosition(9, Math::Vector(5.75f, 1.65f, 5.00f));
|
||||
|
||||
// Creates mud guards.
|
||||
rank = m_engine->CreateObject();
|
||||
|
@ -842,28 +842,28 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(10, rank);
|
||||
m_object->SetObjectParent(10, 0);
|
||||
modelManager->AddModelReference("apolloj6.mod", false, rank); // wheel
|
||||
m_object->SetPosition(10, Math::Vector(-5.75f, 1.65f, -5.0f));
|
||||
m_object->SetPartPosition(10, Math::Vector(-5.75f, 1.65f, -5.0f));
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
m_object->SetObjectRank(11, rank);
|
||||
m_object->SetObjectParent(11, 0);
|
||||
modelManager->AddModelReference("apolloj6.mod", false, rank); // wheel
|
||||
m_object->SetPosition(11, Math::Vector(-5.75f, 1.65f, 5.0f));
|
||||
m_object->SetPartPosition(11, Math::Vector(-5.75f, 1.65f, 5.0f));
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
m_object->SetObjectRank(12, rank);
|
||||
m_object->SetObjectParent(12, 0);
|
||||
modelManager->AddModelReference("apolloj5.mod", false, rank); // wheel
|
||||
m_object->SetPosition(12, Math::Vector(5.75f, 1.65f, -5.0f));
|
||||
m_object->SetPartPosition(12, Math::Vector(5.75f, 1.65f, -5.0f));
|
||||
|
||||
rank = m_engine->CreateObject();
|
||||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
m_object->SetObjectRank(13, rank);
|
||||
m_object->SetObjectParent(13, 0);
|
||||
modelManager->AddModelReference("apolloj5.mod", false, rank); // wheel
|
||||
m_object->SetPosition(13, Math::Vector(5.75f, 1.65f, 5.00f));
|
||||
m_object->SetPartPosition(13, Math::Vector(5.75f, 1.65f, 5.00f));
|
||||
}
|
||||
|
||||
if (type == OBJECT_MOBILErt ||
|
||||
|
@ -939,7 +939,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
}
|
||||
assert(powerCell->Implements(ObjectInterfaceType::Transportable));
|
||||
|
||||
powerCell->SetPosition(0, powerCellPos);
|
||||
powerCell->SetPosition(powerCellPos);
|
||||
powerCell->SetAngle(0, Math::Vector(0.0f, powerCellAngle, 0.0f));
|
||||
dynamic_cast<CTransportableObject*>(powerCell)->SetTransporter(m_object);
|
||||
assert(m_object->Implements(ObjectInterfaceType::Powered));
|
||||
|
@ -947,7 +947,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
}
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); //to display the shadows immediately
|
||||
m_object->SetPosition(pos); //to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
}
|
||||
|
@ -1376,8 +1376,8 @@ bool CMotionVehicle::EventFrame(const Event &event)
|
|||
pos.x = back;
|
||||
pos.y = radius-h;
|
||||
pos.z = -dist;
|
||||
m_object->SetPosition(6, pos);
|
||||
if ( type == OBJECT_APOLLO2 ) m_object->SetPosition(10, pos);
|
||||
m_object->SetPartPosition(6, pos);
|
||||
if ( type == OBJECT_APOLLO2 ) m_object->SetPartPosition(10, pos);
|
||||
|
||||
pos.x = -character->wheelBack; // left back wheel
|
||||
pos.z = character->wheelLeft;
|
||||
|
@ -1389,8 +1389,8 @@ bool CMotionVehicle::EventFrame(const Event &event)
|
|||
pos.x = back;
|
||||
pos.y = radius-h;
|
||||
pos.z = dist;
|
||||
m_object->SetPosition(7, pos);
|
||||
if ( type == OBJECT_APOLLO2 ) m_object->SetPosition(11, pos);
|
||||
m_object->SetPartPosition(7, pos);
|
||||
if ( type == OBJECT_APOLLO2 ) m_object->SetPartPosition(11, pos);
|
||||
|
||||
pos.x = character->wheelFront; // right front wheel
|
||||
pos.z = -character->wheelRight;
|
||||
|
@ -1402,8 +1402,8 @@ bool CMotionVehicle::EventFrame(const Event &event)
|
|||
pos.x = front;
|
||||
pos.y = radius-h;
|
||||
pos.z = -dist;
|
||||
m_object->SetPosition(8, pos);
|
||||
if ( type == OBJECT_APOLLO2 ) m_object->SetPosition(12, pos);
|
||||
m_object->SetPartPosition(8, pos);
|
||||
if ( type == OBJECT_APOLLO2 ) m_object->SetPartPosition(12, pos);
|
||||
|
||||
pos.x = character->wheelFront; // left front wheel
|
||||
pos.z = character->wheelLeft;
|
||||
|
@ -1415,22 +1415,22 @@ bool CMotionVehicle::EventFrame(const Event &event)
|
|||
pos.x = front;
|
||||
pos.y = radius-h;
|
||||
pos.z = dist;
|
||||
m_object->SetPosition(9, pos);
|
||||
if ( type == OBJECT_APOLLO2 ) m_object->SetPosition(13, pos);
|
||||
m_object->SetPartPosition(9, pos);
|
||||
if ( type == OBJECT_APOLLO2 ) m_object->SetPartPosition(13, pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_object->SetPosition(6, Math::Vector(back, radius, -dist));
|
||||
m_object->SetPosition(7, Math::Vector(back, radius, dist));
|
||||
m_object->SetPosition(8, Math::Vector(front, radius, -dist));
|
||||
m_object->SetPosition(9, Math::Vector(front, radius, dist));
|
||||
m_object->SetPartPosition(6, Math::Vector(back, radius, -dist));
|
||||
m_object->SetPartPosition(7, Math::Vector(back, radius, dist));
|
||||
m_object->SetPartPosition(8, Math::Vector(front, radius, -dist));
|
||||
m_object->SetPartPosition(9, Math::Vector(front, radius, dist));
|
||||
|
||||
if ( type == OBJECT_APOLLO2 )
|
||||
{
|
||||
m_object->SetPosition(10, Math::Vector(back, radius, -dist));
|
||||
m_object->SetPosition(11, Math::Vector(back, radius, dist));
|
||||
m_object->SetPosition(12, Math::Vector(front, radius, -dist));
|
||||
m_object->SetPosition(13, Math::Vector(front, radius, dist));
|
||||
m_object->SetPartPosition(10, Math::Vector(back, radius, -dist));
|
||||
m_object->SetPartPosition(11, Math::Vector(back, radius, dist));
|
||||
m_object->SetPartPosition(12, Math::Vector(front, radius, -dist));
|
||||
m_object->SetPartPosition(13, Math::Vector(front, radius, dist));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1547,7 +1547,7 @@ bool CMotionVehicle::EventFrame(const Event &event)
|
|||
{
|
||||
pos.y += 10.0f; // out of sight!
|
||||
}
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
|
||||
s = -fabs(m_physics->GetLinMotionX(MO_MOTSPEED)*0.1f);
|
||||
s += -fabs(m_physics->GetCirMotionY(MO_MOTSPEED)*1.5f);
|
||||
|
|
|
@ -95,7 +95,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_VEHICLE); // this is a moving object
|
||||
m_object->SetObjectRank(0, rank);
|
||||
// This is an "empty" object, without triangles
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
m_object->SetAngleY(0, angle);
|
||||
|
||||
// A vehicle must have a obligatory collision with a sphere of center (0, y, 0) (see GetCrashSphere).
|
||||
|
@ -110,7 +110,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(1, rank);
|
||||
m_object->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("worm1.mod", false, rank);
|
||||
m_object->SetPosition(1, Math::Vector(px, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(1, Math::Vector(px, 0.0f, 0.0f));
|
||||
px -= 1.0f;
|
||||
|
||||
// Creates the body.
|
||||
|
@ -121,7 +121,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2+i, rank);
|
||||
m_object->SetObjectParent(2+i, 0);
|
||||
modelManager->AddModelReference("worm2.mod", false, rank);
|
||||
m_object->SetPosition(2+i, Math::Vector(px, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(2+i, Math::Vector(px, 0.0f, 0.0f));
|
||||
px -= 1.0f;
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetObjectRank(2+WORM_PART, rank);
|
||||
m_object->SetObjectParent(2+WORM_PART, 0);
|
||||
modelManager->AddModelReference("worm3.mod", false, rank);
|
||||
m_object->SetPosition(2+WORM_PART, Math::Vector(px, 0.0f, 0.0f));
|
||||
m_object->SetPartPosition(2+WORM_PART, Math::Vector(px, 0.0f, 0.0f));
|
||||
|
||||
m_object->CreateShadowCircle(0.0f, 1.0f, Gfx::ENG_SHADOW_WORM);
|
||||
|
||||
|
@ -139,7 +139,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type,
|
|||
m_object->SetFloorHeight(0.0f);
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
m_object->SetPosition(0, pos); // to display the shadows immediately
|
||||
m_object->SetPosition(pos); // to display the shadows immediately
|
||||
|
||||
m_engine->LoadAllTextures();
|
||||
}
|
||||
|
@ -311,7 +311,7 @@ bool CMotionWorm::EventFrame(const Event &event)
|
|||
|
||||
p = Transform(*mat, pos);
|
||||
pos.y += m_terrain->GetFloorLevel(p, true)-floor;
|
||||
m_object->SetPosition(i+1, pos);
|
||||
m_object->SetPartPosition(i+1, pos);
|
||||
|
||||
zoom = Math::Mod(m_armTimeAbs*0.5f+100.0f-i*0.1f, 2.0f);
|
||||
if ( zoom > 1.0f ) zoom = 2.0f-zoom;
|
||||
|
@ -340,8 +340,8 @@ bool CMotionWorm::EventFrame(const Event &event)
|
|||
|
||||
for ( i=0 ; i<WORM_PART+1 ; i++ )
|
||||
{
|
||||
pos = m_object->GetPosition(i+2);
|
||||
pos -= m_object->GetPosition(i+1);
|
||||
pos = m_object->GetPartPosition(i+2);
|
||||
pos -= m_object->GetPartPosition(i+1);
|
||||
|
||||
angle.z = -Math::RotateAngle(Math::Point(pos.x, pos.z).Length(), pos.y);
|
||||
angle.y = Math::PI-Math::RotateAngle(pos.x, pos.z);
|
||||
|
|
|
@ -61,6 +61,11 @@ Math::Vector CObject::GetPosition() const
|
|||
return m_position;
|
||||
}
|
||||
|
||||
void CObject::SetPosition(const Math::Vector& pos)
|
||||
{
|
||||
// TODO: provide default implementation...
|
||||
}
|
||||
|
||||
Math::Vector CObject::GetRotation() const
|
||||
{
|
||||
return m_rotation;
|
||||
|
|
|
@ -85,12 +85,16 @@ public:
|
|||
return m_implementedInterfaces[static_cast<int>(type)];
|
||||
}
|
||||
|
||||
//! Returns current object's position
|
||||
//! Returns object's position
|
||||
virtual Math::Vector GetPosition() const;
|
||||
using COldObjectInterface::GetPosition; // temporarily
|
||||
//! Returns current object's rotation (Euler angles)
|
||||
//! Sets object's position
|
||||
virtual void SetPosition(const Math::Vector& pos);
|
||||
|
||||
//! Returns object's rotation (Euler angles)
|
||||
/** Angles are given in radians */
|
||||
virtual Math::Vector GetRotation() const;
|
||||
//! Returns current object's scale
|
||||
|
||||
//! Returns object's scale
|
||||
virtual Math::Vector GetScale() const;
|
||||
|
||||
//! Sets crash spheres for object
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1234,7 +1234,7 @@ Math::Vector COldObject::GetTilt()
|
|||
|
||||
// Getes the position of center of the object.
|
||||
|
||||
void COldObject::SetPosition(int part, const Math::Vector &pos)
|
||||
void COldObject::SetPartPosition(int part, const Math::Vector &pos)
|
||||
{
|
||||
m_objectPart[part].position = pos;
|
||||
m_objectPart[part].bTranslate = true; // it will recalculate the matrices
|
||||
|
@ -1277,7 +1277,7 @@ void COldObject::SetPosition(int part, const Math::Vector &pos)
|
|||
}
|
||||
}
|
||||
|
||||
Math::Vector COldObject::GetPosition(int part) const
|
||||
Math::Vector COldObject::GetPartPosition(int part) const
|
||||
{
|
||||
return m_objectPart[part].position;
|
||||
}
|
||||
|
@ -2117,7 +2117,7 @@ void COldObject::PartiFrame(float rTime)
|
|||
continue;
|
||||
}
|
||||
|
||||
SetPosition(i, pos);
|
||||
SetPartPosition(i, pos);
|
||||
|
||||
// Each song spins differently.
|
||||
switch( i%5 )
|
||||
|
@ -3319,7 +3319,12 @@ void COldObject::DeleteDeselList(CObject* pObj)
|
|||
|
||||
Math::Vector COldObject::GetPosition() const
|
||||
{
|
||||
return GetPosition(0);
|
||||
return GetPartPosition(0);
|
||||
}
|
||||
|
||||
void COldObject::SetPosition(const Math::Vector& pos)
|
||||
{
|
||||
SetPartPosition(0, pos);
|
||||
}
|
||||
|
||||
Math::Vector COldObject::GetRotation() const
|
||||
|
|
|
@ -121,8 +121,8 @@ public:
|
|||
void SetTilt(Math::Vector dir);
|
||||
Math::Vector GetTilt() override;
|
||||
|
||||
void SetPosition(int part, const Math::Vector &pos) override;
|
||||
Math::Vector GetPosition(int part) const override;
|
||||
void SetPartPosition(int part, const Math::Vector &pos);
|
||||
Math::Vector GetPartPosition(int part) const;
|
||||
void SetAngle(int part, const Math::Vector &angle) override;
|
||||
Math::Vector GetAngle(int part) const override;
|
||||
void SetAngleY(int part, float angle) override;
|
||||
|
@ -290,6 +290,7 @@ public:
|
|||
void SetInfoReturn(float value);
|
||||
float GetInfoReturn() override;
|
||||
|
||||
void SetPosition(const Math::Vector& pos) override;
|
||||
Math::Vector GetPosition() const override;
|
||||
Math::Vector GetRotation() const override;
|
||||
Math::Vector GetScale() const override;
|
||||
|
|
|
@ -81,15 +81,6 @@ Math::Vector COldObjectInterface::GetTilt()
|
|||
{
|
||||
throw std::logic_error("GetTilt: not implemented!");
|
||||
}
|
||||
void COldObjectInterface::SetPosition(int part, const Math::Vector &pos)
|
||||
{
|
||||
throw std::logic_error("SetPosition: not implemented!");
|
||||
}
|
||||
|
||||
Math::Vector COldObjectInterface::GetPosition(int part) const
|
||||
{
|
||||
throw std::logic_error("GetPosition: not implemented!");
|
||||
}
|
||||
|
||||
void COldObjectInterface::SetAngle(int part, const Math::Vector &angle)
|
||||
{
|
||||
|
|
|
@ -89,8 +89,6 @@ public:
|
|||
|
||||
virtual Math::Vector GetTilt();
|
||||
|
||||
virtual void SetPosition(int part, const Math::Vector &pos);
|
||||
virtual Math::Vector GetPosition(int part) const;
|
||||
virtual void SetAngle(int part, const Math::Vector &angle);
|
||||
virtual Math::Vector GetAngle(int part) const;
|
||||
virtual void SetAngleY(int part, float angle);
|
||||
|
|
|
@ -1728,7 +1728,7 @@ void CRobotMain::StartDisplayVisit(EventType event)
|
|||
m_visitPos = m_visitArrow->GetPosition();
|
||||
m_visitPosArrow = m_visitPos;
|
||||
m_visitPosArrow.y += m_displayText->GetVisitHeight(event);
|
||||
m_visitArrow->SetPosition(0, m_visitPosArrow);
|
||||
m_visitArrow->SetPosition(m_visitPosArrow);
|
||||
|
||||
m_visitTime = 0.0;
|
||||
m_visitParticle = 0.0f;
|
||||
|
@ -1751,7 +1751,7 @@ void CRobotMain::FrameVisit(float rTime)
|
|||
|
||||
Math::Vector pos = m_visitPosArrow;
|
||||
pos.y += 1.5f+sinf(m_visitTime*4.0f)*4.0f;
|
||||
m_visitArrow->SetPosition(0, pos);
|
||||
m_visitArrow->SetPosition(pos);
|
||||
m_visitArrow->SetAngleY(0, m_visitTime*2.0f);
|
||||
|
||||
// Manages the particles "arrows".
|
||||
|
@ -4857,26 +4857,28 @@ void CRobotMain::IOWriteObject(CLevelParserLine* line, CObject* obj)
|
|||
|
||||
if (obj->Implements(ObjectInterfaceType::Old))
|
||||
{
|
||||
COldObject* oldObj = dynamic_cast<COldObject*>(obj);
|
||||
|
||||
Math::Vector pos;
|
||||
for (int i = 1; i < OBJECTMAXPART; i++)
|
||||
{
|
||||
if (obj->GetObjectRank(i) == -1) continue;
|
||||
if (oldObj->GetObjectRank(i) == -1) continue;
|
||||
|
||||
pos = obj->GetPosition(i);
|
||||
pos = oldObj->GetPartPosition(i);
|
||||
if (pos.x != 0.0f || pos.y != 0.0f || pos.z != 0.0f)
|
||||
{
|
||||
pos /= g_unit;
|
||||
line->AddParam("p" + boost::lexical_cast<std::string>(i), CLevelParserParamUPtr{new CLevelParserParam(pos)});
|
||||
}
|
||||
|
||||
pos = obj->GetAngle(i);
|
||||
pos = oldObj->GetAngle(i);
|
||||
if (pos.x != 0.0f || pos.y != 0.0f || pos.z != 0.0f)
|
||||
{
|
||||
pos /= (Math::PI/180.0f);
|
||||
line->AddParam("a" + boost::lexical_cast<std::string>(i), CLevelParserParamUPtr{new CLevelParserParam(pos)});
|
||||
}
|
||||
|
||||
pos = obj->GetZoom(i);
|
||||
pos = oldObj->GetZoom(i);
|
||||
if (pos.x != 1.0f || pos.y != 1.0f || pos.z != 1.0f)
|
||||
{
|
||||
line->AddParam("z" + boost::lexical_cast<std::string>(i), CLevelParserParamUPtr{new CLevelParserParam(pos)});
|
||||
|
@ -5063,33 +5065,35 @@ CObject* CRobotMain::IOReadObject(CLevelParserLine *line, const char* filename,
|
|||
|
||||
if (obj->Implements(ObjectInterfaceType::Old))
|
||||
{
|
||||
obj->SetDefRank(objRank);
|
||||
obj->SetPosition(0, pos);
|
||||
obj->SetAngle(0, dir);
|
||||
COldObject* oldObj = dynamic_cast<COldObject*>(obj);
|
||||
|
||||
oldObj->SetDefRank(objRank);
|
||||
oldObj->SetPosition(pos);
|
||||
oldObj->SetAngle(0, dir);
|
||||
|
||||
if (zoom.x != 0.0f || zoom.y != 0.0f || zoom.z != 0.0f)
|
||||
obj->SetZoom(0, zoom);
|
||||
oldObj->SetZoom(0, zoom);
|
||||
|
||||
for (int i = 1; i < OBJECTMAXPART; i++)
|
||||
{
|
||||
if (obj->GetObjectRank(i) == -1) continue;
|
||||
if (oldObj->GetObjectRank(i) == -1) continue;
|
||||
|
||||
pos = line->GetParam(std::string("p")+boost::lexical_cast<std::string>(i))->AsPoint(Math::Vector());
|
||||
if (pos.x != 0.0f || pos.y != 0.0f || pos.z != 0.0f)
|
||||
{
|
||||
obj->SetPosition(i, pos*g_unit);
|
||||
oldObj->SetPartPosition(i, pos*g_unit);
|
||||
}
|
||||
|
||||
dir = line->GetParam(std::string("a")+boost::lexical_cast<std::string>(i))->AsPoint(Math::Vector());
|
||||
if (dir.x != 0.0f || dir.y != 0.0f || dir.z != 0.0f)
|
||||
{
|
||||
obj->SetAngle(i, dir*(Math::PI/180.0f));
|
||||
oldObj->SetAngle(i, dir*(Math::PI/180.0f));
|
||||
}
|
||||
|
||||
zoom = line->GetParam(std::string("z")+boost::lexical_cast<std::string>(i))->AsPoint(Math::Vector());
|
||||
if (zoom.x != 0.0f || zoom.y != 0.0f || zoom.z != 0.0f)
|
||||
{
|
||||
obj->SetZoom(i, zoom);
|
||||
oldObj->SetZoom(i, zoom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ std::unique_ptr<CExchangePost> CExchangePost::Create(
|
|||
obj->SetObjectRank(0, rank);
|
||||
|
||||
modelManager->AddModelReference("info1.mod", false, rank);
|
||||
obj->SetPosition(0, params.pos);
|
||||
obj->SetPosition(params.pos);
|
||||
obj->SetAngleY(0, params.angle);
|
||||
obj->SetFloorHeight(0.0f);
|
||||
|
||||
|
@ -64,7 +64,7 @@ std::unique_ptr<CExchangePost> CExchangePost::Create(
|
|||
obj->SetObjectRank(1, rank);
|
||||
obj->SetObjectParent(1, 0);
|
||||
modelManager->AddModelReference("info2.mod", false, rank);
|
||||
obj->SetPosition(1, Math::Vector(0.0f, 5.0f, 0.0f));
|
||||
obj->SetPartPosition(1, Math::Vector(0.0f, 5.0f, 0.0f));
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
|
@ -73,14 +73,14 @@ std::unique_ptr<CExchangePost> CExchangePost::Create(
|
|||
obj->SetObjectRank(2+i*2, rank);
|
||||
obj->SetObjectParent(2+i*2, 1);
|
||||
modelManager->AddModelReference("info3.mod", false, rank);
|
||||
obj->SetPosition(2+i*2, Math::Vector(0.0f, 4.5f, 0.0f));
|
||||
obj->SetPartPosition(2+i*2, Math::Vector(0.0f, 4.5f, 0.0f));
|
||||
|
||||
rank = engine->CreateObject();
|
||||
engine->SetObjectType(rank, Gfx::ENG_OBJTYPE_DESCENDANT);
|
||||
obj->SetObjectRank(3+i*2, rank);
|
||||
obj->SetObjectParent(3+i*2, 2+i*2);
|
||||
modelManager->AddModelReference("radar4.mod", false, rank);
|
||||
obj->SetPosition(3+i*2, Math::Vector(0.0f, 0.0f, -4.0f));
|
||||
obj->SetPartPosition(3+i*2, Math::Vector(0.0f, 0.0f, -4.0f));
|
||||
|
||||
obj->SetAngleY(2+i*2, 2.0f*Math::PI/3.0f*i);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ std::unique_ptr<CExchangePost> CExchangePost::Create(
|
|||
|
||||
Math::Vector pos = obj->GetPosition();
|
||||
pos.y += params.height;
|
||||
obj->SetPosition(0, pos); // to display the shadows immediately
|
||||
obj->SetPosition(pos); // to display the shadows immediately
|
||||
|
||||
std::unique_ptr<CAutoInfo> objAuto{new CAutoInfo(obj.get())};
|
||||
objAuto->Init();
|
||||
|
|
|
@ -135,7 +135,7 @@ Error CTaskAdvance::IsEnded()
|
|||
if ( length != 0.0f )
|
||||
{
|
||||
pos = m_startPos+((pos-m_startPos)*m_totalLength/length);
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
}
|
||||
return ERR_STOP;
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ bool CTaskBuild::CreateBuilding(Math::Vector pos, float angle)
|
|||
|
||||
m_buildingPos = m_building->GetPosition();
|
||||
m_buildingPos.y -= m_buildingHeight;
|
||||
m_building->SetPosition(0, m_buildingPos);
|
||||
m_building->SetPosition(m_buildingPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -260,7 +260,7 @@ bool CTaskBuild::EventProcess(const Event &event)
|
|||
if (m_object->GetType() == OBJECT_HUMAN)
|
||||
{
|
||||
m_object->SetObjectParent(14, 0);
|
||||
m_object->SetPosition(14, Math::Vector(-1.5f, 0.3f, -1.35f));
|
||||
m_object->SetPartPosition(14, Math::Vector(-1.5f, 0.3f, -1.35f));
|
||||
m_object->SetAngleZ(14, Math::PI);
|
||||
}
|
||||
m_camera->FlushEffect();
|
||||
|
@ -274,7 +274,7 @@ bool CTaskBuild::EventProcess(const Event &event)
|
|||
|
||||
pos = m_buildingPos;
|
||||
pos.y += m_buildingHeight*m_progress;
|
||||
m_building->SetPosition(0, pos); // the building rises
|
||||
m_building->SetPosition(pos); // the building rises
|
||||
|
||||
m_building->SetZoom(0, m_progress*0.75f+0.25f);
|
||||
m_metal->SetZoom(0, 1.0f-m_progress);
|
||||
|
@ -468,7 +468,7 @@ Error CTaskBuild::IsEnded()
|
|||
if (m_object->GetType() == OBJECT_HUMAN)
|
||||
{
|
||||
m_object->SetObjectParent(14, 4);
|
||||
m_object->SetPosition(14, Math::Vector(0.6f, 0.1f, 0.3f));
|
||||
m_object->SetPartPosition(14, Math::Vector(0.6f, 0.1f, 0.3f));
|
||||
m_object->SetAngleZ(14, 0.0f);
|
||||
}
|
||||
|
||||
|
@ -528,7 +528,7 @@ Error CTaskBuild::IsEnded()
|
|||
if (m_object->GetType() == OBJECT_HUMAN)
|
||||
{
|
||||
m_object->SetObjectParent(14, 0);
|
||||
m_object->SetPosition(14, Math::Vector(-1.5f, 0.3f, -1.35f));
|
||||
m_object->SetPartPosition(14, Math::Vector(-1.5f, 0.3f, -1.35f));
|
||||
m_object->SetAngleZ(14, Math::PI);
|
||||
}
|
||||
|
||||
|
|
|
@ -115,50 +115,50 @@ bool CTaskManip::EventProcess(const Event &event)
|
|||
{
|
||||
if ( m_step == 0 ) // fall?
|
||||
{
|
||||
pos = m_object->GetPosition(1);
|
||||
pos = m_object->GetPartPosition(1);
|
||||
pos.y = 3.0f-progress*2.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
if ( m_step == 1 ) // farm?
|
||||
{
|
||||
pos = m_object->GetPosition(2);
|
||||
pos = m_object->GetPartPosition(2);
|
||||
pos.z = -1.5f+progress*0.5f;
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
|
||||
pos = m_object->GetPosition(3);
|
||||
pos = m_object->GetPartPosition(3);
|
||||
pos.z = 1.5f-progress*0.5f;
|
||||
m_object->SetPosition(3, pos);
|
||||
m_object->SetPartPosition(3, pos);
|
||||
}
|
||||
if ( m_step == 2 ) // up?
|
||||
{
|
||||
pos = m_object->GetPosition(1);
|
||||
pos = m_object->GetPartPosition(1);
|
||||
pos.y = 3.0f-(1.0f-progress)*2.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( m_step == 0 ) // fall?
|
||||
{
|
||||
pos = m_object->GetPosition(1);
|
||||
pos = m_object->GetPartPosition(1);
|
||||
pos.y = 3.0f-progress*2.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
if ( m_step == 1 ) // farm?
|
||||
{
|
||||
pos = m_object->GetPosition(2);
|
||||
pos = m_object->GetPartPosition(2);
|
||||
pos.z = -1.5f+(1.0f-progress)*0.5f;
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
|
||||
pos = m_object->GetPosition(3);
|
||||
pos = m_object->GetPartPosition(3);
|
||||
pos.z = 1.5f-(1.0f-progress)*0.5f;
|
||||
m_object->SetPosition(3, pos);
|
||||
m_object->SetPartPosition(3, pos);
|
||||
}
|
||||
if ( m_step == 2 ) // up?
|
||||
{
|
||||
pos = m_object->GetPosition(1);
|
||||
pos = m_object->GetPartPosition(1);
|
||||
pos.y = 3.0f-(1.0f-progress)*2.0f;
|
||||
m_object->SetPosition(1, pos);
|
||||
m_object->SetPartPosition(1, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
|||
m_object->SetCargo(other); // takes the ball
|
||||
dynamic_cast<CTransportableObject*>(other)->SetTransporter(m_object);
|
||||
dynamic_cast<CTransportableObject*>(other)->SetTransporterPart(0); // taken with the base
|
||||
other->SetPosition(0, Math::Vector(0.0f, -3.0f, 0.0f));
|
||||
other->SetPosition(Math::Vector(0.0f, -3.0f, 0.0f));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -336,11 +336,11 @@ Error CTaskManip::Start(TaskManipOrder order, TaskManipArm arm)
|
|||
dynamic_cast<CTransportableObject*>(other)->SetTransporter(nullptr);
|
||||
pos = m_object->GetPosition();
|
||||
pos.y -= 3.0f;
|
||||
other->SetPosition(0, pos);
|
||||
other->SetPosition(pos);
|
||||
|
||||
pos = m_object->GetPosition();
|
||||
pos.y += 2.0f;
|
||||
m_object->SetPosition(0, pos); // against the top of jump
|
||||
m_object->SetPosition(pos); // against the top of jump
|
||||
|
||||
m_engine->GetPyroManager()->Create(Gfx::PT_FALL, other); // the ball falls
|
||||
}
|
||||
|
@ -1094,7 +1094,7 @@ bool CTaskManip::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(m_object);
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(4); // takes with the hand
|
||||
|
||||
cargo->SetPosition(0, Math::Vector(1.7f, -0.5f, 1.1f));
|
||||
cargo->SetPosition(Math::Vector(1.7f, -0.5f, 1.1f));
|
||||
cargo->SetAngleY(0, 0.1f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.8f);
|
||||
|
@ -1105,7 +1105,7 @@ bool CTaskManip::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(2); // takes with the right claw
|
||||
|
||||
Math::Vector pos = Math::Vector(1.1f, -1.0f, 1.0f); // relative
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.0f);
|
||||
|
@ -1116,7 +1116,7 @@ bool CTaskManip::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(3); // takes with the hand
|
||||
|
||||
Math::Vector pos = Math::Vector(4.7f, 0.0f, 0.0f); // relative to the hand (lem4)
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, Math::PI/2.0f);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
|
@ -1141,7 +1141,7 @@ bool CTaskManip::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(2); // takes with the right claw
|
||||
|
||||
pos = Math::Vector(1.1f, -1.0f, 1.0f); // relative
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.0f);
|
||||
|
@ -1152,7 +1152,7 @@ bool CTaskManip::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(3); // takes with the hand
|
||||
|
||||
pos = Math::Vector(4.7f, 0.0f, 0.0f); // relative to the hand (lem4)
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, Math::PI/2.0f);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
|
@ -1175,7 +1175,7 @@ bool CTaskManip::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(3); // takes with the hand
|
||||
|
||||
pos = Math::Vector(4.7f, 0.0f, 0.0f); // relative to the hand (lem4)
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, Math::PI/2.0f);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
|
@ -1192,7 +1192,7 @@ bool CTaskManip::TransporterTakeObject()
|
|||
m_cargoType = cargo->GetType();
|
||||
|
||||
Math::Vector pos = Math::Vector(4.7f, 0.0f, 0.0f); // relative to the hand (lem4)
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, Math::PI/2.0f);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
|
@ -1221,7 +1221,7 @@ bool CTaskManip::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(3); // takes with the hand
|
||||
|
||||
pos = Math::Vector(4.7f, 0.0f, 0.0f); // relative to the hand (lem4)
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, Math::PI/2.0f);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
|
@ -1247,7 +1247,7 @@ bool CTaskManip::TransporterDeposeObject()
|
|||
Math::Matrix* mat = cargo->GetWorldMatrix(0);
|
||||
Math::Vector pos = Transform(*mat, Math::Vector(0.0f, 1.0f, 0.0f));
|
||||
m_terrain->AdjustToFloor(pos);
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleY(0, m_object->GetAngleY(0)+Math::PI/2.0f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.0f);
|
||||
|
@ -1268,7 +1268,7 @@ bool CTaskManip::TransporterDeposeObject()
|
|||
Math::Matrix* mat = cargo->GetWorldMatrix(0);
|
||||
Math::Vector pos = Transform(*mat, Math::Vector(0.0f, 1.0f, 0.0f));
|
||||
m_terrain->AdjustToFloor(pos);
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleY(0, m_object->GetAngleY(0)+Math::PI/2.0f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.0f);
|
||||
|
@ -1291,7 +1291,7 @@ bool CTaskManip::TransporterDeposeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(0); // carried by the base
|
||||
|
||||
Character* character = m_object->GetCharacter();
|
||||
cargo->SetPosition(0, character->posPower);
|
||||
cargo->SetPosition(character->posPower);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.0f);
|
||||
|
@ -1322,7 +1322,7 @@ bool CTaskManip::TransporterDeposeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(other);
|
||||
|
||||
Character* character = other->GetCharacter();
|
||||
cargo->SetPosition(0, character->posPower);
|
||||
cargo->SetPosition(character->posPower);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.0f);
|
||||
|
|
|
@ -68,9 +68,9 @@ bool CTaskPen::EventProcess(const Event &event)
|
|||
if ( m_phase == TPP_UP ) // back the pencil
|
||||
{
|
||||
i = AngleToRank(m_object->GetAngleY(1));
|
||||
pos = m_object->GetPosition(10+i);
|
||||
pos = m_object->GetPartPosition(10+i);
|
||||
pos.y = -3.2f*(1.0f-m_progress);
|
||||
m_object->SetPosition(10+i, pos);
|
||||
m_object->SetPartPosition(10+i, pos);
|
||||
}
|
||||
|
||||
if ( m_phase == TPP_TURN ) // turns the carousel?
|
||||
|
@ -111,7 +111,7 @@ bool CTaskPen::EventProcess(const Event &event)
|
|||
}
|
||||
|
||||
i = AngleToRank(m_object->GetAngleY(1));
|
||||
pos = m_object->GetPosition(10+i);
|
||||
pos = m_object->GetPartPosition(10+i);
|
||||
if ( m_timeDown == 0.0f )
|
||||
{
|
||||
pos.y = 0.0f;
|
||||
|
@ -120,7 +120,7 @@ bool CTaskPen::EventProcess(const Event &event)
|
|||
{
|
||||
pos.y = -3.2f*Math::Bounce(Math::Min(m_progress*1.8f, 1.0f));
|
||||
}
|
||||
m_object->SetPosition(10+i, pos);
|
||||
m_object->SetPartPosition(10+i, pos);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -147,7 +147,7 @@ Error CTaskPen::Start(bool bDown, TraceColor color)
|
|||
m_newAngle = ColorToAngle(color);
|
||||
|
||||
i = AngleToRank(m_oldAngle);
|
||||
pos = m_object->GetPosition(10+i);
|
||||
pos = m_object->GetPartPosition(10+i);
|
||||
|
||||
if ( pos.y == 0.0f ) // pencil at the top?
|
||||
{
|
||||
|
|
|
@ -97,7 +97,7 @@ bool CTaskShield::EventProcess(const Event &event)
|
|||
pos.x = 7.0f;
|
||||
pos.y = 4.5f+Math::Bounce(m_progress)*3.0f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
}
|
||||
|
||||
if ( m_phase == TS_UP2 )
|
||||
|
@ -105,7 +105,7 @@ bool CTaskShield::EventProcess(const Event &event)
|
|||
pos.x = 0.0f;
|
||||
pos.y = 1.0f+Math::Bounce(m_progress)*3.0f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(3, pos);
|
||||
m_object->SetPartPosition(3, pos);
|
||||
}
|
||||
|
||||
if ( m_phase == TS_SHIELD )
|
||||
|
@ -215,7 +215,7 @@ bool CTaskShield::EventProcess(const Event &event)
|
|||
pos.x = 0.0f;
|
||||
pos.y = 1.0f+(1.0f-Math::Bounce(m_progress))*3.0f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(3, pos);
|
||||
m_object->SetPartPosition(3, pos);
|
||||
}
|
||||
|
||||
if ( m_phase == TS_DOWN2 )
|
||||
|
@ -223,7 +223,7 @@ bool CTaskShield::EventProcess(const Event &event)
|
|||
pos.x = 7.0f;
|
||||
pos.y = 4.5f+(1.0f-Math::Bounce(m_progress))*3.0f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -405,7 +405,7 @@ Error CTaskShield::IsEnded()
|
|||
pos.x = 7.0f;
|
||||
pos.y = 4.5f+3.0f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
|
||||
m_sound->Play(SOUND_PSHHH2, m_shieldPos, 1.0f, 1.0f);
|
||||
|
||||
|
@ -419,7 +419,7 @@ Error CTaskShield::IsEnded()
|
|||
pos.x = 0.0f;
|
||||
pos.y = 1.0f+3.0f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(3, pos);
|
||||
m_object->SetPartPosition(3, pos);
|
||||
|
||||
m_object->SetShieldRadius(GetRadius());
|
||||
|
||||
|
@ -484,12 +484,12 @@ bool CTaskShield::Abort()
|
|||
pos.x = 7.0f;
|
||||
pos.y = 4.5f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
|
||||
pos.x = 0.0f;
|
||||
pos.y = 1.0f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(3, pos);
|
||||
m_object->SetPartPosition(3, pos);
|
||||
|
||||
if ( m_soundChannel != -1 )
|
||||
{
|
||||
|
|
|
@ -455,8 +455,8 @@ bool CTaskTake::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(m_object);
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(4); // takes with the hand
|
||||
|
||||
//? cargo->SetPosition(0, Math::Vector(2.2f, -1.0f, 1.1f));
|
||||
cargo->SetPosition(0, Math::Vector(1.7f, -0.5f, 1.1f));
|
||||
//? cargo->SetPosition(Math::Vector(2.2f, -1.0f, 1.1f));
|
||||
cargo->SetPosition(Math::Vector(1.7f, -0.5f, 1.1f));
|
||||
cargo->SetAngleY(0, 0.1f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.8f);
|
||||
|
@ -481,8 +481,8 @@ bool CTaskTake::TransporterTakeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(m_object);
|
||||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporterPart(4); // takes with the hand
|
||||
|
||||
//? cargo->SetPosition(0, Math::Vector(2.2f, -1.0f, 1.1f));
|
||||
cargo->SetPosition(0, Math::Vector(1.7f, -0.5f, 1.1f));
|
||||
//? cargo->SetPosition(Math::Vector(2.2f, -1.0f, 1.1f));
|
||||
cargo->SetPosition(Math::Vector(1.7f, -0.5f, 1.1f));
|
||||
cargo->SetAngleY(0, 0.1f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.8f);
|
||||
|
@ -508,7 +508,7 @@ bool CTaskTake::TransporterDeposeObject()
|
|||
Math::Matrix* mat = cargo->GetWorldMatrix(0);
|
||||
Math::Vector pos = Transform(*mat, Math::Vector(-0.5f, 1.0f, 0.0f));
|
||||
m_terrain->AdjustToFloor(pos);
|
||||
cargo->SetPosition(0, pos);
|
||||
cargo->SetPosition(pos);
|
||||
cargo->SetAngleY(0, m_object->GetAngleY(0)+Math::PI/2.0f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.0f);
|
||||
|
@ -537,7 +537,7 @@ bool CTaskTake::TransporterDeposeObject()
|
|||
dynamic_cast<CTransportableObject*>(cargo)->SetTransporter(other);
|
||||
|
||||
Character* character = other->GetCharacter();
|
||||
cargo->SetPosition(0, character->posPower);
|
||||
cargo->SetPosition(character->posPower);
|
||||
cargo->SetAngleY(0, 0.0f);
|
||||
cargo->SetAngleX(0, 0.0f);
|
||||
cargo->SetAngleZ(0, 0.0f);
|
||||
|
|
|
@ -109,7 +109,7 @@ bool CTaskTerraform::EventProcess(const Event &event)
|
|||
pos.x = 9.0f;
|
||||
pos.y = 4.0f-m_progress*5.8f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
}
|
||||
|
||||
if ( m_phase == TTP_UP )
|
||||
|
@ -117,13 +117,13 @@ bool CTaskTerraform::EventProcess(const Event &event)
|
|||
pos.x = 9.0f;
|
||||
pos.y = 4.0f-(1.0f-m_progress)*5.8f;
|
||||
pos.z = 0.0f;
|
||||
m_object->SetPosition(2, pos);
|
||||
m_object->SetPartPosition(2, pos);
|
||||
}
|
||||
|
||||
dir.x = 0.0f;
|
||||
dir.y = 0.0f;
|
||||
dir.z = 0.0f;
|
||||
pos = m_object->GetPosition(2);
|
||||
pos = m_object->GetPartPosition(2);
|
||||
if ( pos.y < 0.0f )
|
||||
{
|
||||
dir.z = -atanf((pos.y/2.0f)/9.0f);
|
||||
|
@ -321,7 +321,7 @@ bool CTaskTerraform::Abort()
|
|||
m_soundChannel = -1;
|
||||
}
|
||||
|
||||
m_object->SetPosition(2, Math::Vector(9.0f, 4.0f, 0.0f));
|
||||
m_object->SetPartPosition(2, Math::Vector(9.0f, 4.0f, 0.0f));
|
||||
m_object->SetTilt(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetCirVibration(Math::Vector(0.0f, 0.0f, 0.0f));
|
||||
m_object->SetZoom(0, 1.0f);
|
||||
|
|
|
@ -1001,7 +1001,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime)
|
|||
m_bLand = false; // take off
|
||||
SetMotor(true);
|
||||
pos.y += 0.05f; // small initial height (startup)
|
||||
m_object->SetPosition(0, pos);
|
||||
m_object->SetPosition(pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1605,7 +1605,7 @@ bool CPhysics::EventFrame(const Event &event)
|
|||
newpos.y != pos.y ||
|
||||
newpos.z != pos.z )
|
||||
{
|
||||
m_object->SetPosition(0, newpos);
|
||||
m_object->SetPosition(newpos);
|
||||
}
|
||||
|
||||
MotorParticle(m_time, event.rTime);
|
||||
|
|
Loading…
Reference in New Issue