Castle Battle  1.0
ball.h
Go to the documentation of this file.
1 #ifndef BALL_H
2 #define BALL_H
3 #include <irrlicht.h>
4 #include <vector>
5 #include "physics.h"
6 #include "bullethelper.h"
7 #include "camera.h"
8 using namespace irr;
9 
10 const f32 CAMERA_OFFSET_BALL = 2.5f;
12 class Ball{
13 
14  public:
15  scene::ISceneManager* smgr;
17  btRigidBody* btBall;
19  scene::ISceneNode* irrBall;
21  f32 radius = 0.3f;
23  core::vector3df cameraStartPosition;
27  IrrlichtDevice* device;
32  scene::ICameraSceneNode* parentCamera;
34  Ball(IrrlichtDevice* device, scene::ISceneManager* smgr, video::IVideoDriver* driver, Physics* physics, core::vector3df position);
35  ~Ball();
37  core::array<core::vector3df> points;
39  void setCamera(scene::ICameraSceneNode* camera, core::vector3df rotation = core::vector3df(0,0,0));
41  bool moveCamera();
43  void deleteCamera();
44 
45 
46 };
47 #endif
Ball represent the projectile of the cannon.
Definition: ball.h:12
IrrlichtDevice * device
Irrlicht device.
Definition: ball.h:27
scene::ICameraSceneNode * parentCamera
Parent camera of the ball, in particular is the cannon camera.
Definition: ball.h:32
scene::ISceneManager * smgr
Definition: ball.h:15
const f32 CAMERA_OFFSET_BALL
Definition: ball.h:10
Camera * camera
Camera of related to the ball.
Definition: ball.h:25
Physics class will handle all things related to collisions, creating Bullet physics objects and the p...
Definition: physics.h:12
scene::ISceneNode * irrBall
Irrlicht instance of the projectile.
Definition: ball.h:19
core::array< core::vector3df > points
Points of the ball while moving in air.
Definition: ball.h:37
btRigidBody * btBall
Bullet btRigitBody instance of the projectile.
Definition: ball.h:17
core::vector3df cameraStartPosition
Start position of the camera.
Definition: ball.h:23
Camera based on ICameraSceneNode of Irrlicht.
Definition: camera.h:6