-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathEnergy.h
39 lines (38 loc) · 984 Bytes
/
Energy.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
37
38
39
#pragma once
#include <Ogre.h>
#include <OIS/OIS.h>
#include <vector>
#include <math.h>
/////////////////////////////////////////////////////////////////////
///////////////Original file by:Fyodor Zagumennov aka Sgw32//////////
///////////////Copyright(c) 2010 Fyodor Zagumennov //////////
/////////////////////////////////////////////////////////////////////
#include <OgreNewt.h>
#include "POs.h"
class Energy:public Singleton<Energy>
{
public:
Energy(OgreNewt::World* world);
~Energy();
void init(Real maxDist,Real energyLoss,bool energyon);
void setEnergy(bool on);
void reset()
{
mElapsedEnergy=1.0f;
}
void processBodyEnergy(OgreNewt::Body* bod);
Vector3 get_pos(OgreNewt::Body* bod)
{
Vector3 pos;
Quaternion quat;
bod->getPositionOrientation(pos,quat);
return pos;
}
OgreNewt::Body* getBodyOnDegree(Vector3 pos,int deg);
private:
bool energy_on;
Real mMaxDist;
Real mEnergyLoss,mElapsedEnergy;
OgreNewt::World* mWorld;
vector<String> added;
};