Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
CameraView.h
Go to the documentation of this file.
1
/* Project nGenEx
2
Destroyer Studios LLC
3
Copyright © 1997-2004. All Rights Reserved.
4
5
SUBSYSTEM: nGenEx.lib
6
FILE: CameraView.h
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
3D Projection Camera View class
13
*/
14
15
#ifndef CameraView_h
16
#define CameraView_h
17
18
#include "
Types.h
"
19
#include "
View.h
"
20
#include "
Camera.h
"
21
#include "
Projector.h
"
22
#include "
Video.h
"
23
#include "
List.h
"
24
25
// +--------------------------------------------------------------------+
26
27
class
Video
;
28
class
Scene
;
29
class
Bitmap
;
30
31
class
Graphic
;
32
33
// +--------------------------------------------------------------------+
34
35
class
CameraView
:
public
View
36
{
37
public
:
38
static
const
char
*
TYPENAME
() {
return
"CameraView"
; }
39
40
CameraView
(
Window
* c,
Camera
* cam,
Scene
* s);
41
virtual
~CameraView
();
42
43
// Operations:
44
virtual
void
Refresh
();
45
virtual
void
OnWindowMove
();
46
virtual
void
UseCamera
(
Camera
* cam);
47
virtual
void
UseScene
(
Scene
*
scene
);
48
virtual
void
LensFlareElements
(
Bitmap
* halo,
Bitmap
* e1=0,
Bitmap
* e2=0,
Bitmap
* e3=0);
49
virtual
void
LensFlare
(
int
on,
double
dim = 1);
50
virtual
void
SetDepthScale
(
float
scale);
51
52
// accessors:
53
Camera
*
GetCamera
()
const
{
return
camera
; }
54
Projector
*
GetProjector
() {
return
&
projector
; }
55
Scene
*
GetScene
()
const
{
return
scene
; }
56
virtual
void
SetFieldOfView
(
double
fov);
57
virtual
double
GetFieldOfView
()
const
;
58
virtual
void
SetProjectionType
(DWORD pt);
59
virtual
DWORD
GetProjectionType
()
const
;
60
61
Point
Pos
()
const
{
return
camera
->
Pos
(); }
62
Point
vrt
() {
return
camera
->
vrt
(); }
63
Point
vup
() {
return
camera
->
vup
(); }
64
Point
vpn
() {
return
camera
->
vpn
(); }
65
const
Matrix
&
Orientation
()
const
{
return
camera
->
Orientation
(); }
66
67
Point
SceneOffset
()
const
{
return
camera_loc
; }
68
69
// projection and clipping geometry:
70
virtual
void
TranslateScene
();
71
virtual
void
UnTranslateScene
();
72
virtual
void
MarkVisibleObjects
();
73
virtual
void
MarkVisibleLights
(
Graphic
* g, DWORD flags);
74
75
virtual
void
RenderScene
();
76
virtual
void
RenderSceneObjects
(
bool
distant=
false
);
77
virtual
void
RenderForeground
();
78
virtual
void
RenderBackground
();
79
virtual
void
RenderSprites
();
80
virtual
void
RenderLensFlare
();
81
virtual
void
Render
(
Graphic
* g, DWORD flags);
82
83
virtual
void
FindDepth
(
Graphic
* g);
84
virtual
int
SetInfinite
(
int
i);
85
86
protected
:
87
Camera
*
camera
;
88
Scene
*
scene
;
89
Video
*
video
;
90
91
virtual
void
WorldPlaneToView
(
Plane
& plane);
92
93
Point
camera_loc
;
94
Vec3
cvrt
;
95
Vec3
cvup
;
96
Vec3
cvpn
;
97
98
Projector
projector
;
99
int
infinite
;
100
int
width
;
101
int
height
;
102
DWORD
projection_type
;
103
104
// lens flare:
105
int
lens_flare_enable
;
106
double
lens_flare_dim
;
107
Bitmap
*
halo_bitmap
;
108
Bitmap
*
elem_bitmap
[3];
109
110
List<Graphic>
graphics
;
111
};
112
113
#endif CameraView_h
114
nGenEx
CameraView.h
Generated on Tue Jun 5 2012 20:46:20 for Starshatter_Open by
1.8.1