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

Target represent the treasure of the castle. More...

#include <target.h>

Public Member Functions

 Target (core::vector3df position, scene::ISceneManager *smgr, video::IVideoDriver *driver, Physics *physics)
 Default constructor. More...
 
scene::IMeshSceneNode * getIrrNode ()
 Get Irrlicht node. More...
 

Private Attributes

scene::ISceneManager * smgr
 Irrlicht scenemanger. More...
 
Physicsphysics
 Physics instance. More...
 
scene::IMeshSceneNode * irrTarget
 Irrlicht scene node. More...
 
btRigidBody * btTarget
 Bullet btRigiBody reference. More...
 
core::vector3df position
 Position of the target. More...
 

Detailed Description

Target represent the treasure of the castle.

Constructor & Destructor Documentation

◆ Target()

Target::Target ( core::vector3df  position,
scene::ISceneManager *  smgr,
video::IVideoDriver *  driver,
Physics physics 
)

Default constructor.

Initilize graphich and physics instance of the object at specified position.

See also
Castle::setTreasure()
Cannon::getRange()
GameManager::initGamePlay()
Player::getCannonRange()
Player::checkTarget()
Physics::createTreasure()
7  {
8  this->smgr = smgr;
9  this->physics = physics;
10  // scene::IMesh* mesh = smgr->getMesh("media/chest/chest.obj");
11  core::vector3df scale = core::vector3df(1,1,1);
12  this->irrTarget = smgr->addCubeSceneNode(1,0,-1,position, scale);
13  //this->irrTarget = smgr->addMeshSceneNode(mesh,0,-1,position, scale);
14  this->irrTarget->setScale(scale);
15  this->irrTarget->setMaterialFlag(video::EMF_LIGHTING, false);
16  this->irrTarget->setMaterialTexture(0, driver->getTexture("media/chest/chest_rare.jpg"));
17 
18  this->irrTarget->setDebugDataVisible(scene::EDS_BBOX);
19  this->btTarget = physics->createTreasure(this->irrTarget,scale, position);
20  logVector(1,"Created treasure at", position);
21 }
btRigidBody * createTreasure(scene::IMeshSceneNode *node, core::vector3df scale, core::vector3df position)
Create the treasure physics instance.
Definition: physics.cpp:122
#define logVector(level, _Message, vector)
Log a core::vector3d irrlicht object.
Definition: Logger.h:42
scene::IMeshSceneNode * irrTarget
Irrlicht scene node.
Definition: target.h:14
core::vector3df position
Position of the target.
Definition: target.h:18
Physics * physics
Physics instance.
Definition: target.h:12
btRigidBody * btTarget
Bullet btRigiBody reference.
Definition: target.h:16
scene::ISceneManager * smgr
Irrlicht scenemanger.
Definition: target.h:10

Member Function Documentation

◆ getIrrNode()

scene::IMeshSceneNode * Target::getIrrNode ( )

Get Irrlicht node.

22  {
23  return this->irrTarget;
24 }
scene::IMeshSceneNode * irrTarget
Irrlicht scene node.
Definition: target.h:14

Member Data Documentation

◆ btTarget

btRigidBody* Target::btTarget
private

Bullet btRigiBody reference.

◆ irrTarget

scene::IMeshSceneNode* Target::irrTarget
private

Irrlicht scene node.

◆ physics

Physics* Target::physics
private

Physics instance.

◆ position

core::vector3df Target::position
private

Position of the target.

◆ smgr

scene::ISceneManager* Target::smgr
private

Irrlicht scenemanger.


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