Merge branch 'GameLogic' of https://github.com/dean11/Danbias into GameServer
This commit is contained in:
commit
aa19904fa0
|
@ -46,7 +46,7 @@ using namespace GameLogic;
|
|||
break;
|
||||
|
||||
case ObjectSpecialType::ObjectSpecialType_CrystalFormation:
|
||||
PlayerVLethalObject(*player,*realObj, kineticEnergyLoss,realObj->getExtraDamageOnCollision());
|
||||
PlayerVLethalObject(*player,*realObj, kineticEnergyLoss,realObj->GetExtraDamageOnCollision());
|
||||
//player->playerState = PLAYER_STATE::PLAYER_STATE_WALKING;
|
||||
break;
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ using namespace GameLogic;
|
|||
}
|
||||
}
|
||||
|
||||
Oyster::Physics::ICustomBody::SubscriptMessage Object::DefaultCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
Oyster::Physics::ICustomBody::SubscriptMessage Object::DefaultOnCollision(Oyster::Physics::ICustomBody *rigidBodyObject, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
{
|
||||
return Physics::ICustomBody::SubscriptMessage_none;
|
||||
}
|
||||
|
|
|
@ -68,12 +68,33 @@ void Game::GetAllPlayerPositions() const
|
|||
Game::PlayerData* Game::CreatePlayer()
|
||||
{
|
||||
// Find a free space in array or insert at end
|
||||
int i = InsertObject(this->players, (PlayerData*)0);
|
||||
int insert = InsertObject(this->players, (PlayerData*)0);
|
||||
int freeID = 0;
|
||||
bool found = false;
|
||||
|
||||
this->players[i] = new PlayerData();
|
||||
this->players[i]->player->GetRigidBody()->SetSubscription(Game::PhysicsOnMove);
|
||||
for(int i = 0; i < 100; i++)
|
||||
{
|
||||
found = true;
|
||||
freeID = i;
|
||||
|
||||
return this->players[i];
|
||||
for(int j = 0; j < players.Size(); j++)
|
||||
{
|
||||
|
||||
if(this->players[j] && this->players[j]->GetID() == freeID)
|
||||
{
|
||||
found = false;
|
||||
}
|
||||
|
||||
if(!found) break;
|
||||
}
|
||||
|
||||
if(found) break;
|
||||
}
|
||||
|
||||
this->players[insert] = new PlayerData(freeID, 0); // user constructor with objectID and teamID
|
||||
this->players[insert]->player->GetRigidBody()->SetSubscription(Game::PhysicsOnMove);
|
||||
|
||||
return this->players[insert];
|
||||
}
|
||||
|
||||
Game::LevelData* Game::CreateLevel(const wchar_t mapName[255])
|
||||
|
@ -95,21 +116,15 @@ bool Game::NewFrame()
|
|||
{
|
||||
for (unsigned int i = 0; i < this->players.Size(); i++)
|
||||
{
|
||||
if(this->players[i]->player) this->players[i]->player->BeginFrame();
|
||||
if(this->players[i] && this->players[i]->player) this->players[i]->player->BeginFrame();
|
||||
}
|
||||
|
||||
API::Instance().UpdateWorld();
|
||||
|
||||
for (unsigned int i = 0; i < this->players.Size(); i++)
|
||||
{
|
||||
if(this->players[i]->player) this->players[i]->player->EndFrame();
|
||||
gameInstance.onMoveFnc(this->players[i]);
|
||||
if(this->players[i] && this->players[i]->player) this->players[i]->player->EndFrame();
|
||||
}
|
||||
for (unsigned int i = 0; i < this->level->level->dynamicObjects.Size(); i++)
|
||||
{
|
||||
gameInstance.onMoveFnc(this->level->level->dynamicObjects[i]);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -21,13 +21,23 @@ Game::PlayerData::PlayerData()
|
|||
rigidBody->SetAngularFactor(0.0f);
|
||||
//create player with this rigid body
|
||||
this->player = new Player(rigidBody, Player::PlayerCollision, ObjectSpecialType_Player,0,0);
|
||||
|
||||
//this->player->GetRigidBody()->SetCustomTag(this);
|
||||
player->EndFrame();
|
||||
}
|
||||
Game::PlayerData::PlayerData(int playerID,int teamID)
|
||||
{
|
||||
this->player = new Player();
|
||||
Oyster::Math::Float3 centerPosition = Oyster::Math::Float3(50,130,0);
|
||||
|
||||
Oyster::Math::Float3 size = Oyster::Math::Float3(0.25f,2.0f,0.5f);
|
||||
Oyster::Math::Float mass = 60;
|
||||
Oyster::Math::Float restitutionCoeff = 0.5f;
|
||||
Oyster::Math::Float frictionCoeff_Static = 0.4f;
|
||||
Oyster::Math::Float frictionCoeff_Dynamic = 0.3f;
|
||||
//sbDesc.quaternion = Oyster::Math::Float3(0, Oyster::Math::pi, 0);
|
||||
|
||||
//create rigid body
|
||||
Oyster::Physics::ICustomBody* rigidBody = Oyster::Physics::API::Instance().AddCollisionBox(size, Oyster::Math::Float4(0, 0, 0, 1), centerPosition, mass, 0.5f, 0.8f, 0.6f );
|
||||
rigidBody->SetAngularFactor(0.0f);
|
||||
//create player with this rigid body
|
||||
this->player = new Player(rigidBody, Player::PlayerCollision, ObjectSpecialType_Player,playerID,teamID);
|
||||
}
|
||||
Game::PlayerData::~PlayerData()
|
||||
{
|
||||
|
|
|
@ -26,14 +26,14 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
{
|
||||
case ObjectSpecialType_None:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Sky:
|
||||
{
|
||||
float skySize = ((SkyAttributes*)obj)->skySize;
|
||||
//gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
//gameObj = new StaticObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_World:
|
||||
|
@ -44,21 +44,21 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
float worldSize = ((WorldAttributes*)obj)->worldSize;
|
||||
float atmosphereSize = ((WorldAttributes*)obj)->atmoSphereSize;
|
||||
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Building:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
case ObjectSpecialType_Stone:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_StandardBox:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_RedExplosiveBox:
|
||||
|
@ -75,24 +75,24 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
// break;
|
||||
case ObjectSpecialType_SpikeBox:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_Spike:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_CrystalFormation:
|
||||
{
|
||||
int dmg = 50;
|
||||
//gameObj = new Crystal(rigidBody);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_CrystalShard:
|
||||
{
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new DynamicObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
case ObjectSpecialType_JumpPad:
|
||||
|
@ -122,12 +122,12 @@ Object* Level::createGameObj(ObjectHeader* obj, ICustomBody* rigidBody)
|
|||
break;
|
||||
case ObjectSpecialType_Generic:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultCollisionAfter, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
gameObj = new StaticObject(rigidBody, Object::DefaultOnCollision, (ObjectSpecialType)obj->specialTypeID, objID++);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -360,14 +360,14 @@ bool Level::InitiateLevel(float radius)
|
|||
{
|
||||
rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(0.0f, 605.0f + i*5.0f, 10.0f), 5.0f, 0.5f, 0.8f, 0.6f);
|
||||
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox, Object::DefaultCollisionAfter, ObjectSpecialType_StandardBox, idCount++));
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox, Object::DefaultOnCollision, ObjectSpecialType_StandardBox, idCount++));
|
||||
}
|
||||
/*offset += nrOfBoxex;
|
||||
for(int i =0; i< nrOfBoxex; i ++)
|
||||
{
|
||||
rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0,5, -605 -( i*5)), 5);
|
||||
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultOnCollision, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
rigidBody_TestBox->SetCustomTag(this->dynamicObjects[i+offset]);
|
||||
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ bool Level::InitiateLevel(float radius)
|
|||
{
|
||||
rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(200, 620 + ( i*7), 0), 5);
|
||||
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultOnCollision, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
rigidBody_TestBox->SetCustomTag(this->dynamicObjects[i+offset]);
|
||||
}
|
||||
offset += nrOfBoxex;
|
||||
|
@ -384,18 +384,18 @@ bool Level::InitiateLevel(float radius)
|
|||
{
|
||||
rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(5, 605 + i*5, 0), 5);
|
||||
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultOnCollision, OBJECT_TYPE::OBJECT_TYPE_BOX));
|
||||
rigidBody_TestBox->SetCustomTag(this->dynamicObjects[i]);
|
||||
|
||||
}*/
|
||||
|
||||
// add crystal
|
||||
ICustomBody* rigidBody_Crystal = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(10.0f, 605.0f, 0.0f), 5.0f, 0.5f, 0.8f, 0.6f);
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_Crystal, Object::DefaultCollisionAfter, ObjectSpecialType_StandardBox, idCount++));
|
||||
this->dynamicObjects.Push(new DynamicObject(rigidBody_Crystal, Object::DefaultOnCollision, ObjectSpecialType_StandardBox, idCount++));
|
||||
|
||||
// add house
|
||||
ICustomBody* rigidBody_House =API::Instance().AddCollisionBox(Oyster::Math::Float3(20.0f, 20.0f, 20.0f), Oyster::Math::Float4(0.0f, 0.0f, 0.0f, 1.0f), Oyster::Math::Float3(-50.0f, 590.0f, 0.0f), 0.0f, 0.5f, 0.8f, 0.6f);
|
||||
this->staticObjects.Push(new StaticObject(rigidBody_House, Object::DefaultCollisionAfter, ObjectSpecialType_Generic, idCount++));
|
||||
this->staticObjects.Push(new StaticObject(rigidBody_House, Object::DefaultOnCollision, ObjectSpecialType_Generic, idCount++));
|
||||
|
||||
// add jumppad
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@ const Game *Object::gameInstance = (Game*)(&Game::Instance());
|
|||
|
||||
Object::Object()
|
||||
{
|
||||
|
||||
this->rigidBody = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.0f, 0.0f, 0.0f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 0, 0), 0, 0.5f, 0.8f, 0.6f);
|
||||
|
||||
this->type = ObjectSpecialType_Unknown;
|
||||
this->objectID = -1;
|
||||
this->scale = Float3(1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
Object::Object(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID)
|
||||
|
@ -48,39 +48,12 @@ Object::~Object(void)
|
|||
|
||||
}
|
||||
|
||||
ObjectSpecialType Object::GetObjectType() const
|
||||
|
||||
void Object::SetOnCollision(OnCollisionCallback func)
|
||||
{
|
||||
return this->type;
|
||||
}
|
||||
int Object::GetID() const
|
||||
{
|
||||
return this->objectID;
|
||||
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_AfterCollisionResponse)(func));
|
||||
}
|
||||
|
||||
Oyster::Physics::ICustomBody* Object::GetRigidBody()
|
||||
{
|
||||
return this->rigidBody;
|
||||
}
|
||||
|
||||
|
||||
void Object::BeginFrame()
|
||||
{
|
||||
|
||||
}
|
||||
// update physic
|
||||
void Object::EndFrame()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Object::setBeforeCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter))
|
||||
{
|
||||
//this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_BeforeCollisionResponse)(collisionFuncBefore));
|
||||
}
|
||||
void Object::setAfterCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss))
|
||||
{
|
||||
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_AfterCollisionResponse)(collisionFuncAfter));
|
||||
}
|
||||
|
||||
Oyster::Math::Float3 Object::GetPosition()
|
||||
{
|
||||
|
@ -94,21 +67,9 @@ Oyster::Math::Quaternion Object::GetRotation()
|
|||
state = this->rigidBody->GetState();
|
||||
return state.quaternion;
|
||||
}
|
||||
Oyster::Math::Float3 Object::GetScale()
|
||||
{
|
||||
Oyster::Physics::ICustomBody::State state;
|
||||
state = this->rigidBody->GetState();
|
||||
return Float3();
|
||||
}
|
||||
Oyster::Math::Float4x4 Object::GetOrientation()
|
||||
{
|
||||
Oyster::Physics::ICustomBody::State state;
|
||||
state = this->rigidBody->GetState();
|
||||
return state.GetOrientation();
|
||||
}
|
||||
|
||||
|
||||
Oyster::Math::Float Object::getExtraDamageOnCollision()
|
||||
{
|
||||
return this->extraDamageOnCollision;
|
||||
}
|
|
@ -17,46 +17,38 @@ namespace GameLogic
|
|||
class Object :public IObjectData
|
||||
{
|
||||
public:
|
||||
Object();
|
||||
typedef Oyster::Physics::ICustomBody::SubscriptMessage (*OnCollisionCallback)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss);
|
||||
|
||||
public:
|
||||
Object();
|
||||
Object(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID);
|
||||
Object(Oyster::Physics::ICustomBody *rigidBody, Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), ObjectSpecialType type, int objectID);
|
||||
~Object(void);
|
||||
|
||||
ObjectSpecialType GetObjectType() const override;
|
||||
int GetID() const override;
|
||||
void setID(int id);
|
||||
Oyster::Math::Float3 GetPosition() override;
|
||||
Oyster::Math::Quaternion GetRotation() override;
|
||||
Oyster::Math::Float3 GetScale() override;
|
||||
Oyster::Math::Float4x4 GetOrientation() override;
|
||||
inline ObjectSpecialType GetObjectType() const override { return this->type; }
|
||||
inline int GetID() const override { return this->objectID; }
|
||||
inline Oyster::Math::Float3 GetScale() override { return this->scale; }
|
||||
inline Oyster::Math::Float3 GetPosition() override;
|
||||
inline Oyster::Math::Quaternion GetRotation() override;
|
||||
inline Oyster::Math::Float4x4 GetOrientation() override;
|
||||
inline Oyster::Physics::ICustomBody* GetRigidBody() { return this->rigidBody; }
|
||||
inline Oyster::Math::Float GetExtraDamageOnCollision() { return this->extraDamageOnCollision; }
|
||||
|
||||
Oyster::Math::Float getExtraDamageOnCollision();
|
||||
virtual void BeginFrame() { };
|
||||
virtual void EndFrame() { };
|
||||
|
||||
// API overrides
|
||||
|
||||
|
||||
|
||||
Oyster::Physics::ICustomBody* GetRigidBody();
|
||||
|
||||
virtual void BeginFrame();
|
||||
virtual void EndFrame();
|
||||
|
||||
void setBeforeCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter));
|
||||
void setAfterCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss));
|
||||
|
||||
static Oyster::Physics::ICustomBody::SubscriptMessage DefaultCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
|
||||
|
||||
public: //TODO: Hax This should be private when level is dynamic
|
||||
void SetOnCollision(OnCollisionCallback func);
|
||||
|
||||
static Oyster::Physics::ICustomBody::SubscriptMessage DefaultOnCollision(Oyster::Physics::ICustomBody *rigidBodyObject, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
|
||||
protected:
|
||||
Oyster::Physics::ICustomBody *rigidBody;
|
||||
|
||||
static const Game* gameInstance;
|
||||
Oyster::Math::Float3 currLook;
|
||||
Oyster::Math::Float3 newLook;
|
||||
|
||||
Oyster::Math::Float3 lookDirection; //The look direction for the camera
|
||||
Oyster::Math::Float3 forwardDirection; //The forward direction of the rigid body
|
||||
Oyster::Math::Float3 scale; //The scale of both rigid body and the mesh
|
||||
|
||||
ObjectSpecialType type;
|
||||
int objectID;
|
||||
|
|
|
@ -337,11 +337,7 @@ namespace Utility
|
|||
|
||||
template<typename ValueType>
|
||||
inline ValueType Clamp( const ValueType &value, const ValueType &min, const ValueType &max )
|
||||
{
|
||||
if( value < min ) return min;
|
||||
if( value > max ) return max;
|
||||
return value;
|
||||
}
|
||||
{ return value < min ? Max( value, max ) : min; }
|
||||
|
||||
template<typename ValueType>
|
||||
inline ValueType Average( const ValueType &valueA, const ValueType &valueB )
|
||||
|
|
Loading…
Reference in New Issue