Merge branch 'GameLogic' of https://github.com/dean11/Danbias into GameLogic

This commit is contained in:
Linda Andersson 2013-12-19 11:58:54 +01:00
commit 27aad0d86f
3 changed files with 41 additions and 5 deletions

View File

@ -143,9 +143,25 @@ using namespace GameLogic;
void GameSession::EricLogicInitFunc()
{
//CollisionManager::BoxCollision(0,0);
CollisionManager::BoxCollision(0,0);
objectBox = new DynamicObject(CollisionManager::BoxCollision, OBJECT_TYPE::OBJECT_TYPE_BOX);
Protocol_CreateObject objectCreation;
objectCreation.object_ID = objectBox->GetID();
objectCreation.path = "crate";
Oyster::Math::Float4x4 worldMat = objectBox->GetRigidBody()->GetOrientation();
for (int i = 0; i < 16; i++)
{
objectCreation.worldMatrix[i] = worldMat[i];
}
for (int i = 0; i < clients.Size(); i++)
{
clients[i]->NetClient_Object()->Send(objectCreation);
}
//objectBox = new DynamicObject(CollisionManager::BoxCollision, OBJECT_TYPE::OBJECT_TYPE_BOX);
}
void GameSession::EricLogicFrameFunc()
{
@ -153,13 +169,31 @@ using namespace GameLogic;
}
void GameSession::EricsLogicTestingProtocalRecieved(ClientObject* reciever, CustomNetProtocol& protocol)
{
bool moved = false;
switch (protocol[protocol_ID_INDEX].value.netShort)
{
case protocol_Gameplay_PlayerNavigation:
ConvertToMovement(reciever, protocol);
moved = true;
break;
}
if (moved)
{
Protocol_ObjectPosition playerMovement;
Oyster::Math::Float4x4 worldMat = reciever->Logic_Object()->GetRigidBody()->GetOrientation();
playerMovement.object_ID = reciever->Logic_Object()->GetID();
for (int i = 0; i < 16; i++)
{
playerMovement.worldMatrix[i] = worldMat[i];
}
reciever->NetClient_Object()->Send(playerMovement);
}
}

View File

@ -11,7 +11,7 @@ namespace GameLogic
struct Protocol_CreateObject :public Oyster::Network::CustomProtocolObject
{
int object_ID;
char path[255];
char *path;
float worldMatrix[16];

View File

@ -233,9 +233,11 @@ namespace Oyster
virtual ~API() {}
};
//! The root interface for all physical representations processable by the engine.
class PHYSICS_DLL_USAGE ICustomBody
{
public:
enum SubscriptMessage
{