-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ship.h
36 lines (31 loc) · 878 Bytes
/
Ship.h
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
35
36
#pragma once
#include "engine/utils.h"
#include "engine/SceneObject.h"
#include "SceneEffect.h"
#include "SpaceObject.h"
class Ship : public SpaceObject
{
public:
Ship();
void onCreateDevice(Device* device);
void onDestroyDevice();
void draw(Scene* scene, SceneCamera* camera, Device* device);
void update(float frameDelta, SceneCamera* sceneCamera);
void onLostDevice();
void onResetDevice(Device* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc);
void loadFromFile(const char* filename);
private:
Matrix m_transform;
Matrix m_rotation;
Texture* m_texture;
SceneEffect* m_effect;
Vec2 m_dir;
float m_angle;
float m_angularA;
float m_angularVelocity;
float m_maxAngularSpeed;
Vec2 m_size;
float m_engineForce;
void computeAngular(float dt);
void computeTranslation(float dt);
};