impulse list and velocity for physics

This commit is contained in:
viktorljung
2015-09-14 16:06:48 +01:00
parent dfef1ec774
commit 2d7b32b7a3
3 changed files with 31 additions and 4 deletions
+1
View File
@@ -114,6 +114,7 @@ public:
std::shared_ptr<Components::Transform> transform = m_World->AddComponent<Components::Transform>(ent);
transform->Position = glm::vec3(0.5f, 0.f, -10.f);
transform->Scale = glm::vec3(1.f, 1.f, 1.f);
transform->Velocity = glm::vec3(0.0f, 0.f, 0.f);
std::shared_ptr<Components::Sprite> sprite = m_World->AddComponent<Components::Sprite>(ent);
sprite->SpriteFile = "Textures/Ball.png";
+10
View File
@@ -65,6 +65,16 @@ private:
void CreateBody(EntityID entity);
struct Impulse
{
b2Body* Body;
b2Vec2 Impulse;
b2Vec2 Point;
};
std::list<Impulse> m_Impulses;
class ContactListener : public b2ContactListener
{
public: