Danbias/Code/GameLogic/Player.cpp

97 lines
1.8 KiB
C++
Raw Normal View History

2013-11-19 11:07:14 +01:00
#include "Player.h"
2013-11-25 11:03:06 +01:00
#include "OysterMath.h"
2013-11-19 11:07:14 +01:00
using namespace GameLogic;
2013-11-25 11:03:06 +01:00
using namespace Oyster::Physics;
using namespace Utility::DynamicMemory;
//void ColisionEvent(unsigned int obj1Ref, unsigned int obj2Ref)
//{
// const ICustomBody *body1 = &API::Instance().Peek( obj1Ref );
// const ICustomBody *body2 = &API::Instance().Peek( obj2Ref );
// if( body1 != &Error::nobody )
// {
// Object *obj1 = (Object*) const_cast<ICustomBody*>(body1);
//
// Object *obj2 = (Object*) const_cast<ICustomBody*>(body2);
//
// //switch( obj1->type )
// //{
// //case Player:
// // switch (obj2->type)
// // {
// // case l<>da:
// // //action
// // //soud
// // //particle effect
//
// // }
//
// //case l<>da :
//
//
// //}
// }
//
//}
void DestructionEvent(unsigned int obj1, ::Utility::DynamicMemory::UniquePointer<ICustomBody> obj2)
{
}
2013-11-19 11:07:14 +01:00
Player::Player(void)
2013-11-21 12:05:39 +01:00
:Object()
2013-11-19 11:07:14 +01:00
{
2013-11-21 12:05:39 +01:00
life = 10;
2013-11-25 11:03:06 +01:00
UniquePointer<ICustomBody> rigidBody = API::Instance().CreateSimpleRigidBody();
ref = API::Instance().AddObject(rigidBody);
//ref = API::Instance().AddObject(API::Instance().CreateSimpleRigidBody());
const ICustomBody* rB;
//rB = &API::Instance().Peek(ref);
//if( rB == &Error::nobody)
//{
// //error
//}
API::Instance().SetCenter(ref, Oyster::Math::Float3::null);
API::Instance().SetMass_KeepMomentum(ref, 20);
// get Tensor matrix (tr<74>ghetsmonent)
//API::Instance().SetMomentOfInertiaTensor_KeepMomentum(ref, tensorMatrix )
//Oyster::Math::Float3 ve = rB->GetCenter();
API::Instance().SetDeltaTime(0.01f);
//API::Instance().ApplyForceAt(ref, rB->GetCenter(), Oyster::Math::Float3::null);
//API::Instance().SetAction(ColisionEvent);
//API::Instance().Update();
2013-11-19 11:07:14 +01:00
}
Player::~Player(void)
{
2013-11-21 12:05:39 +01:00
}
void Player::Update()
{
2013-11-25 11:03:06 +01:00
//API::Instance().API::Update();
//API::Instance().API::ApplyForceAt(ref, )
2013-11-21 12:05:39 +01:00
}
void Player::Move()
{
}
void Player::Shoot()
{
2013-11-19 11:07:14 +01:00
}