Merge remote-tracking branch 'origin/GameLogic' into Camera-Merge-buffer
This commit is contained in:
commit
3139d6d409
|
@ -38,18 +38,14 @@ void AttatchmentMassDriver::UseAttatchment(const GameLogic::WEAPON_FIRE &usage,
|
|||
case WEAPON_FIRE::WEAPON_USE_PRIMARY_PRESS:
|
||||
ForcePush(usage,dt);
|
||||
break;
|
||||
|
||||
case WEAPON_FIRE::WEAPON_USE_SECONDARY_PRESS:
|
||||
|
||||
if(hasObject)
|
||||
{
|
||||
//ForcePush(usage,dt);//WARNING THIS IS A CRAP TEST TO MAKE SURE YOU CAN SHOOT BOXES
|
||||
break;
|
||||
}
|
||||
ForcePull(usage,dt);
|
||||
break;
|
||||
break;
|
||||
|
||||
case WEAPON_FIRE::WEAPON_USE_UTILLITY_PRESS:
|
||||
ForceZip(usage,dt);
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -117,12 +113,9 @@ void AttatchmentMassDriver::ForcePush(const GameLogic::WEAPON_FIRE &usage, float
|
|||
********************************************************/
|
||||
void AttatchmentMassDriver::ForceZip(const WEAPON_FIRE &usage, float dt)
|
||||
{
|
||||
Oyster::Physics::Struct::CustomBodyState state = this->owner->GetRigidBody()->GetState();
|
||||
Oyster::Math::Float3 force = Oyster::Math::Float4(this->owner->GetLookDir()) * (1000);
|
||||
|
||||
//do something with state
|
||||
//state.ApplyLinearImpulse(Oyster::Math::Float3(this->owner->GetLookDir()) * (500 * dt));
|
||||
|
||||
this->owner->GetRigidBody()->SetState(state);
|
||||
this->owner->GetRigidBody()->ApplyImpulse(force);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "Game.h"
|
||||
#include "CollisionManager.h"
|
||||
#include "JumpPad.h"
|
||||
#include "Portal.h"
|
||||
|
||||
using namespace Oyster;
|
||||
|
||||
|
@ -14,6 +15,7 @@ using namespace GameLogic;
|
|||
|
||||
void PlayerVObject(Player &player, Object &obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
void SendObjectFlying(Oyster::Physics::ICustomBody &obj, Oyster::Math::Float3 force);
|
||||
void Teleport(Oyster::Physics::ICustomBody &obj, Oyster::Math::Float3 target);
|
||||
|
||||
//Physics::ICustomBody::SubscriptMessage
|
||||
void Player::PlayerCollision(Oyster::Physics::ICustomBody *rigidBodyPlayer, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
|
@ -63,6 +65,20 @@ using namespace GameLogic;
|
|||
{
|
||||
obj.ApplyImpulse(force);
|
||||
}
|
||||
|
||||
void Portal::PortalActivated(Oyster::Physics::ICustomBody *rigidBodyPortal, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
{
|
||||
Portal *portal = (Portal*)(rigidBodyPortal->GetCustomTag());
|
||||
|
||||
if(obj->GetState().mass == 0) return;
|
||||
|
||||
Teleport(*obj,portal->portalExit);
|
||||
}
|
||||
|
||||
void Teleport(Oyster::Physics::ICustomBody &obj, Oyster::Math::Float3 target)
|
||||
{
|
||||
obj.SetPosition(target);
|
||||
}
|
||||
|
||||
|
||||
void PlayerVObject(Player &player, Object &obj, Oyster::Math::Float kineticEnergyLoss)
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#include "CrystalFormation.h"
|
||||
|
||||
using namespace GameLogic;
|
||||
|
||||
CrystalFormation::CrystalFormation(void)
|
||||
:StaticObject()
|
||||
{
|
||||
this->shreddingDamage = 0;
|
||||
}
|
||||
|
||||
CrystalFormation::CrystalFormation(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type, Oyster::Math::Float shreddingDamage)
|
||||
:StaticObject(rigidBody, collisionFuncAfter, type)
|
||||
{
|
||||
this->shreddingDamage = shreddingDamage;
|
||||
}
|
||||
|
||||
|
||||
CrystalFormation::~CrystalFormation(void)
|
||||
{
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef CRYSTALFORMATION_H
|
||||
#define CRYSTALFORMATION_H
|
||||
#include "StaticObject.h"
|
||||
namespace GameLogic
|
||||
{
|
||||
class CrystalFormation : public StaticObject
|
||||
{
|
||||
public:
|
||||
CrystalFormation(void);
|
||||
|
||||
CrystalFormation(Oyster::Physics::ICustomBody *rigidBody
|
||||
,void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss)
|
||||
,OBJECT_TYPE type, Oyster::Math::Float shreddingDamage);
|
||||
|
||||
~CrystalFormation(void);
|
||||
|
||||
private:
|
||||
Oyster::Math::Float shreddingDamage;
|
||||
};
|
||||
}
|
||||
#endif
|
|
@ -192,6 +192,7 @@
|
|||
<ClInclude Include="LevelLoader\LevelParser.h" />
|
||||
<ClInclude Include="LevelLoader\ParseFunctions.h" />
|
||||
<ClInclude Include="Player.h" />
|
||||
<ClInclude Include="Portal.h" />
|
||||
<ClInclude Include="StaticObject.h" />
|
||||
<ClInclude Include="Team.h" />
|
||||
<ClInclude Include="TeamManager.h" />
|
||||
|
@ -215,6 +216,7 @@
|
|||
<ClCompile Include="Object.cpp" />
|
||||
<ClCompile Include="LevelLoader\ParseFunctions.cpp" />
|
||||
<ClCompile Include="Player.cpp" />
|
||||
<ClCompile Include="Portal.cpp" />
|
||||
<ClCompile Include="StaticObject.cpp" />
|
||||
<ClCompile Include="Team.cpp" />
|
||||
<ClCompile Include="TeamManager.cpp" />
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
#include "Portal.h"
|
||||
|
||||
using namespace GameLogic;
|
||||
using namespace Oyster::Math;
|
||||
|
||||
Portal::Portal(void)
|
||||
:StaticObject()
|
||||
{
|
||||
this->portalExit = Float3(0,0,0);
|
||||
}
|
||||
|
||||
Portal::Portal(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type, Oyster::Math::Float3 portalExit)
|
||||
:StaticObject(rigidBody, collisionFuncAfter, type)
|
||||
{
|
||||
this->portalExit = portalExit;
|
||||
}
|
||||
|
||||
Portal::~Portal(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef PORTAL_H
|
||||
#define PORTAL_H
|
||||
#include "StaticObject.h"
|
||||
namespace GameLogic
|
||||
{
|
||||
class Portal : public StaticObject
|
||||
{
|
||||
public:
|
||||
Portal(void);
|
||||
|
||||
Portal(Oyster::Physics::ICustomBody *rigidBody
|
||||
,void (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss)
|
||||
,OBJECT_TYPE type, Oyster::Math::Float3 portalExit);
|
||||
|
||||
~Portal(void);
|
||||
|
||||
static void PortalActivated(Oyster::Physics::ICustomBody *rigidBodyPortal, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
|
||||
|
||||
private:
|
||||
Oyster::Math::Float3 portalExit;
|
||||
};
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue