vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
model.h
Go to the documentation of this file.
1
#ifndef modelH
2
#define modelH 1
3
4
#include <
vrecko/Ability.h
>
5
#include <
vrecko/EnvironmentObject.h
>
6
#include <
vrecko/World.h
>
7
#include <vector>
8
#include <string>
9
#include <osgCal/CoreModel>
10
#include <osgCal/Model>
11
#include "
awHelper.h
"
12
13
using namespace
vrecko;
14
15
namespace
ArtificialWorld
16
{
18
enum
ModelType
19
{
20
none
,
22
geometry
,
24
cal3D
,
26
other
27
};
28
30
enum
ModelFlags
31
{
32
NONE
= 1,
34
NO_SUBBLOCKS
=
NONE
<< 1
35
};
36
38
class
Model
39
{
40
public
:
41
43
osg::ref_ptr<EnvironmentObject>
Geometry
;
44
45
Model
(
void
);
46
virtual
~Model
(
void
){};
47
49
void
SetModelFlags
(
ModelFlags
flags){ modelFlags = flags; };
51
void
SetMinVisibleDistance
(
unsigned
long
minDist){ hasMinDistance =
true
; minVisibleDistance = minDist; };
53
void
SetMaxVisibleDistance
(
unsigned
long
maxDist){ hasMaxDistance =
true
; maxVisibleDistance = maxDist; };
55
void
SetPosition
(osg::Vec3 pos){ position = pos; };
57
void
SetRotation
(osg::Quat rot){ rotation = rot; };
59
void
SetScale
(osg::Vec3 sc){ scale = sc; };
61
void
SetFileName
(
string
fname){ fileName = fname; };
63
void
SetFileName
(
char
* fname){ fileName.assign(fname); };
65
void
SetModelType
(
ModelType
mtype){ modelType = mtype; };
66
68
ModelFlags
GetModelFlags
(
void
){
return
modelFlags; };
70
unsigned
long
GetMaxVisibleDistance
(
void
){
return
maxVisibleDistance; };
72
unsigned
long
GetMinVisibleDistance
(
void
){
return
minVisibleDistance; };
74
osg::Vec3
GetPosition
(
void
){
return
position; };
76
osg::Quat
GetRotation
(
void
){
return
rotation; };
78
osg::Vec3
GetScale
(
void
){
return
scale; };
80
string
GetFileName
(
void
){
return
fileName; }
82
ModelType
GetModelType
(
void
){
return
modelType; };
83
85
bool
HasMinVisibleDistance
(
void
){
return
hasMinDistance; };
87
bool
HasMaxVisibleDistance
(
void
){
return
hasMaxDistance; };
89
bool
HasPositionSet(
void
){
return
hasPositionSet; };
90
91
protected
:
93
ModelFlags
modelFlags;
95
unsigned
long
maxVisibleDistance
;
97
unsigned
long
minVisibleDistance
;
99
osg::Vec3
position
;
101
osg::Quat
rotation
;
103
osg::Vec3
scale
;
105
string
fileName
;
107
ModelType
modelType
;
109
bool
hasMinDistance
;
111
bool
hasMaxDistance
;
113
bool
hasPositionSet
;
114
115
};
116
118
class
AnimatedModel
:
public
Model
{
119
public
:
120
AnimatedModel
(
void
):
Model
(){
121
animationIndex = 0;
122
};
123
125
void
SetAnimationIndex
(
int
index){ animationIndex = index; };
127
int
GetAnimationIndex
(
void
){
return
animationIndex; };
128
129
private
:
131
int
animationIndex;
132
};
133
}
134
135
#endif
136
include
vreckoAP
ArtificialWorld
model.h
Generated on Tue Feb 19 2013 10:23:41 for vrecko by
1.8.3.1