FreeWRL / FreeX3D 4.3.0
Bindable.h
1/*
2
3
4Bindable nodes - Background, TextureBackground, Fog, NavigationInfo, Viewpoint.
5
6*/
7
8/****************************************************************************
9 This file is part of the FreeWRL/FreeX3D Distribution.
10
11 Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
12
13 FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
14 it under the terms of the GNU Lesser Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 FreeWRL/FreeX3D is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
25****************************************************************************/
26
27
28#ifndef __FREEWRL_BINDABLE_H__
29#define __FREEWRL_BINDABLE_H__
30
31
32/* Bind stack */
33
34void
35reset_upvector(void);
36
37void
38set_naviinfo(struct X3D_NavigationInfo *node);
39
40void
41send_bind_to(struct X3D_Node *node, int value);
42
43void
44bind_node(struct X3D_Node *node, struct Vector *stack);
45
46void
47render_Fog(struct X3D_Fog *node);
48
49void
50render_NavigationInfo(struct X3D_NavigationInfo *node);
51
52void render_Background(struct X3D_Background *node);
53void render_TextureBackground(struct X3D_TextureBackground *node);
54void render_bound_background();
55void set_naviWidthHeightStep(double wid, double hei, double step) ;
56/* viewer dimentions (for collision detection) */
57struct sNaviInfo {
58 double width;
59 double height;
60 double step;
61};
62
63
64typedef struct bindablestack {
65 void *background;
66 void *viewpoint;
67 void *fog;
68 void *navigation;
69 int layerId;
70
71 double screenorientationmatrix[16];
72 double viewtransformmatrix[16];
73 double viewmatrix[16]; //everything, including posori, view, stereo offsets etc, snapshotted at rootnode level before renderhier
74 double posorimatrix[16];
75 double stereooffsetmatrix[2][16];
76 double backgroundmatrix[16]; //model matrix (root_to_node) for bound background
77 int isStereo; //temp
78 int iside; //temp
79 int nodetype; //node_layer or node_layoutlayer, affects viewer init to ortho or viewpoint
80 void *viewer; //X3D_Viewer - navigation is per-layer
81 double pickraymatrix[2][16];
83void init_bindablestack(bindablestack *bstack, int layerId, int nodetype);
84bindablestack* getBindableStacksByLayer(ttglobal tg, int layerId );
85bindablestack* getActiveBindableStacks(ttglobal tg );
86int addBindableStack(ttglobal tg, bindablestack* bstack);
87int getBindableStacksCount(ttglobal tg);
88int layerFromBindable(struct X3D_Node*);
89void render_bound_background();
90#endif /* __FREEWRL_BINDABLE_H__ */