Castle Battle  1.0
Public Member Functions | Public Attributes | Private Attributes | List of all members
Cannon Class Reference

Cannon handles the cannon object. More...

#include <cannon.h>

Public Member Functions

 Cannon (IrrlichtDevice *device, scene::ISceneManager *smgr, video::IVideoDriver *driver, core::vector3df position, Physics *physics)
 
 ~Cannon ()
 
f32 refreshAngle ()
 Set angle variable and calculate the angle between the plane and the initBarrelVector. More...
 
core::aabbox3df getBoundingBox ()
 Get bounding box of the cannon. More...
 
scene::IMeshSceneNode * getCannon ()
 Get meshnode of the cannon. More...
 
core::matrix4 getInclinateValues (ACTION_KEYBOARD key)
 Handle user input to change cannon rotations. More...
 
core::vector3df getRange ()
 With some randomness get a position Z based on the cannon power- So there always be a trajectory to hit something in that position(e.g Target). More...
 
CameragetCamera ()
 Get camera of the cannon. More...
 
void setRotation (core::vector3df rotation)
 Set rotation of the cannon. More...
 
void shoot (f32 power)
 Based on the angles vector: initBarrelVector and the cannon power, this will shoot a Ball. More...
 
void setCamera (core::vector3df offset, core::vector3df rotation, scene::ISceneManager *smgr, scene::ISceneNode *node)
 Set camera of the cannon. More...
 
void setPosition (core::vector3df position)
 Set position of the cannon. More...
 
bool moveCannon (ACTION_KEYBOARD action)
 Handle moves in cannon left or right top and down (only angles ) More...
 
bool moveCamera ()
 Move projectile camera. More...
 
void initAngles ()
 Calculate init angles,. More...
 
void initCannon (core::vector3df position, core::vector3df rotation)
 Initialize with desired position and rotation. More...
 

Public Attributes

core::vector3df rotation
 
core::vector3df rotationconstraint
 Default constructor initialize the angles, setup meshes. More...
 

Private Attributes

scene::ISceneManager * smgr
 
IrrlichtDevice * device
 
video::IVideoDriver * driver
 
scene::IMeshSceneNode * cannon
 Cannon scene node. More...
 
scene::IMeshBuffer * barrel
 Barrel (cane) of the cannon. More...
 
scene::IMeshBuffer * wagon
 Wagon is the bottom part of the 3d cannon object. More...
 
f32 angle
 Angle of the cannon. More...
 
Cameracamera
 Fixed Camera of the cannon. More...
 
BallbtBall
 Projectile of the cannon. More...
 
Physicsphysics
 Physics instance More...
 
core::vector3df initialBarrelVector
 Initial vector ray. More...
 
core::vector3df initBarrelVector
 See ::initialBarrelVector. More...
 
core::vector3df plane
 The plane of the cannon. More...
 

Detailed Description

Cannon handles the cannon object.

All things like shoot, moving, camera effects are handled by this class. See also Player, Camera, Ball

Constructor & Destructor Documentation

◆ Cannon()

Cannon::Cannon ( IrrlichtDevice *  device,
scene::ISceneManager *  smgr,
video::IVideoDriver *  driver,
core::vector3df  position,
Physics physics 
)
10  {
11  this->smgr = smgr;
12  this->driver = driver;
13  this->device = device;
14  this->physics = physics;
15  scene::IMesh* mesh = this->smgr->getMesh("media/cannon/cannon.obj");
16  mesh = this->smgr->getMeshManipulator()->createMeshUniquePrimitives(mesh);
17  this->cannon = smgr->addMeshSceneNode(
18  mesh,
19  0,
20  -1,
21  position
22  );
23  this->cannon->setMaterialFlag(video::EMF_LIGHTING, false);
24  this->cannon->setMaterialTexture(0,driver->getTexture("media/cannon/cannon_tex.png"));
25  this->cannon->setMaterialTexture(1,driver->getTexture("media/cannon/cannonwagon_tex.png"));
26  this->barrel = mesh->getMeshBuffer(0);
27  this->wagon = mesh->getMeshBuffer(1);
28  #if (DEBUG_OUTPUT_MASK & 2)
29  this->cannon->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)scene::EDS_BBOX_BUFFERS);
30  #endif
31  this->angle = this->refreshAngle();
32  this->btBall = 0;
33  this->camera = 0;
34  this->rotation = core::vector3df(0,0,0);
35  this->initAngles();
36 }
Physics * physics
Physics instance
Definition: cannon.h:35
void initAngles()
Calculate init angles,.
Definition: cannon.cpp:45
f32 refreshAngle()
Set angle variable and calculate the angle between the plane and the initBarrelVector.
Definition: cannon.cpp:63
Camera * camera
Fixed Camera of the cannon.
Definition: cannon.h:31
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23
f32 angle
Angle of the cannon.
Definition: cannon.h:29
Ball * btBall
Projectile of the cannon.
Definition: cannon.h:33
scene::IMeshBuffer * wagon
Wagon is the bottom part of the 3d cannon object.
Definition: cannon.h:27
video::IVideoDriver * driver
Definition: cannon.h:21
core::vector3df rotation
Definition: cannon.h:47
IrrlichtDevice * device
Definition: cannon.h:20
scene::ISceneManager * smgr
Definition: cannon.h:19
scene::IMeshBuffer * barrel
Barrel (cane) of the cannon.
Definition: cannon.h:25

◆ ~Cannon()

Cannon::~Cannon ( )
37  {
38  delete this->camera;
39  delete this->cannon;
40  delete this->wagon;
41  delete this->barrel;
42  if(this->btBall) delete this->btBall;
43 
44 }
Camera * camera
Fixed Camera of the cannon.
Definition: cannon.h:31
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23
Ball * btBall
Projectile of the cannon.
Definition: cannon.h:33
scene::IMeshBuffer * wagon
Wagon is the bottom part of the 3d cannon object.
Definition: cannon.h:27
scene::IMeshBuffer * barrel
Barrel (cane) of the cannon.
Definition: cannon.h:25

Member Function Documentation

◆ getBoundingBox()

core::aabbox3df Cannon::getBoundingBox ( )

Get bounding box of the cannon.

139  {
140  return this->cannon->getBoundingBox();
141 }
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23

◆ getCamera()

Camera * Cannon::getCamera ( )

Get camera of the cannon.

263  {
264  return this->camera ? this->camera: 0;
265 }
Camera * camera
Fixed Camera of the cannon.
Definition: cannon.h:31

◆ getCannon()

scene::IMeshSceneNode * Cannon::getCannon ( )

Get meshnode of the cannon.

142  {
143  return this->cannon;
144 }
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23

◆ getInclinateValues()

core::matrix4 Cannon::getInclinateValues ( ACTION_KEYBOARD  key)

Handle user input to change cannon rotations.

Parameters
ACTIONrelated to the key pressed
Returns
matrix with the transformation
See also
::Keyboard
145  {
146 
147  irr::core::matrix4 m;
148  f32 velocity = 1;
149  core::vector3df asd;
150  switch(key){
151  case INCLINATE_UP:
152  if(this->refreshAngle() > MAX_ANGLE_TOP)
153  velocity = 0;
154  else {
155  this->angle = this->refreshAngle();
156  velocity = 1;
157  }
158  log2p("INCLINATE UP cannon degrees ", this->angle);
159  m.setRotationDegrees(core::vector3df(-INCLINATE_FACTOR * velocity,0,0));
160  m.rotateVect(this->initBarrelVector);
161  return m;
162  break;
163  case INCLINATE_DOWN:
164  if(this->refreshAngle() < MAX_ANGLE_BOTTOM)
165  velocity = 0;
166  else {
167  this->angle = this->refreshAngle();
168  velocity = 1;
169  }
170  log2p("INCLINATE DOWN cannon degrees ", this->angle);
171  m.setRotationDegrees(core::vector3df(INCLINATE_FACTOR * velocity,0,0));
172  m.rotateVect(this->initBarrelVector);
173  return m;
174  break;
175  case INCLINATE_LEFT:
176  if(this->cannon->getRotation().Y > (this->rotationconstraint.Y + MAX_ANGLE_LEFT))
177  velocity = 1;
178  else velocity = 0;
179 
180  this->cannon->setRotation(core::vector3df(0,this->cannon->getRotation().Y+(-INCLINATE_FACTOR * velocity),0));
181  this->cannon->updateAbsolutePosition();
182  log2p("INCLINATE LEFT cannon degrees ", this->cannon->getRotation().Y);
183  break;
184  case INCLINATE_RIGHT:
185  if(this->cannon->getRotation().Y < (this->rotationconstraint.Y + MAX_ANGLE_RIGHT))
186  velocity = 1;
187  else velocity = 0;
188  this->cannon->setRotation(core::vector3df(0,this->cannon->getRotation().Y+(INCLINATE_FACTOR * velocity),0));
189  this->cannon->updateAbsolutePosition();
190  log2p("INCLINATE RIGHT cannon degrees ", this->cannon->getRotation().Y);
191  break;
192 
193  default: break;
194 
195  }
196 
197  return m;
198 }
core::vector3df initBarrelVector
See ::initialBarrelVector.
Definition: cannon.h:43
Definition: keyboard.h:11
Definition: keyboard.h:14
Definition: keyboard.h:12
#define log2p(_Message, parameter)
Log message of 2 level verbosity with a parameter(not string)
Definition: Logger.h:35
f32 refreshAngle()
Set angle variable and calculate the angle between the plane and the initBarrelVector.
Definition: cannon.cpp:63
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23
const f32 MAX_ANGLE_LEFT
Definition: cannon.h:11
f32 angle
Angle of the cannon.
Definition: cannon.h:29
const f32 INCLINATE_FACTOR
Definition: cannon.h:8
const f32 MAX_ANGLE_BOTTOM
Definition: cannon.h:9
const f32 MAX_ANGLE_TOP
Definition: cannon.h:10
Definition: keyboard.h:13
core::vector3df rotationconstraint
Default constructor initialize the angles, setup meshes.
Definition: cannon.h:53
const f32 MAX_ANGLE_RIGHT
Definition: cannon.h:12

◆ getRange()

core::vector3df Cannon::getRange ( )

With some randomness get a position Z based on the cannon power- So there always be a trajectory to hit something in that position(e.g Target).

See also
Player::getCannonRange()
266  {
267 
268  f32 angle = (MAX_ANGLE_TOP - getRand(15.f))* core::DEGTORAD64;
269  f32 shoot_power = MAX_CANNON_FORCE - getRand(10);
270  core::vector3df position = core::vector3df(
271  0,
272  sin(angle),
273  cos(angle)).normalize() * shoot_power;
274 
275  f32 t = (
276  position.getLength() * sin(angle) +
277  sqrt(
278  (pow(position.getLength(),2)*
279  sin(angle)*sin(angle)+
280  2*(10)*5.f))
281  )/10;
282  f32 z = position.getLength()*cos(angle)*t;
283  position = core::vector3df(this->cannon->getAbsolutePosition().X, 0, this->cannon->getAbsolutePosition().Z + z);
284  return position;
285 }
const f32 MAX_CANNON_FORCE
Definition: cannon.h:13
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23
f32 getRand(f32 maxValue, f32 offset)
Get a random value.
Definition: bullethelper.cpp:44
f32 angle
Angle of the cannon.
Definition: cannon.h:29
const f32 MAX_ANGLE_TOP
Definition: cannon.h:10

◆ initAngles()

void Cannon::initAngles ( )

Calculate init angles,.

See also
initialBarrelVector
45  {
46  // core::aabbox3df box2 = this->barrel->getBoundingBox();
47  // core::aabbox3df lower = this->wagon->getBoundingBox();
48  core::vector3df med = this->barrel->getBoundingBox().getCenter();
49  core::vector3df init = this->barrel->getBoundingBox().MinEdge;
50  core::vector3df last;
51  core::matrix4 m;
52  m.setRotationDegrees(this->rotation);
53  init.X = med.X;
54  last = init;
55  last.Z = this->barrel->getBoundingBox().MaxEdge.Z;
56  last.Y+=last.Y;
57  this->initBarrelVector = core::line3df(init,last).getVector();
58  m.rotateVect(this->initBarrelVector);
60  this->plane = core::vector3df(last.X,init.Y,last.Z) - init;
61 log1("Setting up cannon");
62 }
core::vector3df initBarrelVector
See ::initialBarrelVector.
Definition: cannon.h:43
core::vector3df plane
The plane of the cannon.
Definition: cannon.h:45
core::vector3df initialBarrelVector
Initial vector ray.
Definition: cannon.h:41
#define log1(_Message)
Log message of 1 level verbosity.
Definition: Logger.h:28
core::vector3df rotation
Definition: cannon.h:47
scene::IMeshBuffer * barrel
Barrel (cane) of the cannon.
Definition: cannon.h:25

◆ initCannon()

void Cannon::initCannon ( core::vector3df  position,
core::vector3df  rotation 
)

Initialize with desired position and rotation.

199  {
200  this->setPosition(position);
201  this->setRotation(rotation);
202  this->rotation = rotation;
204  initAngles();
205 
206 }
void initAngles()
Calculate init angles,.
Definition: cannon.cpp:45
void setRotation(core::vector3df rotation)
Set rotation of the cannon.
Definition: cannon.cpp:286
core::vector3df rotation
Definition: cannon.h:47
void setPosition(core::vector3df position)
Set position of the cannon.
Definition: cannon.cpp:207
core::vector3df rotationconstraint
Default constructor initialize the angles, setup meshes.
Definition: cannon.h:53

◆ moveCamera()

bool Cannon::moveCamera ( )

Move projectile camera.

I didnt use a parent-child camera related to the Ball becaouse there are some trouble to set a desired position. So i make another camera based on the fixed cannon camera whenever the user shoot. While in this new camer is moved. When the camera reaches the terrain it is deleted

Returns
true don't move camera, false move camera
247  {
248  if(this->btBall && this->camera){
249  #if (DEBUG_OUTPUT_MASK & 2)
250  return true;
251  #else
252  if(!this->btBall->moveCamera()){
253  this->btBall = 0; //it is not memory leak, Objects vector in Physiscs have a reference, so i can delete whenever i want;
254  return false;
255  } else return true;
256  #endif
257  } else return true;
258 }
Camera * camera
Fixed Camera of the cannon.
Definition: cannon.h:31
Ball * btBall
Projectile of the cannon.
Definition: cannon.h:33
bool moveCamera()
Move camera,.
Definition: ball.cpp:36

◆ moveCannon()

bool Cannon::moveCannon ( ACTION_KEYBOARD  action)

Handle moves in cannon left or right top and down (only angles )

210  {
211  if(!this->moveCamera()) return false;
212  switch(action){
213 // this->smgr->getMeshManipulator()->transform(this->barrel, this->getInclinateValues(INCLINATE_UP));
214 
215  case INCLINATE_UP:{
216  this->smgr->getMeshManipulator()->transform(this->barrel, this->getInclinateValues(INCLINATE_UP));
217 // core::matrix4 m = this->getInclinateValues(INCLINATE_UP);
218 // core::aabbox3df box = this->cannon->getMesh()->getMeshBuffer(0)->getBoundingBox();
219 // m.transformBoxEx(box);
220 
221 
222  break;
223  }
224 
225  case INCLINATE_DOWN:
226  this->smgr->getMeshManipulator()->transform(this->barrel, this->getInclinateValues(INCLINATE_DOWN));
227  break;
228 
229  case INCLINATE_LEFT:
231  this->rotation = this->cannon->getRotation();
232  //this->smgr->getMeshManipulator()->transform(this->cannon->getMesh(), this->getInclinateValues(INCLINATE_LEFT));
233  break;
234 
235  case INCLINATE_RIGHT:
237  this->rotation = this->cannon->getRotation();
238  break;
239 
240  default: break;
241  }
242 
243  this->barrel->recalculateBoundingBox();
244  return true;
245 
246 }
Definition: keyboard.h:11
Definition: keyboard.h:14
Definition: keyboard.h:12
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23
bool moveCamera()
Move projectile camera.
Definition: cannon.cpp:247
core::vector3df rotation
Definition: cannon.h:47
scene::ISceneManager * smgr
Definition: cannon.h:19
core::matrix4 getInclinateValues(ACTION_KEYBOARD key)
Handle user input to change cannon rotations.
Definition: cannon.cpp:145
Definition: keyboard.h:13
scene::IMeshBuffer * barrel
Barrel (cane) of the cannon.
Definition: cannon.h:25

◆ refreshAngle()

f32 Cannon::refreshAngle ( )

Set angle variable and calculate the angle between the plane and the initBarrelVector.

63  {
64 
65 
66 
67  // cout<<cannonline.getVector().X<< " "<< cannonline.getVector().Y<< " "<<cannonline.getVector().Z<<" init "<<endl;
68 
69  core::vector3df vec1 = this->initBarrelVector;
70  core::vector3df vec2 = this->initialBarrelVector;
71  vec1 = vec1.normalize();
72  vec2 = vec2.normalize();
73  f32 length = vec1.getLengthSQ() * vec2.getLengthSQ();
74  f32 angle = acos(vec2.dotProduct(vec1) * core::reciprocal_squareroot(length)) * core::RADTODEG64;
75  return angle;
76 }
core::vector3df initBarrelVector
See ::initialBarrelVector.
Definition: cannon.h:43
f32 angle
Angle of the cannon.
Definition: cannon.h:29
core::vector3df initialBarrelVector
Initial vector ray.
Definition: cannon.h:41

◆ setCamera()

void Cannon::setCamera ( core::vector3df  offset,
core::vector3df  rotation,
scene::ISceneManager *  smgr,
scene::ISceneNode *  node 
)

Set camera of the cannon.

Parameters
offsetvector3df offset from the position
positionvector3df position of the camera
smgrISceneManager Irrlciht scenemanaer
nodeISceneNode ICameraSceneNode object
259  {
260  if(!this->camera) this->camera = new Camera(offset,rotation,smgr,node);
261  else this->smgr->setActiveCamera(this->camera->camera);
262 }
Camera * camera
Fixed Camera of the cannon.
Definition: cannon.h:31
scene::ICameraSceneNode * camera
Irrlicht ICameraSceneNode.
Definition: camera.h:12
core::vector3df rotation
Definition: cannon.h:47
scene::ISceneManager * smgr
Definition: cannon.h:19
Camera based on ICameraSceneNode of Irrlicht.
Definition: camera.h:6

◆ setPosition()

void Cannon::setPosition ( core::vector3df  position)

Set position of the cannon.

207  {
208  this->cannon->setPosition(position);
209 }
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23

◆ setRotation()

void Cannon::setRotation ( core::vector3df  rotation)

Set rotation of the cannon.

286  {
287 
288  this->cannon->setRotation(rotation);
289  this->rotation = rotation;
290  this->cannon->updateAbsolutePosition();
291 }
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23
core::vector3df rotation
Definition: cannon.h:47

◆ shoot()

void Cannon::shoot ( f32  power)

Based on the angles vector: initBarrelVector and the cannon power, this will shoot a Ball.

The method also will instance the camera related to the ball while this will be in the air

Parameters
powerf32 power
See also
Camera
CANNON_POWER
89  {
90  if(this->btBall){
91  // assert(this->btBall->camera != 0);
92 
93  #if (DEBUG_OUTPUT_MASK & 2)
94  log1("Positioning ball");
95  #else
96  if(this->btBall->camera) return;
97  #endif
98 
99  }
100  f32 angle = this->refreshAngle() * core::DEGTORAD64;
101  core::vector3d<f32> * edges = new core::vector3d<f32>[8];
102  core::aabbox3d<f32> boundingbox = this->barrel->getBoundingBox();
103  boundingbox.getEdges(edges);
104 
105  f32 height = edges[0].Y + sin(angle) * this->initBarrelVector.getLength();
106  core::vector3df absolute = this->cannon->getAbsolutePosition();
107  // f32 left_right_angle = this->cannon->getRotation().Y * core::DEGTORAD64;
108  core::vector3df adj = this->initBarrelVector;
109  adj = adj.normalize();
110  core::matrix4 m;
111  m.setRotationDegrees(this->cannon->getRotation());
112  m.rotateVect(adj);
113  int sig = sign(cos(this->cannon->getRotation().Y*core::DEGTORAD64));
114  core::vector3df position = core::vector3df(
115  absolute.X + adj.X,
116  height,
117  (absolute.Z + (sig*this->barrel->getBoundingBox().getExtent().Z))// fix here for opposite cannons
118  );
119  this->btBall = new Ball(device, this->smgr,this->driver,this->physics,position);
120  logVector(1,"Shoot projectile from", position);
121  f32 shoot_power = power * CANNON_POWER;
122  /*
123  @TODO recalculation of the shoot vector based on the xyz barrel/cane. This will improve shoot, but now it works anyway
124  */
125  core::vector3df shoot = core::vector3df(
126  adj.X,
127  sin(angle),
128  cos(angle)).normalize() * shoot_power;
129  m.rotateVect(shoot);
130  logVector(1,"Shoot vector", shoot);
131  this->btBall->btBall->setLinearVelocity(toBulletVector(shoot));
132  //if(this->type == HUMAN)
133  this->btBall->irrBall->updateAbsolutePosition();
134  #if (DEBUG_OUTPUT_MASK & 2)
135  return;
136  #endif
137  this->btBall->setCamera(this->camera->getCamera(), shoot);
138 }
core::vector3df initBarrelVector
See ::initialBarrelVector.
Definition: cannon.h:43
void shoot(f32 power)
Based on the angles vector: initBarrelVector and the cannon power, this will shoot a Ball...
Definition: cannon.cpp:89
const f32 CANNON_POWER
Definition: cannon.h:14
Ball represent the projectile of the cannon.
Definition: ball.h:12
#define logVector(level, _Message, vector)
Log a core::vector3d irrlicht object.
Definition: Logger.h:42
btVector3 toBulletVector(core::vector3df vec)
Convert given Irrlicht vector3d vector to Bullect btVector3.
Definition: bullethelper.cpp:11
Physics * physics
Physics instance
Definition: cannon.h:35
f32 refreshAngle()
Set angle variable and calculate the angle between the plane and the initBarrelVector.
Definition: cannon.cpp:63
Camera * camera
Fixed Camera of the cannon.
Definition: cannon.h:31
scene::IMeshSceneNode * cannon
Cannon scene node.
Definition: cannon.h:23
f32 angle
Angle of the cannon.
Definition: cannon.h:29
scene::ICameraSceneNode * getCamera()
Definition: camera.cpp:31
Camera * camera
Camera of related to the ball.
Definition: ball.h:25
Ball * btBall
Projectile of the cannon.
Definition: cannon.h:33
#define log1(_Message)
Log message of 1 level verbosity.
Definition: Logger.h:28
video::IVideoDriver * driver
Definition: cannon.h:21
int sign(int x)
Get sign of a integer.
Definition: bullethelper.cpp:80
IrrlichtDevice * device
Definition: cannon.h:20
scene::ISceneManager * smgr
Definition: cannon.h:19
scene::IMeshBuffer * barrel
Barrel (cane) of the cannon.
Definition: cannon.h:25

Member Data Documentation

◆ angle

f32 Cannon::angle
private

Angle of the cannon.

◆ barrel

scene::IMeshBuffer* Cannon::barrel
private

Barrel (cane) of the cannon.

IMeshBuffer

◆ btBall

Ball* Cannon::btBall
private

Projectile of the cannon.

◆ camera

Camera* Cannon::camera
private

Fixed Camera of the cannon.

◆ cannon

scene::IMeshSceneNode* Cannon::cannon
private

Cannon scene node.

◆ device

IrrlichtDevice* Cannon::device
private

◆ driver

video::IVideoDriver* Cannon::driver
private

◆ initBarrelVector

core::vector3df Cannon::initBarrelVector
private

See ::initialBarrelVector.

This is the same.

◆ initialBarrelVector

core::vector3df Cannon::initialBarrelVector
private

Initial vector ray.

The vector represent the initial raytrace of the barrel. Since the barrel in the 3d model is angled the Cannon::initAngles() will setup this vector. That means if the user change the angle, the barrel vector will change too, so the start position of the projectile will be correct

◆ physics

Physics* Cannon::physics
private

Physics instance

◆ plane

core::vector3df Cannon::plane
private

The plane of the cannon.

◆ rotation

core::vector3df Cannon::rotation

◆ rotationconstraint

core::vector3df Cannon::rotationconstraint

Default constructor initialize the angles, setup meshes.

Parameters
positionvector3df position of the cannon
physicsPhysics physics instance
See also
Ball, Camera, ::Keyboard

◆ smgr

scene::ISceneManager* Cannon::smgr
private

◆ wagon

scene::IMeshBuffer* Cannon::wagon
private

Wagon is the bottom part of the 3d cannon object.

IMeshBuffer


The documentation for this class was generated from the following files: