diff --git a/Code/Game/GameLogic/Object.cpp b/Code/Game/GameLogic/Object.cpp index 6fbc8189..6e198e45 100644 --- a/Code/Game/GameLogic/Object.cpp +++ b/Code/Game/GameLogic/Object.cpp @@ -105,11 +105,37 @@ void Object::setAfterCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_AfterCollisionResponse)(collisionFuncAfter)); } -Oyster::Math::Float3 Object::GetPosition() -{ - return (Oyster::Math::Float3) this->rigidBody->GetState().centerPos; -} + Oyster::Math::Float4x4 Object::GetOrientation() { - return this->rigidBody->GetState().GetOrientation(); + Oyster::Physics::ICustomBody::State state; + state = this->rigidBody->GetState(); + return state.GetOrientation(); +} + + +Oyster::Math::Float3 Object::GetPosition() +{ + return this->position; +} +Oyster::Math::Float3 Object::GetRotation() +{ + return this->rotation; +} +Oyster::Math::Float3 Object::GetScaling() +{ + return this->scale; +} + +void Object::SetPosition(Oyster::Math::Float3 position) +{ + this->position = position; +} +void Object::SetRotation(Oyster::Math::Float3 rotation) +{ + this->rotation = rotation; +} +void Object::SetScaling(Oyster::Math::Float3 scale) +{ + this->scale = scale; } \ No newline at end of file diff --git a/Code/Game/GameLogic/Object.h b/Code/Game/GameLogic/Object.h index 1098cb56..6e4b9a81 100644 --- a/Code/Game/GameLogic/Object.h +++ b/Code/Game/GameLogic/Object.h @@ -29,10 +29,17 @@ namespace GameLogic OBJECT_TYPE GetObjectType() const; void setID(int id); int GetID() const; - Oyster::Math::Float3 GetPosition(); Oyster::Math::Float4x4 GetOrientation(); + Oyster::Math::Float3 GetPosition(); + Oyster::Math::Float3 GetRotation(); + Oyster::Math::Float3 GetScaling(); + + void SetPosition(Oyster::Math::Float3 position); + void SetRotation(Oyster::Math::Float3 rotation); + void SetScaling(Oyster::Math::Float3 scale); + Oyster::Physics::ICustomBody* GetRigidBody(); void ApplyLinearImpulse(Oyster::Math::Float3 force); @@ -55,6 +62,11 @@ namespace GameLogic static const Game* gameInstance; Oyster::Math::Float3 currLook; Oyster::Math::Float3 newLook; + + Oyster::Math::Float3 position; + Oyster::Math::Float3 rotation; + Oyster::Math::Float3 scale; + }; }