35 #include <libFreeWRL.h>
37 #include "../vrml_parser/Structs.h"
38 #include "../vrml_parser/CRoutes.h"
39 #include "../main/headers.h"
48 void do_BooleanFilter (
void *node){
54 if (px->set_boolean == TRUE) {
55 px->inputNegate = FALSE;
59 px->inputNegate = TRUE;
71 void do_BooleanSequencer (
void *node){
81 kvin = px->keyValue.n;
84 oldValue = px->value_changed;
88 if ((kvin == 0) || (kin == 0)) {
89 px->value_changed = 0;
92 if (kin>kvin) kin=kvin;
95 printf (
"BooleanSequencer, kin %d kvin %d, vc %f\n",kin,kvin,px->value_changed);
96 printf (
" and set_fraction is %f\n",px->set_fraction);
100 if (px->set_fraction <= px->key.p[0]) {
101 px->value_changed = kVs[0];
102 }
else if (px->set_fraction >= px->key.p[kin-1]) {
103 px->value_changed = kVs[kvin-1];
106 counter=find_key(kin,(
float)(px->set_fraction),px->key.p);
111 if (counter >= px->keyValue.n) counter = px->keyValue.n-1;
112 px->value_changed = px->keyValue.p[counter];
116 if (oldValue != px->value_changed) {
124 void do_BooleanToggle (
void *node){
131 oldBoolean = px->toggle;
133 if (px->set_boolean == TRUE) px->toggle = FALSE;
134 else px->toggle = TRUE;
135 if (oldBoolean != px->toggle) MARK_EVENT (node, offsetof (
struct X3D_BooleanToggle, toggle));
140 void do_BooleanTrigger (
void *node){
146 px->triggerTrue = TRUE;
156 void do_IntegerSequencer (
void *node){
165 kvin = px->keyValue.n;
166 kVs = px->keyValue.p;
171 printf (
"IntegerSequencer, kin %d kvin %d, sf %f vc %d\n",kin,kvin,px->set_fraction, px->value_changed);
175 if ((kvin == 0) || (kin == 0)) {
176 px->value_changed = 0;
179 if (kin>kvin) kin=kvin;
182 if (px->set_fraction <= px->key.p[0]) {
183 px->value_changed = kVs[0];
184 }
else if (px->set_fraction >= px->key.p[kin-1]) {
185 px->value_changed = kVs[kvin-1];
189 counter=find_key(kin+1,(
float)(px->set_fraction),px->key.p)-1;
192 if (counter >= px->keyValue.n) counter = px->keyValue.n-1;
195 px->keyValue.p[counter];
201 void do_IntegerTrigger (
void *node){
210 px->triggerValue = px->integerKey;
222 void do_TimeTrigger (
void *node){
228 px->triggerTime = TickTime();