Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/post/src/camera/camera.h
3203 views
1
/*****************************************************************************
2
*
3
* Elmer, A Finite Element Software for Multiphysical Problems
4
*
5
* Copyright 1st April 1995 - , CSC - IT Center for Science Ltd., Finland
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program (in file fem/GPL-2); if not, write to the
19
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
* Boston, MA 02110-1301, USA.
21
*
22
*****************************************************************************/
23
24
/*******************************************************************************
25
*
26
* Camera main module includes
27
*
28
*******************************************************************************
29
*
30
* Author: Juha Ruokolainen
31
*
32
* Address: CSC - IT Center for Science Ltd.
33
* Keilaranta 14, P.O. BOX 405
34
* 02101 Espoo, Finland
35
* Tel. +358 0 457 2723
36
* Telefax: +358 0 457 2302
37
* EMail: [email protected]
38
*
39
* Date: 27 Sep 1995
40
*
41
* Modified by:
42
*
43
* Date of modification:
44
*
45
******************************************************************************/
46
47
48
/*
49
* $Id: camera.h,v 1.1.1.1 2005/05/31 06:29:21 vierinen Exp $
50
*
51
* $Log: camera.h,v $
52
* Revision 1.1.1.1 2005/05/31 06:29:21 vierinen
53
* ads
54
*
55
* Revision 1.2 1998/08/01 12:34:10 jpr
56
*
57
* Added Id, started Log.
58
*
59
*
60
*/
61
62
#ifdef MODULE_CAMERAS
63
# define CAM_EXT
64
#else
65
# define CAM_EXT extern
66
#endif
67
68
CAM_EXT int GlobalPass,GlobalMakeSecondPass;
69
70
#define CAM_MAX_OBJECTS_MASKED 100
71
72
typedef enum
73
{
74
camera_proj_ortho, camera_proj_perspective
75
} camera_proj_t;
76
77
typedef struct camera_s
78
{
79
struct camera_s *Next;
80
char *Name;
81
82
float ViewportLowX, ViewportHighX,
83
ViewportLowY,ViewportHighY;
84
85
float LookAtX,LookAtY,LookAtZ;
86
float UpX,UpY,UpZ;
87
float LookFromX,LookFromY,LookFromZ;
88
float ClipNear,ClipFar;
89
90
float FieldAngle;
91
camera_proj_t ProjectionType;
92
93
object_t *ObjMask[CAM_MAX_OBJECTS_MASKED];
94
95
logical_t OnOff,DrawFrame;
96
} camera_t;
97
98
CAM_EXT camera_t *Camera;
99
100
101
void cam_set_viewport(camera_t *camera,double lx,double ly,double hx,double hy);
102
void cam_set_projection( camera_t *camera,camera_proj_t projection );
103
void cam_set_field_angle( camera_t *camera, double angle );
104
void cam_set_look_from(camera_t *camera,double x,double y,double z,int relative);
105
void cam_set_up_vector(camera_t *camera,double x,double y,double z );
106
void cam_set_clip(camera_t *camera,double n,double f);
107
void cam_set_look_to(camera_t *camera,double x,double y,double z,int relative);
108
void cam_set_onoff( camera_t *camera,int onoff);
109
camera_t *cam_add_camera( camera_t *camera,char *name );
110
void cam_delete_list( camera_t *camera );
111
int cam_display_list( camera_t *camera, object_t *object );
112
113