Merge branch 'GameLogic' of https://github.com/dean11/Danbias into GameLogic
This commit is contained in:
commit
07e5519850
|
@ -25,18 +25,19 @@ void Level::InitiateLevel(float radius)
|
||||||
sbDesc.radius = 8; //radius;
|
sbDesc.radius = 8; //radius;
|
||||||
sbDesc.mass = 10e12f;
|
sbDesc.mass = 10e12f;
|
||||||
//sbDesc.mass = 0; //10^16
|
//sbDesc.mass = 0; //10^16
|
||||||
sbDesc.subscription_onCollisionResponse = Level::LevelCollision;
|
|
||||||
levelObj = new StaticObject(OBJECT_TYPE::OBJECT_TYPE_WORLD);
|
|
||||||
|
|
||||||
|
|
||||||
ICustomBody* rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
|
ICustomBody* rigidBody = API::Instance().CreateRigidBody(sbDesc).Release();
|
||||||
rigidBody->SetCustomTag(levelObj);
|
rigidBody->SetCustomTag(levelObj);
|
||||||
API::Instance().AddObject(rigidBody);
|
|
||||||
ICustomBody::State state;
|
ICustomBody::State state;
|
||||||
rigidBody->GetState(state);
|
rigidBody->GetState(state);
|
||||||
state.SetRestitutionCoeff(0.1);
|
state.SetRestitutionCoeff(0.1);
|
||||||
rigidBody->SetState(state);
|
rigidBody->SetState(state);
|
||||||
|
|
||||||
|
levelObj = new StaticObject(rigidBody, LevelCollision, OBJECT_TYPE::OBJECT_TYPE_WORLD);
|
||||||
|
|
||||||
API::Gravity gravityWell;
|
API::Gravity gravityWell;
|
||||||
|
|
||||||
gravityWell.gravityType = API::Gravity::GravityType_Well;
|
gravityWell.gravityType = API::Gravity::GravityType_Well;
|
||||||
|
|
|
@ -49,6 +49,17 @@ Object::Object(void* collisionFunc, OBJECT_TYPE type)
|
||||||
this->type = type;
|
this->type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object::Object(ICustomBody *rigidBody ,void* collisionFunc, OBJECT_TYPE type)
|
||||||
|
{
|
||||||
|
Oyster::Physics::API::Instance().AddObject(rigidBody);
|
||||||
|
|
||||||
|
rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Collision)(collisionFunc));
|
||||||
|
|
||||||
|
this->objectID = GID();
|
||||||
|
|
||||||
|
this->type = type;
|
||||||
|
}
|
||||||
|
|
||||||
void Object::ApplyLinearImpulse(Oyster::Math::Float4 force)
|
void Object::ApplyLinearImpulse(Oyster::Math::Float4 force)
|
||||||
{
|
{
|
||||||
setState.ApplyLinearImpulse(force);
|
setState.ApplyLinearImpulse(force);
|
||||||
|
|
|
@ -18,6 +18,7 @@ namespace GameLogic
|
||||||
public:
|
public:
|
||||||
Object();
|
Object();
|
||||||
Object(void* collisionFunc, OBJECT_TYPE type);
|
Object(void* collisionFunc, OBJECT_TYPE type);
|
||||||
|
Object(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFunc, OBJECT_TYPE type);
|
||||||
~Object(void);
|
~Object(void);
|
||||||
|
|
||||||
OBJECT_TYPE GetType() const;
|
OBJECT_TYPE GetType() const;
|
||||||
|
|
|
@ -18,8 +18,6 @@ Player::Player()
|
||||||
lookDir = Oyster::Math::Float4(0,0,-1,0);
|
lookDir = Oyster::Math::Float4(0,0,-1,0);
|
||||||
setState.SetCenterPosition(Oyster::Math::Float4(0,15,0,1));
|
setState.SetCenterPosition(Oyster::Math::Float4(0,15,0,1));
|
||||||
setState.SetReach(Oyster::Math::Float4(2,3.5,2,0));
|
setState.SetReach(Oyster::Math::Float4(2,3.5,2,0));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Player::~Player(void)
|
Player::~Player(void)
|
||||||
|
|
|
@ -19,6 +19,11 @@ StaticObject::StaticObject(OBJECT_TYPE type)
|
||||||
:Object(NULL,type)
|
:Object(NULL,type)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
StaticObject::StaticObject(Oyster::Physics::ICustomBody *rigidBody,void* collisionFunc, OBJECT_TYPE type)
|
||||||
|
:Object(rigidBody,collisionFunc,type)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace GameLogic
|
||||||
public:
|
public:
|
||||||
StaticObject();
|
StaticObject();
|
||||||
StaticObject(void* collisionFunc, OBJECT_TYPE type);
|
StaticObject(void* collisionFunc, OBJECT_TYPE type);
|
||||||
|
StaticObject(Oyster::Physics::ICustomBody *rigidBody,void* collisionFunc, OBJECT_TYPE type);
|
||||||
StaticObject(OBJECT_TYPE type);
|
StaticObject(OBJECT_TYPE type);
|
||||||
~StaticObject(void);
|
~StaticObject(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue