35 #include <libFreeWRL.h>
37 #include "../vrml_parser/Structs.h"
38 #include "quaternion.h"
41 #include "Collision.h"
42 #include "../opengl/OpenGL_Utils.h"
43 #include "RenderFuncs.h"
44 #include "../opengl/Frustum.h"
46 #define DJ_KEEP_COMPILER_WARNING 0
48 #if DJ_KEEP_COMPILER_WARNING
49 #define VF_localLight 0x0004
53 void localLightChildren(
struct Multi_Node ch) {
55 for(i=0; i<ch.n; i++) {
56 struct X3D_Node *p = X3D_NODE(ch.p[i]);
58 if ((p->_nodeType == NODE_DirectionalLight) ||
59 (p->_nodeType == NODE_PointLight) ||
60 (p->_nodeType == NODE_SpotLight))
71 for(i=0; i<ch.n; i++) {
72 p = X3D_NODE(ch.p[i]);
78 if (p->_nodeType == NODE_DirectionalLight) {
79 if (X3D_DIRECTIONALLIGHT(p)->global == TRUE) render_node(p);
80 }
else if (p->_nodeType == NODE_SpotLight) {
81 if (X3D_SPOTLIGHT(p)->global == TRUE) render_node(p);
82 }
else if (p->_nodeType == NODE_PointLight) {
83 if (X3D_POINTLIGHT(p)->global == TRUE)
85 }
else render_node(p);
97 void update_renderFlagB (
struct X3D_Node *p,
int flag,
int li) {
124 p->_renderFlags = p->_renderFlags | flag;
126 if (p->_parentVector == NULL) {
131 for (i = 0; i < vectorSize(p->_parentVector); i++) {
135 if (me->referenceCount > 0) {
140 ConsoleMessage (
"update_renderFlag, me NULL for child %d",i);
141 markForDispose(p, TRUE);
145 if (me->_parentVector == NULL) {
148 ConsoleMessage (
"warning, for node %p (%s), pv %d, child has null parentVector\n",p,stringNodeType(p->_nodeType),i);
149 markForDispose(p, TRUE);
154 switch (me->_nodeType) {
157 if (is_Switchchild_inrange(X3D_SWITCH(me),p)) {
159 update_renderFlagB(me,flag, __LINE__);
165 if (p == X3D_LODNODE(me)->_selected) {
166 update_renderFlagB(me,flag, __LINE__);
171 if (is_GeoLODchild_inrange(X3D_GEOLOD(me),p)) {
173 update_renderFlagB(me,flag, __LINE__);
178 if (is_CADLayerchild_inrange(X3D_CADLAYER(me),p)) {
179 update_renderFlagB(me,flag, __LINE__);
185 update_renderFlagB(me,flag, __LINE__);
191 void UPDATE_RENDERFLAG (
struct X3D_Node *p,
int flag,
char *fi,
int li){
193 ConsoleMessage (
"update_renderFlag, p NULL from %s:%d\n",fi,li);
197 update_renderFlagB (p, flag, __LINE__);