GlobalSphere -> CameraCollisionSphere refactoring

master
Piotr Dziwinski 2015-07-11 11:35:20 +02:00
parent f4b2f3468d
commit 6dcef71802
17 changed files with 98 additions and 92 deletions

View File

@ -934,9 +934,9 @@ bool CCamera::IsCollisionBack(Math::Vector &eye, Math::Vector lookat)
oType == OBJECT_BEE || oType == OBJECT_BEE ||
oType == OBJECT_WORM ) continue; oType == OBJECT_WORM ) continue;
Math::Vector oPos; Math::Sphere objSphere = obj->GetCameraCollisionSphere();
float oRadius = 0.0f; Math::Vector oPos = objSphere.pos;
obj->GetGlobalSphere(oPos, oRadius); float oRadius = objSphere.radius;
if ( oRadius <= 2.0f ) continue; // ignores small objects if ( oRadius <= 2.0f ) continue; // ignores small objects
if ( oPos.x+oRadius < min.x || if ( oPos.x+oRadius < min.x ||
@ -995,9 +995,9 @@ bool CCamera::IsCollisionFix(Math::Vector &eye, Math::Vector lookat)
type == OBJECT_BEE || type == OBJECT_BEE ||
type == OBJECT_WORM ) continue; type == OBJECT_WORM ) continue;
Math::Vector objPos; Math::Sphere objSphere = obj->GetCameraCollisionSphere();
float objRadius = 0.0f; Math::Vector objPos = objSphere.pos;
obj->GetGlobalSphere(objPos, objRadius); float objRadius = objSphere.radius;
if (objRadius == 0.0f) continue; if (objRadius == 0.0f) continue;
float dist = Math::Distance(eye, objPos); float dist = Math::Distance(eye, objPos);

View File

@ -240,7 +240,7 @@ bool CAutoVault::EventProcess(const Event &event)
} }
m_object->DeleteAllCrashSpheres(); m_object->DeleteAllCrashSpheres();
m_object->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 0.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 0.0f));
m_sound->Play(SOUND_FINDING, m_object->GetPosition(0)); m_sound->Play(SOUND_FINDING, m_object->GetPosition(0));

View File

@ -27,6 +27,10 @@ class CObject;
/** /**
* \class CPoweredObject * \class CPoweredObject
* \brief Interface for objects powered using power cells * \brief Interface for objects powered using power cells
*
* TODO: It currently includes objects that take other objects as input
* and convert them, for example PowerPlant.
* We should create a dedicated interface for such uses.
*/ */
class CPoweredObject class CPoweredObject
{ {

View File

@ -86,7 +86,7 @@ void CMotionAnt::Create(Math::Vector pos, float angle, ObjectType type,
// A vehicle must have necessarily a collision // A vehicle must have necessarily a collision
//with a sphere of center (0, y, 0) (see GetCrashSphere). //with a sphere of center (0, y, 0) (see GetCrashSphere).
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, -2.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, -2.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f));
m_object->SetGlobalSphere(Math::Vector(-0.5f, 1.0f, 0.0f), 4.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-0.5f, 1.0f, 0.0f), 4.0f));
// Creates the head. // Creates the head.
rank = m_engine->CreateObject(); rank = m_engine->CreateObject();

View File

@ -86,7 +86,7 @@ void CMotionBee::Create(Math::Vector pos, float angle, ObjectType type,
// A vehicle must have an obligatory collision // A vehicle must have an obligatory collision
// with a sphere of center (0, y, 0) (see GetCrashSphere). // with a sphere of center (0, y, 0) (see GetCrashSphere).
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f));
m_object->SetGlobalSphere(Math::Vector(-1.0f, 1.0f, 0.0f), 5.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-1.0f, 1.0f, 0.0f), 5.0f));
// Creates the head. // Creates the head.
rank = m_engine->CreateObject(); rank = m_engine->CreateObject();

View File

@ -151,7 +151,7 @@ void CMotionHuman::Create(Math::Vector pos, float angle, ObjectType type,
// A vehicle must have an obligatory collision with a sphere of center (0, y, 0) (see GetCrashSphere). // A vehicle must have an obligatory collision with a sphere of center (0, y, 0) (see GetCrashSphere).
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 2.0f, SOUND_AIE, 0.20f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 2.0f, SOUND_AIE, 0.20f));
m_object->SetGlobalSphere(Math::Vector(0.0f, 1.0f, 0.0f), 4.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 1.0f, 0.0f), 4.0f));
// Creates the head. // Creates the head.
rank = m_engine->CreateObject(); rank = m_engine->CreateObject();

View File

@ -85,7 +85,7 @@ void CMotionQueen::Create(Math::Vector pos, float angle, ObjectType type,
// A vehicle must have a obligatory collision // A vehicle must have a obligatory collision
//with a sphere of center (0, y, 0) (see GetCrashSphere). //with a sphere of center (0, y, 0) (see GetCrashSphere).
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 20.0f, SOUND_BOUM, 0.20f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 20.0f, SOUND_BOUM, 0.20f));
m_object->SetGlobalSphere(Math::Vector(-2.0f, 10.0f, 0.0f), 25.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-2.0f, 10.0f, 0.0f), 25.0f));
// Creates the head. // Creates the head.
rank = m_engine->CreateObject(); rank = m_engine->CreateObject();

View File

@ -111,7 +111,7 @@ void CMotionSpider::Create(Math::Vector pos, float angle, ObjectType type,
// A vehicle must have a obligatory collision // A vehicle must have a obligatory collision
// with a sphere of center (0, y, 0) (see GetCrashSphere). // with a sphere of center (0, y, 0) (see GetCrashSphere).
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, -2.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, -2.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f));
m_object->SetGlobalSphere(Math::Vector(-0.5f, 1.0f, 0.0f), 4.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-0.5f, 1.0f, 0.0f), 4.0f));
// Creates the abdomen. // Creates the abdomen.
rank = m_engine->CreateObject(); rank = m_engine->CreateObject();

View File

@ -194,17 +194,17 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
type == OBJECT_MOBILErs) type == OBJECT_MOBILErs)
{ {
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 4.0f, 0.0f), 6.5f, SOUND_BOUMm, 0.45f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 4.0f, 0.0f), 6.5f, SOUND_BOUMm, 0.45f));
m_object->SetGlobalSphere(Math::Vector(0.0f, 3.0f, 0.0f), 7.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 7.0f));
} }
else if (type == OBJECT_MOBILEsa) else if (type == OBJECT_MOBILEsa)
{ {
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 4.5f, SOUND_BOUMm, 0.45f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 4.5f, SOUND_BOUMm, 0.45f));
m_object->SetGlobalSphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f));
} }
else if (type == OBJECT_MOBILEdr) else if (type == OBJECT_MOBILEdr)
{ {
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
m_object->SetGlobalSphere(Math::Vector(0.0f, 3.0f, 0.0f), 7.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 7.0f));
} }
else if (type == OBJECT_APOLLO2) else if (type == OBJECT_APOLLO2)
{ {
@ -213,7 +213,7 @@ void CMotionVehicle::Create(Math::Vector pos, float angle, ObjectType type,
else else
{ {
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 4.5f, SOUND_BOUMm, 0.45f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 4.5f, SOUND_BOUMm, 0.45f));
m_object->SetGlobalSphere(Math::Vector(0.0f, 4.0f, 0.0f), 6.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 6.0f));
} }
if (type == OBJECT_MOBILEfa || if (type == OBJECT_MOBILEfa ||

View File

@ -98,7 +98,7 @@ void CMotionWorm::Create(Math::Vector pos, float angle, ObjectType type,
// A vehicle must have a obligatory collision with a sphere of center (0, y, 0) (see GetCrashSphere). // A vehicle must have a obligatory collision with a sphere of center (0, y, 0) (see GetCrashSphere).
m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f)); m_object->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.20f));
m_object->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 5.0f); m_object->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 5.0f));
px = 1.0f+WORM_PART/2; px = 1.0f+WORM_PART/2;

View File

@ -48,3 +48,16 @@ void CObject::DeleteAllCrashSpheres()
{ {
m_crashSpheres.clear(); m_crashSpheres.clear();
} }
void CObject::SetCameraCollisionSphere(const Math::Sphere& sphere)
{
m_cameraCollisionSphere = sphere;
}
Math::Sphere CObject::GetCameraCollisionSphere()
{
Math::Sphere transformedSphere = m_cameraCollisionSphere;
TransformCrashSphere(transformedSphere);
return transformedSphere;
}

View File

@ -95,13 +95,22 @@ public:
//! Removes all crash spheres //! Removes all crash spheres
void DeleteAllCrashSpheres(); void DeleteAllCrashSpheres();
//! Returns sphere used to test for camera collisions
Math::Sphere GetCameraCollisionSphere();
//! Sets sphere used to test for camera collisions
// TODO: remove from here once no longer necessary
void SetCameraCollisionSphere(const Math::Sphere& sphere);
protected: protected:
//! Transform crash sphere by object's world matrix //! Transform crash sphere by object's world matrix
virtual void TransformCrashSphere(Math::Sphere& crashSphere) = 0; virtual void TransformCrashSphere(Math::Sphere& crashSphere) = 0;
//! Transform crash sphere by object's world matrix
virtual void TransformCameraCollisionSphere(Math::Sphere& collisionSphere) = 0;
protected: protected:
const int m_id; //!< unique identifier const int m_id; //!< unique identifier
ObjectType m_type; //!< object type ObjectType m_type; //!< object type
ObjectInterfaceTypes m_implementedInterfaces; //!< interfaces that the object implements ObjectInterfaceTypes m_implementedInterfaces; //!< interfaces that the object implements
std::vector<CrashSphere> m_crashSpheres; //!< crash spheres std::vector<CrashSphere> m_crashSpheres; //!< crash spheres
Math::Sphere m_cameraCollisionSphere;
}; };

View File

@ -398,7 +398,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-32.0f, 45.0f, 32.0f), 10.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-32.0f, 45.0f, 32.0f), 10.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 32.0f, 45.0f, -32.0f), 10.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 32.0f, 45.0f, -32.0f), 10.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 32.0f, 45.0f, 32.0f), 10.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 32.0f, 45.0f, 32.0f), 10.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 35.0f, 0.0f), 50.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 35.0f, 0.0f), 50.0f));
obj->CreateShadowCircle(50.0f, 1.0f); obj->CreateShadowCircle(50.0f, 1.0f);
} }
@ -461,7 +461,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-13.0f, 94.0f, -13.0f), 10.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-13.0f, 94.0f, -13.0f), 10.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f,104.0f, 0.0f), 14.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f,104.0f, 0.0f), 14.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 45.0f, 0.0f), 10.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 45.0f, 0.0f), 10.0f));
obj->CreateShadowCircle(60.0f, 1.0f); obj->CreateShadowCircle(60.0f, 1.0f);
obj->SetShowLimitRadius(200.0f); obj->SetShowLimitRadius(200.0f);
@ -487,7 +487,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 17.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 17.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 26.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 26.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(7.0f, 17.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(7.0f, 17.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 10.0f, 0.0f), 10.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 10.0f, 0.0f), 10.0f));
obj->CreateShadowCircle(10.0f, 0.4f); obj->CreateShadowCircle(10.0f, 0.4f);
} }
@ -517,7 +517,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 9.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 9.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 6.0f, 0.0f), 9.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 6.0f, 0.0f), 9.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 14.0f, 0.0f), 7.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 14.0f, 0.0f), 7.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 8.0f, 0.0f), 12.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 8.0f, 0.0f), 12.0f));
obj->GetCharacter()->posPower = Math::Vector(7.5f, 3.0f, 0.0f); obj->GetCharacter()->posPower = Math::Vector(7.5f, 3.0f, 0.0f);
@ -555,7 +555,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 11.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 11.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 7.0f, 0.0f), 7.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 7.0f, 0.0f), 7.0f));
obj->CreateShadowCircle(8.0f, 1.0f); obj->CreateShadowCircle(8.0f, 1.0f);
} }
@ -570,7 +570,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-2.0f, 13.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-2.0f, 13.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-7.0f, 3.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-7.0f, 3.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 1.0f, 0.0f), 1.5f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 1.0f, 0.0f), 1.5f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(-7.0f, 5.0f, 0.0f), 5.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-7.0f, 5.0f, 0.0f), 5.0f));
obj->GetCharacter()->posPower = Math::Vector(0.0f, 3.0f, 0.0f); obj->GetCharacter()->posPower = Math::Vector(0.0f, 3.0f, 0.0f);
obj->SetEnergy(power); // initializes the energy level obj->SetEnergy(power); // initializes the energy level
@ -631,7 +631,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 10.0f, 0.0f), 4.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 10.0f, 0.0f), 4.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-12.0f, 3.0f, 3.0f), 4.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-12.0f, 3.0f, 3.0f), 4.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-12.0f, 3.0f, -3.0f), 4.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-12.0f, 3.0f, -3.0f), 4.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(-10.0f, 5.0f, 0.0f), 7.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-10.0f, 5.0f, 0.0f), 7.0f));
obj->GetCharacter()->posPower = Math::Vector(0.0f, 3.0f, 0.0f); obj->GetCharacter()->posPower = Math::Vector(0.0f, 3.0f, 0.0f);
@ -690,7 +690,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 9.0f, 4.0f*s), 4.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 9.0f, 4.0f*s), 4.0f, SOUND_BOUMm, 0.45f));
} }
obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 21.0f, -4.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 21.0f, -4.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 10.0f, 0.0f), 18.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 10.0f, 0.0f), 18.0f));
obj->CreateShadowCircle(24.0f, 0.3f); obj->CreateShadowCircle(24.0f, 0.3f);
} }
@ -716,7 +716,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 0.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 0.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 0.0f, -4.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 0.0f, -4.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 10.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 10.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(-11.0f, 13.0f, 0.0f), 15.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-11.0f, 13.0f, 0.0f), 15.0f));
} }
if ( type == OBJECT_DESTROYER ) if ( type == OBJECT_DESTROYER )
@ -754,7 +754,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-15.0f, 2.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-15.0f, 2.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-15.0f, 6.0f, 0.0f), 4.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-15.0f, 6.0f, 0.0f), 4.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(-15.0f, 5.0f, 0.0f), 6.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-15.0f, 5.0f, 0.0f), 6.0f));
obj->SetEnergy(power); obj->SetEnergy(power);
} }
@ -796,7 +796,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 2.0f, -4.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 2.0f, -4.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 9.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 9.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 14.0f, 0.0f), 1.5f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 14.0f, 0.0f), 1.5f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(-3.0f, 8.0f, 0.0f), 14.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-3.0f, 8.0f, 0.0f), 14.0f));
} }
if ( type == OBJECT_TOWER ) if ( type == OBJECT_TOWER )
@ -826,7 +826,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 8.0f, 0.0f), 4.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 8.0f, 0.0f), 4.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 15.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 15.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 24.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 24.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 5.0f, 0.0f), 7.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 5.0f, 0.0f), 7.0f));
obj->GetCharacter()->posPower = Math::Vector(5.0f, 3.0f, 0.0f); obj->GetCharacter()->posPower = Math::Vector(5.0f, 3.0f, 0.0f);
@ -852,7 +852,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 0.0f, 0.0f), 19.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 0.0f, 0.0f), 19.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 24.0f, 0.0f), 15.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 24.0f, 0.0f), 15.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(22.0f, 1.0f, 0.0f), 1.5f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(22.0f, 1.0f, 0.0f), 1.5f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 17.0f, 0.0f), 26.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 17.0f, 0.0f), 26.0f));
obj->GetCharacter()->posPower = Math::Vector(22.0f, 3.0f, 0.0f); obj->GetCharacter()->posPower = Math::Vector(22.0f, 3.0f, 0.0f);
@ -878,7 +878,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 15.0f, -11.0f), 2.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 15.0f, -11.0f), 2.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 26.0f, 0.0f), 9.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 26.0f, 0.0f), 9.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 54.0f, 0.0f), 14.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 54.0f, 0.0f), 14.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 10.0f, 0.0f), 20.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 10.0f, 0.0f), 20.0f));
obj->CreateShadowCircle(21.0f, 1.0f); obj->CreateShadowCircle(21.0f, 1.0f);
obj->SetShowLimitRadius(Gfx::LTNG_PROTECTION_RADIUS); obj->SetShowLimitRadius(Gfx::LTNG_PROTECTION_RADIUS);
@ -908,7 +908,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
m_terrain->AddBuildingLevel(pos, 18.0f, 20.0f, 1.0f, 0.5f); m_terrain->AddBuildingLevel(pos, 18.0f, 20.0f, 1.0f, 0.5f);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 13.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 13.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 1.0f, 0.0f), 13.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 1.0f, 0.0f), 13.0f));
obj->CreateShadowCircle(23.0f, 1.0f); obj->CreateShadowCircle(23.0f, 1.0f);
} }
@ -1042,7 +1042,7 @@ CObjectUPtr CObjectFactory::CreateBuilding(const ObjectCreateParams& params)
pPower->obj->SetPosition(0, GetCharacter()->posPower); pPower->obj->SetPosition(0, GetCharacter()->posPower);
pPower->obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f)); pPower->obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f));
pPower->obj->SetGlobalSphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.5f); pPower->obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.5f));
pPower->SetTransporter(obj.get()); pPower->SetTransporter(obj.get());
SetPower(pPower); SetPower(pPower);
@ -1145,19 +1145,19 @@ CObjectUPtr CObjectFactory::CreateResource(const ObjectCreateParams& params)
else if ( type == OBJECT_EGG ) else if ( type == OBJECT_EGG )
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(-1.0f, 2.8f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-1.0f, 2.8f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f));
radius = 3.0f; radius = 3.0f;
} }
else if ( type == OBJECT_BOMB ) else if ( type == OBJECT_BOMB )
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 3.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 3.0f));
radius = 3.0f; radius = 3.0f;
} }
else if ( type == OBJECT_BAG ) else if ( type == OBJECT_BAG )
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f));
obj->SetZoom(0, 1.5f); obj->SetZoom(0, 1.5f);
radius = 5.0f; radius = 5.0f;
height = -1.4f; height = -1.4f;
@ -1165,7 +1165,7 @@ CObjectUPtr CObjectFactory::CreateResource(const ObjectCreateParams& params)
else else
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.5f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 1.0f, 0.0f), 1.5f));
} }
obj->CreateShadowCircle(radius, 1.0f); obj->CreateShadowCircle(radius, 1.0f);
@ -1372,7 +1372,7 @@ CObjectUPtr CObjectFactory::CreatePlant(const ObjectCreateParams& params)
height -= 2.0f; height -= 2.0f;
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.10f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.10f));
obj->SetGlobalSphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f));
obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 8.0f)); obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 8.0f));
obj->CreateShadowCircle(8.0f, 0.5f); obj->CreateShadowCircle(8.0f, 0.5f);
@ -1432,7 +1432,7 @@ CObjectUPtr CObjectFactory::CreatePlant(const ObjectCreateParams& params)
obj->SetAngleY(0, angle); obj->SetAngleY(0, angle);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 12.0f, 0.0f), 5.0f, SOUND_BOUM, 0.10f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 12.0f, 0.0f), 5.0f, SOUND_BOUM, 0.10f));
obj->SetGlobalSphere(Math::Vector(0.0f, 6.0f, 0.0f), 6.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 6.0f, 0.0f), 6.0f));
obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 8.0f)); obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 8.0f));
obj->CreateShadowCircle(8.0f, 0.3f); obj->CreateShadowCircle(8.0f, 0.3f);
@ -1458,7 +1458,7 @@ CObjectUPtr CObjectFactory::CreatePlant(const ObjectCreateParams& params)
if ( type != OBJECT_PLANT19 ) if ( type != OBJECT_PLANT19 )
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.10f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f, SOUND_BOUM, 0.10f));
obj->SetGlobalSphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f));
} }
obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 8.0f)); obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 8.0f));
@ -1603,7 +1603,7 @@ CObjectUPtr CObjectFactory::CreateMushroom(const ObjectCreateParams& params)
obj->SetAngleY(0, angle); obj->SetAngleY(0, angle);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 4.0f, 0.0f), 3.0f, SOUND_BOUM, 0.10f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 4.0f, 0.0f), 3.0f, SOUND_BOUM, 0.10f));
obj->SetGlobalSphere(Math::Vector(0.0f, 3.0f, 0.0f), 5.5f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 5.5f));
obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 5.5f)); obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 3.0f, 0.0f), 5.5f));
obj->CreateShadowCircle(6.0f, 0.5f); obj->CreateShadowCircle(6.0f, 0.5f);
@ -1619,7 +1619,7 @@ CObjectUPtr CObjectFactory::CreateMushroom(const ObjectCreateParams& params)
obj->SetAngleY(0, angle); obj->SetAngleY(0, angle);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 5.0f, 0.0f), 3.0f, SOUND_BOUM, 0.10f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 5.0f, 0.0f), 3.0f, SOUND_BOUM, 0.10f));
obj->SetGlobalSphere(Math::Vector(0.0f, 4.0f, 0.0f), 5.5f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 5.5f));
obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 5.5f)); obj->SetJostlingSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 5.5f));
obj->CreateShadowCircle(5.0f, 0.5f); obj->CreateShadowCircle(5.0f, 0.5f);
@ -1661,7 +1661,7 @@ CObjectUPtr CObjectFactory::CreateQuartz(const ObjectCreateParams& params)
obj->SetAngleY(0, angle); obj->SetAngleY(0, angle);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 2.0f, 0.0f), 3.5f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 2.0f, 0.0f), 3.5f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 2.0f, 0.0f), 3.5f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 2.0f, 0.0f), 3.5f));
obj->CreateShadowCircle(4.0f, 0.5f); obj->CreateShadowCircle(4.0f, 0.5f);
} }
@ -1675,7 +1675,7 @@ CObjectUPtr CObjectFactory::CreateQuartz(const ObjectCreateParams& params)
obj->SetAngleY(0, angle); obj->SetAngleY(0, angle);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 4.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 4.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 4.0f, 0.0f), 5.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 5.0f));
obj->CreateShadowCircle(5.0f, 0.5f); obj->CreateShadowCircle(5.0f, 0.5f);
} }
@ -1689,7 +1689,7 @@ CObjectUPtr CObjectFactory::CreateQuartz(const ObjectCreateParams& params)
obj->SetAngleY(0, angle); obj->SetAngleY(0, angle);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 6.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 6.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 6.0f, 0.0f), 6.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 6.0f, 0.0f), 6.0f));
obj->CreateShadowCircle(6.0f, 0.5f); obj->CreateShadowCircle(6.0f, 0.5f);
} }
@ -1703,7 +1703,7 @@ CObjectUPtr CObjectFactory::CreateQuartz(const ObjectCreateParams& params)
obj->SetAngleY(0, angle); obj->SetAngleY(0, angle);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 10.0f, 0.0f), 10.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 10.0f, 0.0f), 10.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 10.0f, 0.0f), 10.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 10.0f, 0.0f), 10.0f));
obj->CreateShadowCircle(10.0f, 0.5f); obj->CreateShadowCircle(10.0f, 0.5f);
} }
@ -1774,7 +1774,7 @@ CObjectUPtr CObjectFactory::CreateRoot(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-4.0f, 5.0f, -1.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-4.0f, 5.0f, -1.0f), 1.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-2.0f, 8.0f, -0.5f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-2.0f, 8.0f, -0.5f), 1.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 10.0f, -0.5f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 10.0f, -0.5f), 1.0f, SOUND_BOUMv, 0.15f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 6.0f, 0.0f), 11.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 6.0f, 0.0f), 11.0f));
obj->CreateShadowCircle(16.0f, 0.5f); obj->CreateShadowCircle(16.0f, 0.5f);
} }
@ -1795,7 +1795,7 @@ CObjectUPtr CObjectFactory::CreateRoot(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( 2.0f, 5.0f, 0.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 2.0f, 5.0f, 0.0f), 1.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 8.0f, 1.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 8.0f, 1.0f), 1.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 12.0f, 1.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 12.0f, 1.0f), 1.0f, SOUND_BOUMv, 0.15f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 6.0f, 0.0f), 12.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 6.0f, 0.0f), 12.0f));
obj->CreateShadowCircle(16.0f, 0.5f); obj->CreateShadowCircle(16.0f, 0.5f);
} }
@ -1815,7 +1815,7 @@ CObjectUPtr CObjectFactory::CreateRoot(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( 3.0f, 7.0f, 1.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 3.0f, 7.0f, 1.0f), 1.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 7.0f, -1.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 7.0f, -1.0f), 1.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 4.0f, 11.0f, 1.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 4.0f, 11.0f, 1.0f), 1.0f, SOUND_BOUMv, 0.15f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 6.0f, 0.0f), 10.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 6.0f, 0.0f), 10.0f));
obj->CreateShadowCircle(16.0f, 0.5f); obj->CreateShadowCircle(16.0f, 0.5f);
} }
@ -1837,7 +1837,7 @@ CObjectUPtr CObjectFactory::CreateRoot(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( 3.0f, 6.0f, -1.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 3.0f, 6.0f, -1.0f), 1.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 12.0f, 0.0f), 2.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 12.0f, 0.0f), 2.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 1.0f, 16.0f, 0.0f), 1.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 1.0f, 16.0f, 0.0f), 1.0f, SOUND_BOUMv, 0.15f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 10.0f, 0.0f), 14.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 10.0f, 0.0f), 14.0f));
obj->CreateShadowCircle(22.0f, 0.5f); obj->CreateShadowCircle(22.0f, 0.5f);
} }
@ -1861,7 +1861,7 @@ CObjectUPtr CObjectFactory::CreateRoot(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( 3.0f, 11.0f, -3.0f), 2.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 3.0f, 11.0f, -3.0f), 2.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( -3.0f, 17.0f, 1.0f), 2.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( -3.0f, 17.0f, 1.0f), 2.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( -3.0f, 23.0f, -1.0f), 2.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( -3.0f, 23.0f, -1.0f), 2.0f, SOUND_BOUMv, 0.15f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 12.0f, 0.0f), 20.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 12.0f, 0.0f), 20.0f));
obj->CreateShadowCircle(30.0f, 0.5f); obj->CreateShadowCircle(30.0f, 0.5f);
} }
@ -1894,7 +1894,7 @@ CObjectUPtr CObjectFactory::CreateRoot(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( 3.0f, 11.0f, -3.0f), 2.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 3.0f, 11.0f, -3.0f), 2.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( -3.0f, 17.0f, 1.0f), 2.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( -3.0f, 17.0f, 1.0f), 2.0f, SOUND_BOUMv, 0.15f));
obj->AddCrashSphere(CrashSphere(Math::Vector( -3.0f, 23.0f, -1.0f), 2.0f, SOUND_BOUMv, 0.15f)); obj->AddCrashSphere(CrashSphere(Math::Vector( -3.0f, 23.0f, -1.0f), 2.0f, SOUND_BOUMv, 0.15f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 12.0f, 0.0f), 20.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 12.0f, 0.0f), 20.0f));
obj->CreateShadowCircle(30.0f, 0.5f); obj->CreateShadowCircle(30.0f, 0.5f);
} }
@ -1935,7 +1935,7 @@ CObjectUPtr CObjectFactory::CreateHome(const ObjectCreateParams& params)
obj->SetZoom(0, 1.3f); obj->SetZoom(0, 1.3f);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f, SOUND_BOUMs, 0.25f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f, SOUND_BOUMs, 0.25f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 6.0f, 0.0f), 11.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 6.0f, 0.0f), 11.0f));
obj->CreateShadowCircle(16.0f, 0.5f); obj->CreateShadowCircle(16.0f, 0.5f);
} }
@ -2037,7 +2037,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
obj->SetAngleX(9, 0.2f); obj->SetAngleX(9, 0.2f);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 2.8f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 2.8f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f));
obj->CreateShadowCircle(4.0f, 1.0f); obj->CreateShadowCircle(4.0f, 1.0f);
} }
@ -2069,7 +2069,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
obj->SetAngleX(9, -0.3f); obj->SetAngleX(9, -0.3f);
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 2.8f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 2.8f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f));
obj->CreateShadowCircle(4.0f, 1.0f); obj->CreateShadowCircle(4.0f, 1.0f);
} }
@ -2090,7 +2090,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
obj->SetAngleZ(1, -0.1f); obj->SetAngleZ(1, -0.1f);
obj->AddCrashSphere(CrashSphere(Math::Vector(1.0f, 2.8f, -1.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(1.0f, 2.8f, -1.0f), 5.0f, SOUND_BOUMm, 0.45f));
//? obj->SetGlobalSphere(Math::Vector(1.0f, 5.0f, -1.0f), 10.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(1.0f, 5.0f, -1.0f), 10.0f));
obj->CreateShadowCircle(5.0f, 1.0f); obj->CreateShadowCircle(5.0f, 1.0f);
} }
@ -2098,7 +2098,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
if ( type == OBJECT_RUINmobilet2 ) // vehicle have caterpillars? if ( type == OBJECT_RUINmobilet2 ) // vehicle have caterpillars?
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 2.8f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 2.8f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f));
obj->CreateShadowCircle(5.0f, 1.0f); obj->CreateShadowCircle(5.0f, 1.0f);
} }
@ -2106,7 +2106,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
if ( type == OBJECT_RUINmobiler1 ) // vehicle skating? if ( type == OBJECT_RUINmobiler1 ) // vehicle skating?
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(1.0f, 2.8f, -1.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(1.0f, 2.8f, -1.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(1.0f, 5.0f, -1.0f), 10.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(1.0f, 5.0f, -1.0f), 10.0f));
obj->CreateShadowCircle(5.0f, 1.0f); obj->CreateShadowCircle(5.0f, 1.0f);
} }
@ -2114,7 +2114,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
if ( type == OBJECT_RUINmobiler2 ) // vehicle skating? if ( type == OBJECT_RUINmobiler2 ) // vehicle skating?
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 1.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 5.0f, 0.0f), 10.0f));
obj->CreateShadowCircle(6.0f, 1.0f); obj->CreateShadowCircle(6.0f, 1.0f);
} }
@ -2130,7 +2130,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 2.0f, 4.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 2.0f, 4.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 2.0f, 10.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-11.0f, 2.0f, 10.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( -4.0f, 0.0f, 10.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( -4.0f, 0.0f, 10.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 18.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 18.0f));
obj->CreateShadowCircle(20.0f, 0.7f); obj->CreateShadowCircle(20.0f, 0.7f);
} }
@ -2138,7 +2138,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
if ( type == OBJECT_RUINdoor ) // converter holder? if ( type == OBJECT_RUINdoor ) // converter holder?
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 6.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 6.0f));
obj->CreateShadowCircle(6.0f, 1.0f); obj->CreateShadowCircle(6.0f, 1.0f);
} }
@ -2146,7 +2146,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
if ( type == OBJECT_RUINsupport ) // radar holder? if ( type == OBJECT_RUINsupport ) // radar holder?
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 3.0f, SOUND_BOUMm, 0.45f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 4.0f));
obj->CreateShadowCircle(3.0f, 1.0f); obj->CreateShadowCircle(3.0f, 1.0f);
} }
@ -2154,7 +2154,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
if ( type == OBJECT_RUINradar ) // radar base? if ( type == OBJECT_RUINradar ) // radar base?
{ {
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 0.0f, 0.0f), 5.0f, SOUND_BOUMm, 0.45f));
//? obj->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 6.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 6.0f));
obj->CreateShadowCircle(6.0f, 1.0f); obj->CreateShadowCircle(6.0f, 1.0f);
} }
@ -2165,7 +2165,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 0.0f, 4.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 0.0f, 4.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 0.0f, -4.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(-10.0f, 0.0f, -4.0f), 5.0f, SOUND_BOUMm, 0.45f));
//? obj->SetGlobalSphere(Math::Vector(-3.0f, 0.0f, 0.0f), 14.0f); //? obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(-3.0f, 0.0f, 0.0f), 14.0f));
} }
if ( type == OBJECT_RUINbase ) // base? if ( type == OBJECT_RUINbase ) // base?
@ -2185,7 +2185,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( 31.0f, 15.0f, -13.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 31.0f, 15.0f, -13.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 21.0f, 8.0f, -39.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 21.0f, 8.0f, -39.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 26.0f, 8.0f, -33.0f), 5.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 26.0f, 8.0f, -33.0f), 5.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 48.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 48.0f));
obj->CreateShadowCircle(40.0f, 1.0f); obj->CreateShadowCircle(40.0f, 1.0f);
} }
@ -2204,7 +2204,7 @@ CObjectUPtr CObjectFactory::CreateRuin(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( -9.0f, 7.0f, -21.0f), 8.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( -9.0f, 7.0f, -21.0f), 8.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 21.0f, 7.0f, -9.0f), 8.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 21.0f, 7.0f, -9.0f), 8.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 9.0f, 7.0f, -21.0f), 8.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 9.0f, 7.0f, -21.0f), 8.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 0.0f, 0.0f), 35.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 0.0f, 0.0f), 35.0f));
obj->CreateShadowCircle(30.0f, 1.0f); obj->CreateShadowCircle(30.0f, 1.0f);
} }
@ -2414,7 +2414,7 @@ CObjectUPtr CObjectFactory::CreateApollo(const ObjectCreateParams& params)
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 5.0f, -11.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 5.0f, -11.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 5.0f, 11.0f), 3.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector( 0.0f, 5.0f, 11.0f), 3.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 4.0f, 0.0f), 9.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 4.0f, 0.0f), 9.0f));
obj->CreateShadowCircle(16.0f, 0.5f); obj->CreateShadowCircle(16.0f, 0.5f);
} }

View File

@ -297,8 +297,6 @@ COldObject::COldObject(int id)
m_cmdLine.clear(); m_cmdLine.clear();
DeleteAllCrashSpheres(); DeleteAllCrashSpheres();
m_globalSpherePos = Math::Vector(0.0f, 0.0f, 0.0f);
m_globalSphereRadius = 0.0f;
CBotClass* bc = CBotClass::Find("object"); CBotClass* bc = CBotClass::Find("object");
if ( bc != 0 ) if ( bc != 0 )
@ -1088,23 +1086,10 @@ void COldObject::TransformCrashSphere(Math::Sphere& crashSphere)
crashSphere.pos = Math::Transform(m_objectPart[0].matWorld, crashSphere.pos); crashSphere.pos = Math::Transform(m_objectPart[0].matWorld, crashSphere.pos);
} }
// Specifies the global sphere, relative to the object. void COldObject::TransformCameraCollisionSphere(Math::Sphere& collisionSphere)
void COldObject::SetGlobalSphere(Math::Vector pos, float radius)
{ {
float zoom; collisionSphere.pos = Math::Transform(m_objectPart[0].matWorld, collisionSphere.pos);
collisionSphere.radius *= GetZoomX(0);
zoom = GetZoomX(0);
m_globalSpherePos = pos;
m_globalSphereRadius = radius*zoom;
}
// Returns the global sphere, in the world.
void COldObject::GetGlobalSphere(Math::Vector &pos, float &radius)
{
pos = Math::Transform(m_objectPart[0].matWorld, m_globalSpherePos);
radius = m_globalSphereRadius;
} }

View File

@ -112,8 +112,6 @@ public:
int GetShadowLight() override; int GetShadowLight() override;
int GetEffectLight() override; int GetEffectLight() override;
void SetGlobalSphere(Math::Vector pos, float radius) override;
void GetGlobalSphere(Math::Vector &pos, float &radius) override;
void SetShieldRadius(float radius) override; void SetShieldRadius(float radius) override;
float GetShieldRadius() override; float GetShieldRadius() override;
@ -324,6 +322,7 @@ protected:
bool UpdateTransformObject(); bool UpdateTransformObject();
void UpdateSelectParticle(); void UpdateSelectParticle();
void TransformCrashSphere(Math::Sphere &crashSphere) override; void TransformCrashSphere(Math::Sphere &crashSphere) override;
void TransformCameraCollisionSphere(Math::Sphere& collisionSphere) override;
protected: protected:
Gfx::CEngine* m_engine; Gfx::CEngine* m_engine;
@ -396,8 +395,6 @@ protected:
float m_param; float m_param;
int m_team; int m_team;
Math::Vector m_globalSpherePos;
float m_globalSphereRadius;
Math::Sphere m_jostlingSphere; Math::Sphere m_jostlingSphere;
float m_shieldRadius; float m_shieldRadius;

View File

@ -98,8 +98,6 @@ public:
virtual int GetShadowLight() = 0; virtual int GetShadowLight() = 0;
virtual int GetEffectLight() = 0; virtual int GetEffectLight() = 0;
virtual void SetGlobalSphere(Math::Vector pos, float radius) = 0;
virtual void GetGlobalSphere(Math::Vector &pos, float &radius) = 0;
virtual void SetShieldRadius(float radius) = 0; virtual void SetShieldRadius(float radius) = 0;
virtual float GetShieldRadius() = 0; virtual float GetShieldRadius() = 0;

View File

@ -87,7 +87,7 @@ std::unique_ptr<CExchangePost> CExchangePost::Create(
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 3.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f));
obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 11.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f)); obj->AddCrashSphere(CrashSphere(Math::Vector(0.0f, 11.0f, 0.0f), 6.0f, SOUND_BOUMm, 0.45f));
obj->SetGlobalSphere(Math::Vector(0.0f, 5.0f, 0.0f), 6.0f); obj->SetCameraCollisionSphere(Math::Sphere(Math::Vector(0.0f, 5.0f, 0.0f), 6.0f));
obj->CreateShadowCircle(8.0f, 1.0f); obj->CreateShadowCircle(8.0f, 1.0f);