-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRock.cpp
More file actions
34 lines (28 loc) · 1.03 KB
/
Copy pathRock.cpp
File metadata and controls
34 lines (28 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef ROCK_CPP
#define ROCK_CPP
#include "Rock.hpp"
void Rock::propagate(double const dt)
{
_physicsComp.propagate(dt);
_physicsWorld->apply_boundary(&_physicsComp);
}
void Rock::draw() const
{
_graphicsComp.draw(_physicsComp);
}
// Constructors
Rock::Rock(PhysicsWorld* const physicsWorld) :
_physicsComp(RockPhysicsComponent()),
_graphicsComp(RockGraphicsComponent()),
_physicsWorld(physicsWorld) {}
Rock::Rock(PhysicsWorld* const physicsWorld, GLfloat const radius) :
_physicsComp(RockPhysicsComponent(radius)),
_graphicsComp(RockGraphicsComponent()),
_physicsWorld(physicsWorld) {}
Rock::Rock( PhysicsWorld* const physicsWorld,
GLfloat const pos_x, GLfloat const pos_y, GLfloat const orientation,
GLfloat const movespeed, GLfloat const spinspeed, GLfloat const radius) :
_physicsComp(RockPhysicsComponent(pos_x, pos_y, orientation, movespeed, spinspeed, radius)),
_graphicsComp(RockGraphicsComponent()),
_physicsWorld(physicsWorld) {}
#endif /* Ship class implementation */