-
Notifications
You must be signed in to change notification settings - Fork 1
/
MinecraftApplication.h
69 lines (60 loc) · 1.93 KB
/
MinecraftApplication.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
-----------------------------------------------------------------------------
Filename: TutorialApplication.h
-----------------------------------------------------------------------------
This source file is part of the
___ __ __ _ _ _
/___\__ _ _ __ ___ / / /\ \ (_) | _(_)
// // _` | '__/ _ \ \ \/ \/ / | |/ / |
/ \_// (_| | | | __/ \ /\ /| | <| |
\___/ \__, |_| \___| \/ \/ |_|_|\_\_|
|___/
Tutorial Framework
http://www.ogre3d.org/tikiwiki/
-----------------------------------------------------------------------------
*/
#ifndef __MinecraftApplication_h_
#define __MinecraftApplication_h_
#include "BaseApplication.h"
#include "Cube.h"
#include "Character.h"
#include "OgreRoot.h"
#include <iostream>
#include <fstream>
#pragma message ("MinecraftApplication object is defined")
class MinecraftApplication : public BaseApplication
{
public:
MinecraftApplication();
virtual ~MinecraftApplication();
enum QueryFlags
{
CUBE_MASK = 1<<0,
};
protected:
virtual void createViewports();
virtual void createScene();
virtual void createFrameListener();
virtual bool frameRenderingQueued(const Ogre::FrameEvent& evt);
void createWorld();
Ogre::SceneNode *mMainNode;
Character *hero;
Ogre::SceneNode *mCurrentObject;
Ogre::RaySceneQuery* mRayScnQuery;
bool bLMouseDown, bRMouseDown;
virtual bool keyPressed( const OIS::KeyEvent& evt );
virtual bool keyReleased( const OIS::KeyEvent& evt );
virtual bool mouseMoved(const OIS::MouseEvent& arg);
virtual bool mousePressed(const OIS::MouseEvent& arg, OIS::MouseButtonID id);
virtual bool mouseReleased(const OIS::MouseEvent& arg, OIS::MouseButtonID id);
Ogre::Real mRotate;
Ogre::Vector3 mDirection;
Ogre::Real mMove;
private:
Ogre::Real mouseX;
Ogre::Real mouseY;
Ogre::Real mouseZ;
Ogre::Plane* mPlane;
void addSpotlight(const Ogre::String name, const Ogre::Real xPos, const Ogre::Real zPos);
};
#endif