libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo es el conjunto de objetos y funciones, que permiten ejecutar las operaciones básicas de la plataforma Moldeo, y que compone su núcleo.
moEffect.cpp
Ir a la documentación de este archivo.
1 /*******************************************************************************
2 
3  moEffect.cpp
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright(C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28 
29 *******************************************************************************/
30 
31 // Clase padre de todos los efectos //
32 
33 #include "moEffect.h"
34 #include <moArray.h>
35 #include <moDataManager.h>
36 #include <moFileManager.h>
37 
38 #ifdef MO_WIN32
39  #include "SDL.h"
40 #else
41  #include "SDL.h"
42  //#include "/usr/include/SDL2/SDL_syswm.h"
43 #endif
44 
45 moDefineDynamicArray(moEffectsArray)
46 
47 typedef enum {
48 
49  MO_SDL_MOUSEMOTION = SDL_MOUSEMOTION,
50  MO_SDL2_MOUSEMOTION = 1024,
51  MO_SDL_MOUSEBUTTONDOWN = SDL_MOUSEBUTTONDOWN,
52  MO_SDL2_MOUSEBUTTONDOWN = 1025,
53  MO_SDL_MOUSEBUTTONUP = SDL_MOUSEBUTTONUP,
54  MO_SDL2_MOUSEBUTTONUP = 1026
56 
57 
60  devicecode = NULL;
61  ncodes = 0;
62 
63  InletTime = InletT = InletTimems = NULL;
66  InletMouseX = NULL;
67  InletMouseY = NULL;
68  InletMouseFactor = NULL;
69  InletMouseButtonLeft = NULL;
70  InletMouseButtonRight = NULL;
72 
73  InletMouseXButtonLeft = NULL;
76 
77  InletMouseYButtonLeft = NULL;
80 }
81 
83 
84 }
85 
86 
87 const
89  return m_EffectState;
90 }
91 
92 bool moEffect::SetEffectState( const moEffectState& p_state ) {
93 
94  //TODO: check valid states!
95  m_MobState = (moMobState&) p_state;
96  m_EffectState = p_state;
97  return true;
98 
99 }
100 
101 const
103  return (moMobState&)m_EffectState;
104 }
105 
106 bool
107 moEffect::SetState( const moMobState& p_MobState ) {
108 
109  //TODO: check things before commit changes
110  m_MobState = p_MobState;
111  (moMobState&)(m_EffectState) = p_MobState;
112  return true;
113 }
114 
115 
116 // Esta funcion debe ser llamada al comienzo en cada implementacion
117 // de la funcion virtual Init(). Contiene el codigo obligatorio.
118 // 1) Levanta el config de disco
119 // 2) el parametro del Syncro
120 // 3) Inicializa el efecto en la primera preconfiguración.
121 MOboolean
123 
124  moText debug;
125 
126  devicecode = NULL;
128 
129  //glewInit();
130  InletTimems = new moInlet();
131  if (InletTimems) {
132  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
133  //param.SetExternData( Inlet->GetData() );
134  ((moConnector*)InletTimems)->Init( moText("timems"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
135  m_Inlets.Add(InletTimems);
136  }
137 
138  InletTimes = new moInlet();
139  if (InletTimes) {
140  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
141  //param.SetExternData( Inlet->GetData() );
142  ((moConnector*)InletTimes)->Init( moText("times"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
143  m_Inlets.Add(InletTimes);
144  }
145 
147  InletTime = new moInlet();
148  if (InletTime) {
149  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
150  //param.SetExternData( Inlet->GetData() );
151  ((moConnector*)InletTime)->Init( moText("time"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
152  m_Inlets.Add(InletTime);
153  }
154 
155  InletTempo = new moInlet();
156  if (InletTempo) {
157  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
158  //param.SetExternData( Inlet->GetData() );
159  ((moConnector*)InletTempo)->Init( moText("tempo"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
160  m_Inlets.Add(InletTempo);
161  }
162 
163  InletT = new moInlet();
164  if (InletT) {
165  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
166  //param.SetExternData( Inlet->GetData() );
167  ((moConnector*)InletT)->Init( moText("t"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
168  m_Inlets.Add(InletT);
169  }
170 
171 
172  InletMilliseconds = new moInlet();
173  if (InletMilliseconds) {
174  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
175  //param.SetExternData( Inlet->GetData() );
176  ((moConnector*)InletMilliseconds)->Init( moText("milliseconds"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
178  }
179 
180  InletSeconds = new moInlet();
181  if (InletSeconds) {
182  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
183  //param.SetExternData( Inlet->GetData() );
184  ((moConnector*)InletSeconds)->Init( moText("seconds"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
185  m_Inlets.Add(InletSeconds);
186  }
187 
188  InletMouseX = new moInlet();
189  if (InletMouseX) {
190  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
191  //param.SetExternData( Inlet->GetData() );
192  ((moConnector*)InletMouseX)->Init( moText("mousex"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
193  m_Inlets.Add(InletMouseX);
194  }
195 
196  InletMouseY = new moInlet();
197  if (InletMouseY) {
198  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
199  //param.SetExternData( Inlet->GetData() );
200  ((moConnector*)InletMouseY)->Init( moText("mousey"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
201  m_Inlets.Add(InletMouseY);
202  }
203 
204  InletMouseFactor = new moInlet();
205  if (InletMouseFactor) {
206  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
207  //param.SetExternData( Inlet->GetData() );
208  ((moConnector*)InletMouseFactor)->Init( moText("mousefactor"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
210  }
211 
213  if (InletMouseButtonLeft) {
214  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
215  //param.SetExternData( Inlet->GetData() );
216  ((moConnector*)InletMouseButtonLeft)->Init( moText("mousebuttonleft"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
218  }
219 
221  if (InletMouseButtonRight) {
222  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
223  //param.SetExternData( Inlet->GetData() );
224  ((moConnector*)InletMouseButtonRight)->Init( moText("mousebuttonright"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
226  }
227 
230  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
231  //param.SetExternData( Inlet->GetData() );
232  ((moConnector*)InletMouseButtonMiddle)->Init( moText("mousebuttonmiddle"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
234  }
235 
237  if (InletMouseXButtonLeft) {
238  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
239  //param.SetExternData( Inlet->GetData() );
240  ((moConnector*)InletMouseXButtonLeft)->Init( moText("mousexbuttonleft"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
242  }
243 
246  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
247  //param.SetExternData( Inlet->GetData() );
248  ((moConnector*)InletMouseXButtonRight)->Init( moText("mousexbuttonright"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
250  }
251 
254  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
255  //param.SetExternData( Inlet->GetData() );
256  ((moConnector*)InletMouseXButtonMiddle)->Init( moText("mousexbuttonmiddle"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
258  }
259 
261  if (InletMouseYButtonLeft) {
262  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
263  //param.SetExternData( Inlet->GetData() );
264  ((moConnector*)InletMouseYButtonLeft)->Init( moText("mouseybuttonleft"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
266  }
267 
270  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
271  //param.SetExternData( Inlet->GetData() );
272  ((moConnector*)InletMouseYButtonRight)->Init( moText("mouseybuttonright"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
274  }
275 
278  //Inlet->Init( "tempo", m_Inlets.Count(), param.GetPtr() );
279  //param.SetExternData( Inlet->GetData() );
280  ((moConnector*)InletMouseYButtonMiddle)->Init( moText("mouseybuttonmiddle"), m_Inlets.Count(), MO_DATA_NUMBER_DOUBLE );
282  }
283 
284 
285  if (!m_pResourceManager) return false;
286 
289  if (moMoldeoObject::Init()) {
292  } else return false;
293 
294  isyncro = m_Config.GetParamIndex("syncro");
295  iphase = m_Config.GetParamIndex("phase");
296  if(isyncro==MO_PARAM_NOT_FOUND) MODebug2->Error(moText("syncro parameter missing."));
297  if(iphase==MO_PARAM_NOT_FOUND) MODebug2->Error(moText("phase parameter missing."));
298 
299 
300  //if(m_EffectState.fulldebug==MO_ACTIVATED) MODebug2->Push(moText("Initializing m_EffectState"));//debug
301  //if(m_EffectState.fulldebug==MO_ACTIVATED) MODebug2->Push(moText("Setting preconfigs..."));//debug
302 
303  //devicecode es llenado por la moConsole(por defecto)
304  //si en el nombrefecto.cfg encontramos el parametro ":acciones" entonces tomamos las acciones
305  //definidas arbitrariamente allí....
306  //se tratará de mantener valuees como: MOACCIONES_ALPHA... para poder hacer un FADE
307  //la idea es que sea completamente reconfigurable la interfaz del teclado
308 
309  MODebug2->Message("moEffect::PreInit > OK! for object: " + GetName()+ " config: " + GetConfigName() + " label: " + GetLabelName() );
310 
311  return true;
312 }
313 
315  if (moScript::IsInitialized()) {
316  if (ScriptHasFunction("Draw")) {
317  SelectScriptFunction("Draw");
319  }
320  }
321 }
322 
324  if (moScript::IsInitialized()) {
325  if (ScriptHasFunction("Interaction")) {
326  SelectScriptFunction("Interaction");
328  }
329  }
330 }
331 
332 
333 // Esta funcion debe ser llamada al comienzo en cada implementacion
334 // de la funcion virtual Draw(). Contiene el codigo obligatorio.
335 // 1) toma el nuevo Syncro del config
336 // 2) fija el value del tempo dependiendo si esta o no syncronizado con el master
337 void moEffect::PreDraw( moTempo *tempogral,moEffectState* parentstate) {
338 
339  BeginDraw( tempogral, parentstate );
340 
341 }
342 
343 void moEffect::BeginDraw( moTempo *tempogral,moEffectState* parentstate) {
344 
345  MOdouble syncrotmp;
346 
347  if(isyncro != MO_PARAM_NOT_FOUND) {
349  if (sync) {
350  moMathFunction* pFun = sync->Fun();
351  if (sync->Type()==MO_DATA_FUNCTION && pFun) {
352  //m_EffectState.tempo.syncro = pFun->Eval(m_EffectState.tempo.ang);
353  m_EffectState.tempo.syncro = pFun->Eval();
354  }
355  else m_EffectState.tempo.syncro = sync->Double();
356  }
357 
359  //m_EffectState.tempo.syncro = m_Config.Fun(isyncro).Eval( m_EffectState.tempo.ang );
360  }
361 
363  {
364  //m_EffectState.tempo.ticks = moGetTicks();
368  }
369  else
370  {
371  syncrotmp = m_EffectState.tempo.syncro;
372  m_EffectState.tempo = *tempogral;
373  m_EffectState.tempo.syncro = syncrotmp;
375  //if(m_EffectState.fulldebug==MO_ACTIVATED) MODebug2->Push("SYNCRO: " + FloatToStr(m_EffectState.tempo.syncro,3));
376  }
377 
378  if(iphase != MO_PARAM_NOT_FOUND) {
379  moData *phase = m_Config.GetParam(iphase).GetData();
380  if (phase) {
381  moMathFunction* pFun = phase->Fun();
382  if (phase->Type()==MO_DATA_FUNCTION && pFun) {
383  //m_EffectState.tempo.ang+= pFun->Eval(m_EffectState.tempo.ang);
384  m_EffectState.tempo.ang+= pFun->Eval();
385  }
386  else m_EffectState.tempo.ang+= phase->Double();
387  }
388  }
389 
390  if(parentstate!=NULL) {
391  //asginar parametros del state del padre al state del hijo
392  m_EffectState = *parentstate;
393  }
394 
395  if (InletTime) {
397  }
398  if (InletTimems) {
400  }
401  if (InletMilliseconds) {
403  }
404  if (InletTimes) {
405  if (InletTimes->GetData()) InletTimes->GetData()->SetDouble( (double)m_EffectState.tempo.Duration()/1000.0 );
406  }
407  if (InletSeconds) {
409  }
410  if (InletT) {
412  }
413  if (InletTempo) {
415  }
416 
417  if (InletMouseX) {
418  //if (InletMouseX->GetData()) MODebug2->Message("pre_mx:"+FloatToStr(InletMouseX->GetData()->Double()));
419  //if (InletMouseX->GetData()) InletMouseX->GetData()->SetDouble( mousex );
420  //if (InletMouseX->GetData()) MODebug2->Message("post_mx:"+FloatToStr(InletMouseX->GetData()->Double()));
421  }
429  ScriptExeRun();
430 
431 }
432 
434 
435  ScriptExeDraw();
436 
437  if (m_pResourceManager)
440 
441 
442  if (m_pResourceManager)
445 
446 }
447 
448 
449 // Esta funcion debe ser llamada al comienzo en cada implementacion
450 // de la funcion virtual Finish(). Contiene el codigo obligatorio.
452  //vaciamos las listas de codigos de acciones
453  if(devicecode!=NULL)
454  delete[] devicecode;
455  devicecode = NULL;
456  return true;
457 }
458 
459 void
461 
462  moText texto;
463  MOint nroparam;
464  MOuint i,j,k;
465  MOint coddisp,accioncod;
466  moText strcod;
467 
468  if(m_EffectState.fulldebug==MO_ACTIVATED) MODebug2->Message(moText("Cargando codigos de dispositivo especificos..."));
469 
470  nroparam = m_Config.GetParamIndex("codes");
471  if(nroparam==MO_PARAM_NOT_FOUND) return;//se va, no hay codigos
472  m_Config.SetCurrentParamIndex(nroparam);
474  ncodes = (MOint)m_Config.GetValuesCount(nroparam);
476 
477 #ifdef MO_DEBUG
478  texto = moText("\nCargando codigos efecto ");
479  texto += GetName();
480  texto += moText(" ncodes: ");
481  texto += IntToStr(ncodes);
482  //printf(texto);
483  MODebug2->Log( texto );
484 #endif
485  if(ncodes>0)
486  for( i = 0; i < (MOuint)ncodes; i++) {
487  m_Config.SetCurrentValueIndex(nroparam,i);
488  for( k = 1; k < m_Config.GetParam().GetValue().GetSubValueCount(); k++) {
489  accioncod = i;
490  coddisp = -1;
491  strcod = m_Config.GetParam().GetValue().GetSubValue(k).Text();
492  for( j=0 ; j < consolaesarray->IODevices().Count(); j++) {
493  moIODevice* pIODevice;
494  pIODevice = consolaesarray->IODevices().GetRef(j);
495  if (pIODevice) {
496  if (strcod.Trim().Length()>0) {
497  coddisp = pIODevice->GetCode(strcod);
498  } else {
499  MODebug2->Error("string code is empty: [" + moText(strcod) +"].");
500  }
501 
502  } else {
503 
504  MODebug2->Error("Device id:" + IntToStr(j) +" is null.");
505 
506  }
507  if(coddisp != -1) break; //lo encontramos "j" es el nro de disp y "coddisp" el id
508  }
509 
510  if((accioncod>=0) &&(accioncod<ncodes)) {
511  if(coddisp==-1) {
512  texto = moText("\n");
513  texto += GetConfigName();
514  texto += moText(".cfg: no se encontró en ningun dispositivo el codigo de dispositivo correspondiente a: ");
515  texto += strcod;
516  MODebug2->Error(texto);
517  } else {
518  devicecode[accioncod].Add(j,coddisp); //agregar un cod disp a la lista
519 #ifdef MO_DEBUG
520  texto = moText("\naccioncod: ");
521  texto += IntToStr(accioncod);
522  texto += moText(" strcod: ");
523  texto += strcod;
524  texto += moText(" dispositivo: ");
525  texto += IntToStr(j);
526  texto += moText(" codisp: ");
527  texto += IntToStr(coddisp);
528  MODebug2->Log(texto);
529 #endif
530  }
531  } else {
532  MODebug2->Error("error: codigo de la accion fuera de rango");
533  }
534 
535  }
536  }
537 
538  if(m_EffectState.fulldebug==MO_ACTIVATED) MODebug2->Push(moText("Codes loaded."));
539 }
540 
541 
543 
544  moEvent* event = consolaes->GetEvents()->First;
547 
548  while(event!=NULL) {
549  if ( event->deviceid == MO_IODEVICE_MOUSE ) {
550  //MODebug2->Message("devicecode :"+IntToStr(event->devicecode));
551  //MODebug2->Message("SDL_MOUSEMOTION :"+IntToStr(SDL_MOUSEMOTION));
552  //MODebug2->Message("SDL_MOUSEBUTTONDOWN :"+IntToStr(SDL_MOUSEBUTTONDOWN));
553  //MODebug2->Message("SDL_MOUSEBUTTONUP :"+IntToStr(SDL_MOUSEBUTTONUP));
554 
555  switch(event->devicecode) {
556  case MO_SDL2_MOUSEBUTTONDOWN:
557  case MO_SDL_MOUSEBUTTONDOWN:
558  switch(event->reservedvalue0) {
559  case SDL_BUTTON_LEFT:
560  mousebuttonleft = 1.0;
562  break;
563  case SDL_BUTTON_MIDDLE:
564  mousebuttonmiddle = 1.0;
566  break;
567  case SDL_BUTTON_RIGHT:
568  mousebuttonright = 1.0;
570  break;
571  }
572  break;
573 
574  case MO_SDL2_MOUSEBUTTONUP:
575  case MO_SDL_MOUSEBUTTONUP:
576  switch(event->reservedvalue0) {
577  case SDL_BUTTON_LEFT:
578  mousebuttonleft = 0.0;
580  break;
581  case SDL_BUTTON_MIDDLE:
582  mousebuttonmiddle = 0.0;
584  break;
585  case SDL_BUTTON_RIGHT:
586  mousebuttonright = 0.0;
588  break;
589  }
590  break;
591  case MO_SDL2_MOUSEMOTION:
592  case MO_SDL_MOUSEMOTION:
593  //m_EffectState.mousexrel = float(event->reservedvalue0) / float(w);
594  //m_EffectState.mouseyrel = float(event->reservedvalue1) / float(h);
595  mousex = float(event->reservedvalue2) / float(w);
596  mousey = float(event->reservedvalue3) / float(h);
597  double mousexrel = float(event->reservedvalue0) / float(w);
598  double mouseyrel = float(event->reservedvalue1) / float(h);
599  mousefactor = float(event->reservedvalue2);
600 
601  //MODebug2->Message("mouse event r0 :"+IntToStr(event->reservedvalue2));
602  //MODebug2->Message("mousex :"+FloatToStr(mousex));
603 
604  if (InletMouseX) { if (InletMouseX->GetData()) InletMouseX->GetData()->SetDouble( (double)mousex );}
605  if (InletMouseY) { if (InletMouseY->GetData()) InletMouseY->GetData()->SetDouble( (double)mousey );}
606  if (mousebuttonleft==1.0) {
607  mousexbuttonleft+= mousexrel;
608  mouseybuttonleft+= mouseyrel;
609  }
612 
613  if (mousebuttonright==1.0) {
614  mousexbuttonright+= mousexrel;
615  mouseybuttonright+= mouseyrel;
616  }
619 
620  if (mousebuttonmiddle==1.0) {
621  mousexbuttonmiddle+= mousexrel;
622  mouseybuttonmiddle+= mouseyrel;
623  }
626 
627  break;
628  }
629  }
630  event = event->next;
631  }
632 
633  Update(consolaes->GetEvents());
634 
635 }
636 
637 void moEffect::SetColor( const moColorRGBA& color_rgba, double alpha, moEffectState& pstate ) {
638 
640  color_rgba.X() * pstate.tintr,
641  color_rgba.Y() * pstate.tintg,
642  color_rgba.Z() * pstate.tintb
643  );
644 
645  m_Effect3D.m_Material.m_fOpacity = color_rgba.W() * alpha * pstate.alpha;
646 
647 #ifndef OPENGLESV2
648  glColor4f( m_Effect3D.m_Material.m_Color.X(),
652 #endif
653 }
654 
655 void moEffect::SetColor( moValue& color, moValue& alpha, moEffectState& pstate ) {
656  moColorRGBA color_rgba = moColorRGBA(
657  color[MO_RED].Eval(),
658  color[MO_GREEN].Eval(),
659  color[MO_BLUE].Eval(),
660  color[MO_ALPHA].Eval()
661  );
662  double valpha = alpha[0].Eval();
663 
664  SetColor( color_rgba, valpha, pstate );
665 
666 }
667 
668 void moEffect::SetColor( moParam& color, moParam& alpha, moEffectState& pstate ) {
669 
670  //moValue& Color( color[MO_SELECTED] );
671  //SetColor( Color, alpha[MO_SELECTED], pstate );
672 
673  moColorRGBA color_rgba = moColorRGBA(
674  color[MO_SELECTED][MO_RED].Eval(),
675  color[MO_SELECTED][MO_GREEN].Eval(),
676  color[MO_SELECTED][MO_BLUE].Eval(),
677  color[MO_SELECTED][MO_ALPHA].Eval()
678  );
679  double valpha = alpha.GetData()->Eval();
680  SetColor( color_rgba, valpha, pstate );
681 }
682 
684 
685 
686  m_Effect3D.m_Material.m_PolygonMode = polygonmode;
687 #ifndef OPENGLESV2
688  switch( polygonmode ) {
689 
690  case MO_POLYGONMODE_FILL:
691  glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
692  break;
693 
694  case MO_POLYGONMODE_LINE:
695  glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
696  glBindTexture(GL_TEXTURE_2D, 0);
697  break;
698 
700 
701  break;
702  default:
703  break;
704  }
705 #endif // OPENGLESV2
706 }
707 
708 
710 
711  m_Effect3D.m_Material.m_Blending = blending;
712 
713  glEnable (GL_BLEND);
714  switch(blending) {
715  //ALPHA DEPENDENT
717  //TRANSPARENCY [Rs * As] + [Rd *(1 -As)] = As*(Rs-Rd) + Rd
718  glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
719  break;
721  //ADDITIVE WITH TRANSPARENCY: Rs*As + Rd*Ad
723  glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
724 
726  //ADDITIVE WITH SRC TRANSPARENCY: Rs*As + Rd
727  //glBlendFunc(GL_SRC_ALPHA,GL_ONE);
728  break;
729 
730  //NON ALPHA
731  case MO_BLENDING_MIXING:
732  //MIXING [Rs *( 1 - Rd )] + [ Rd * 1] = Rs + Rd - Rs*Rd
733  //additive without saturation
734  glBlendFunc( GL_ONE_MINUS_DST_COLOR, GL_ONE );
735  break;
737  //MULTIPLY: [Rs * Rd] + [Rd * 0] = Rs * Rd
738  glBlendFunc( GL_DST_COLOR, GL_ZERO );
739  break;
741  //EXCLUSION: [Rs *(1 - Rd)] + [Rd *(1 - Rs)] = Rs + Rd - 2*Rs*Rd
742  glBlendFunc( GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);//
743  break;
745  //ADDITIVE Rs+Rd
746  glBlendFunc( GL_ONE, GL_ONE );
747  break;
748  case MO_BLENDING_OVERLAY:
749  //OVERLAY: 2*Rs*Rd
750  glBlendFunc( GL_DST_COLOR, GL_SRC_COLOR );
751  break;
753  //SUBSTRACTIVE [Rs *( 1 - Rd )] + [ Rd * 0] = Rs - Rs*Rd
754  //substractive
755  glBlendFunc( GL_ONE_MINUS_DST_COLOR, GL_ZERO );
756  break;
758  // [Rs * min(As,1-Ad) ] + [ Rd * Ad]
759  //
760  glBlendFunc( GL_SRC_ALPHA_SATURATE, GL_DST_ALPHA);
761  break;
762  //Multiply mode:(a*b)
763  //Average mode:(a+b)/2
764  //Screen mode: f(a,b) = 1 -(1-a) *(1-b)
765  //Difference mode: f(a,b) = |a - b|
766  //Negation mode: f(a,b) = 1 - |1 - a - b|
767  //Exclusion mode f(a,b) = a + b - 2ab or f(a,b) = average(difference(a,b),negation(a,b))
768  //Overlay mode f(a,b) = 2ab(for a < ) 1 - 2 *(1 - a) *(1 - b)(else)
769  //Color dodge mode: f(a,b) = a /(1 - b)
770  //Color burn mode: f(a,b) = 1 -(1 - a) / b
771  //Inverse color dodge mode: f(a,b) = b /(1 - a)
772  //Inverse color burn mode: f(a,b) = 1 -(1 - b) / a
773  default: //alpha transparent
774  glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
775  break;
776  }
777 
778 }
779 
782  Activate();
783 }
784 
787  Deactivate();
788 }
789 
792 }
793 
796 }
797 
800 }
801 
803  this->m_EffectState.enabled*= -1;
804 }
805 
806 
809 }
810 
811 
814 }
815 
817  return (this->m_EffectState.synchronized == MO_ACTIVATED);
818 }
819 
823 }
824 
825 
826 double
827 moEffect::TempoDelta( double p_delta ) {
828 
829  if (p_delta!=0.0) this->Unsynchronize();
830 
831  m_EffectState.tempo.delta+=p_delta;
832  if(m_EffectState.tempo.delta>2.0)
833  m_EffectState.tempo.delta = 2.0;
834  else
835  if( m_EffectState.tempo.delta < 0.005 )
836  m_EffectState.tempo.delta = 0.0;
837 
838  return m_EffectState.tempo.delta;
839 }
840 
841 double
842 moEffect::SetTempoDelta( double p_delta ) {
843 
844  this->Unsynchronize();
845 
846  m_EffectState.tempo.delta = p_delta;
847  if(m_EffectState.tempo.delta>2.0)
848  m_EffectState.tempo.delta = 2.0;
849  else
850  if( m_EffectState.tempo.delta < 0.005 )
851  m_EffectState.tempo.delta = 0.0;
852 
853  return m_EffectState.tempo.delta;
854 }
855 
856 double
858  return m_EffectState.tempo.delta;
859 }
860 
861 
862 double
863 moEffect::TempoFactor( double p_factor ) {
864  m_EffectState.tempo.factor+=p_factor;
865  if(m_EffectState.tempo.factor>50.0)
866  m_EffectState.tempo.factor = 50.0;
867  else
868  if(m_EffectState.tempo.factor<1.0)
869  m_EffectState.tempo.factor = 1.0;
870  return m_EffectState.tempo.factor;
871 }
872 
873 double
875  return m_EffectState.tempo.factor;
876 }
877 
878 
879 double moEffect::Alpha( double alpha ) {
880  m_EffectState.alpha+= alpha;
881  if(m_EffectState.alpha>=1.0)
882  m_EffectState.alpha=1.0;
883  else
884  if(m_EffectState.alpha<=0.0)
885  m_EffectState.alpha=0.0;
886  return m_EffectState.alpha;
887 }
888 
889 double moEffect::GetAlpha() const {
890  return m_EffectState.alpha;
891 }
892 
893 double
894 moEffect::Amplitude( double amplitude ) {
895  m_EffectState.amplitude = amplitude;
896  return m_EffectState.amplitude;
897 }
898 
899 double
901  return m_EffectState.amplitude;
902 }
903 
904 double
905 moEffect::Magnitude( double magnitude ) {
906  m_EffectState.magnitude = magnitude;
907  return m_EffectState.magnitude;
908 }
909 
910 double
912  return m_EffectState.magnitude;
913 }
914 
915 void
916 moEffect::TintCSV( double tintc, double tints, double tint ) {
917  m_EffectState.tint+= tint;
918  m_EffectState.tintc+= tintc;
919  m_EffectState.tints+= tints;
920 
921  //circular (0..1) > (0..1) > (0..1)
922  if (m_EffectState.tintc>1.0) {
923  m_EffectState.tintc = 0.0;
924  } else if (m_EffectState.tintc<0.0) {
925  m_EffectState.tintc = 1.0;
926  }
927 
928  //lineal [0 .. 1.0]
929  if (m_EffectState.tints>1.0) {
930  m_EffectState.tints = 1.0;
931  } else if (m_EffectState.tints<0.0) {
932  m_EffectState.tints = 0.0;
933  }
934 
935  //lineal 0..1.0
936  if (m_EffectState.tint>1.0) {
937  m_EffectState.tint = 1.0;
938  } else if (m_EffectState.tint<0.0) {
939  m_EffectState.tint = 0.0;
940  }
941 
942 
944 }
945 
946 
950 }
951 
955 }
956 
957 
958 
960  Unsynchronize();
961  return this->m_EffectState.tempo.Start();
962 }
963 
965  Unsynchronize();
966  return this->m_EffectState.tempo.Stop();
967 }
968 
970  Unsynchronize();
971  return this->m_EffectState.tempo.Pause();
972 }
973 
975  Unsynchronize();
976  return this->m_EffectState.tempo.Continue();
977 }
978 
980  return this->m_EffectState.tempo.State();
981 }
982 
983 /*
984 MO_PARAM_ALPHA, //value type: NUM or FUNCTION
985 MO_PARAM_COLOR, //value type: NUM[4] or FUNCTION[4] or
986 MO_PARAM_SYNC, //value type: NUM or FUNCTION
987 MO_PARAM_TEXT, //value type: TXT or LNK
988 MO_PARAM_TEXTURE, //value type: TXT or LNK
989 MO_PARAM_VIDEO, //value type: TXT or LNK
990 MO_PARAM_SOUND, //value type: TXT or LNK
991 MO_PARAM_FUNCTION, //value type: NUM or FUNCTION
992 MO_PARAM_SCRIPT, //value type: TXT or LNK
993 MO_PARAM_TRA, //value type: NUM[3] or FUNCTION[3]
994 MO_PARAM_ROT, //value type: NUM[3] or FUNCTION[3]
995 MO_PARAM_SCA //value type: NUM[3] or FUNCTION[3]
996 */
999 
1000  p_configdefinition = moMoldeoObject::GetDefinition(p_configdefinition);
1001  p_configdefinition->Add( moText("alpha"), MO_PARAM_ALPHA, -1, moValue("1.0","FUNCTION").Ref() );
1002  p_configdefinition->Add( moText("color"), MO_PARAM_COLOR, -1, moValue("1.0","FUNCTION","1.0","FUNCTION","1.0","FUNCTION","1.0","FUNCTION").Ref() );
1003  p_configdefinition->Add( moText("syncro"), MO_PARAM_SYNC, -1, moValue("1.0","FUNCTION").Ref() );
1004  p_configdefinition->Add( moText("phase"), MO_PARAM_PHASE, -1, moValue("0.0","FUNCTION").Ref() );
1005  p_configdefinition->Add( moText("guides"), MO_PARAM_NUMERIC, -1, moValue("0","NUM").Ref(), moText("No,Yes,Full") );
1006  //p_configdefinition->Add( moText("blending"), MO_PARAM_, -1, );
1007  //p_configdefinition->Add( moText("polygonmode"), MO_PARAM_, -1, );
1008  //p_configdefinition->Add( moText("depthtest"), MO_PARAM_, -1, );
1009  return p_configdefinition;
1010 }
1011 
1013 {
1016 
1018  RegisterBaseFunction("Play");//0
1019  RegisterFunction("Pause");//1
1020  RegisterFunction("Stop");//2
1021  RegisterFunction("State");//3
1022  RegisterFunction("Enable");//4
1023  RegisterFunction("Disable");//5
1024 
1025  RegisterFunction("SetTicks");//6
1026  RegisterFunction("GetTicks");//7
1027 
1028  RegisterFunction("GetEffectState");//8
1029  RegisterFunction("SetEffectState");//9
1030 
1032 
1033 }
1034 
1035 int moEffect::ScriptCalling(moLuaVirtualMachine& vm, int iFunctionNumber)
1036 {
1037  m_iMethodBase = 37;
1038  switch ( iFunctionNumber - m_iMethodBase )
1039  {
1040  case 0:
1042  return luaPlay(vm);
1043  case 1:
1045  return luaPause(vm);
1046  case 2:
1048  return luaStop(vm);
1049  case 3:
1051  return luaState(vm);
1052 
1053  case 4:
1055  return luaEnable(vm);
1056  case 5:
1058  return luaDisable(vm);
1059 
1060 
1061 
1062  case 6:
1064  return luaSetTicks(vm);
1065  case 7:
1067  return luaGetTicks(vm);
1068 
1070  case 8:
1072  return luaGetEffectState(vm);
1073  case 9:
1075  return luaSetEffectState(vm);
1076 
1077  default:
1078  //MODebug2->Message( moText("Called moEffect::ScriptCalling, NextScriptCalling, from m_iMethodBase: ") + IntToStr(m_iMethodBase) );
1080  //MODebug2->Message( moText("Called moEffect::ScriptCalling, NextScriptCalling, to m_iMethodBase: ") + IntToStr(m_iMethodBase) );
1081  return moMoldeoObject::ScriptCalling( vm, iFunctionNumber );
1082  }
1083  return 0;
1084 }
1085 
1086 
1088 
1089  lua_State *luastate = (lua_State *) vm;
1090  if (luastate)
1091  Play();
1092 
1093  return 0;
1094 }
1095 
1097 
1098  lua_State *luastate = (lua_State *) vm;
1099  if (luastate)
1100  Pause();
1101 
1102  return 0;
1103 }
1104 
1106 
1107  lua_State *luastate = (lua_State *) vm;
1108  if (luastate)
1109  Stop();
1110 
1111  return 0;
1112 }
1113 
1115 
1116  lua_State *luastate = (lua_State *) vm;
1117 
1118  moTimerState elstate = State();
1119  int retstate = (int) elstate;
1120  lua_pushnumber( luastate, (lua_Number) retstate);
1121 
1122  return 1;
1123 }
1124 
1126 {
1127  lua_State *luastate = (lua_State *) vm;
1128 
1129  MOint ticksint = (MOint) lua_tonumber (luastate, 1);
1130 
1131  m_EffectState.tempo.SetDuration( ticksint );
1132 
1133  return 0;
1134 }
1135 
1137 {
1138  lua_State *luastate = (lua_State *) vm;
1139  //MODebug2->Message(moText("moEffect::luaGetTicks() > ")+IntToStr(moGetTicks()) );
1140  lua_pushnumber(luastate, (lua_Number) moGetTicks() );
1141 
1142  return 1;
1143 }
1144 
1146 {
1147  lua_State *luastate = (lua_State *) vm;
1148 
1149  luastate = NULL;
1150 
1151  TurnOn();
1152 
1153  return luastate==NULL;
1154 }
1155 
1157 {
1158  lua_State *luastate = (lua_State *) vm;
1159  if (luastate)
1160  TurnOff();
1161 
1162  return 0;
1163 }
1164 
1165 
1166 
1168 
1169  lua_State *luastate = (lua_State *) vm;
1170 
1171 
1172  m_EffectState.alpha = (MOfloat) lua_tonumber (luastate, 1);
1173  m_EffectState.tint = (MOfloat) lua_tonumber (luastate, 2);
1174  m_EffectState.tintr = (MOfloat) lua_tonumber (luastate, 3);
1175  m_EffectState.tintg = (MOfloat) lua_tonumber (luastate, 4);
1176  m_EffectState.tintb = (MOfloat) lua_tonumber (luastate, 5);
1177  m_EffectState.tempo.ang = (MOfloat) lua_tonumber (luastate, 7);
1178 
1179  return 0;
1180 
1181 }
1182 
1184  lua_State *luastate = (lua_State *) vm;
1185 
1186  lua_pushnumber(luastate, (lua_Number) m_EffectState.alpha );
1187  lua_pushnumber(luastate, (lua_Number) m_EffectState.tint );
1188  lua_pushnumber(luastate, (lua_Number) m_EffectState.tintr );
1189  lua_pushnumber(luastate, (lua_Number) m_EffectState.tintg );
1190  lua_pushnumber(luastate, (lua_Number) m_EffectState.tintb );
1191  lua_pushnumber(luastate, (lua_Number) m_EffectState.tempo.ang );
1192 
1193  return 0;
1194 }
1195 
1196 
1197 const moText&
1199 
1200  moText fieldSeparation = ",";
1201  moEffectState EffectState = GetEffectState();
1202  moText objectJSON = moMoldeoObject::ToJSON();
1203  m_FullJSON = "{";
1204  m_FullJSON+= "'effectstate': " + EffectState.ToJSON();
1205  m_FullJSON+= fieldSeparation + "'object': " + objectJSON;
1206  m_FullJSON+= "}";
1207 
1208  return m_FullJSON;
1209 
1210 }
1211 
1212 
double SetTempoDelta(double p_delta)
Definition: moEffect.cpp:842
virtual void Deactivate()
virtual int NextScriptCalling()
Definition: moScript.h:178
int luaState(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1114
virtual void ScriptExeInteraction()
Definition: moEffect.cpp:323
Valor de un Parámetro.
Definition: moValue.h:501
moEffect()
Definition: moEffect.cpp:58
int RegisterBaseFunction(const char *strFuncName)
Definition: moScript.cpp:340
MOdouble mousexbuttonright
Definition: moEffect.h:256
moInlet * InletMouseX
Definition: moEffect.h:236
moInlet * InletMouseButtonMiddle
Definition: moEffect.h:242
bool IsInitialized()
Definition: moScript.h:74
sólo líneas
Definition: moTypes.h:475
MOdouble Eval()
Definition: moValue.cpp:424
virtual moVector3f GetTintRGB() const
Definition: moEffect.cpp:953
moEvent * First
Definition: moEventList.h:145
aditivo por color
Definition: moTypes.h:460
virtual double GetAmplitude() const
Definition: moEffect.cpp:900
Clase Evento.
Definition: moEventList.h:56
virtual void SetDuration(MOulong p_timecode)
Fija el valor del reloj del temporizador.
Definition: moTimer.cpp:249
void RegisterFunctions()
beware ! call only once or die!!!
Definition: moEffect.cpp:1012
MOdouble mousebuttonright
Definition: moEffect.h:254
#define MO_BLUE
Definition: moTypes.h:443
void Error(moText p_text)
Anuncia y registra un error.
Definition: moAbstract.cpp:79
Tempo, beat, ritmo.
Definition: moTempo.h:44
virtual moVector3f GetTintCSV() const
Definition: moEffect.cpp:948
virtual double TempoDelta(double p_delta)
Definition: moEffect.cpp:827
moDataType Type() const
Definition: moValue.cpp:940
moMathFunction * Fun()
referencias a clases
Definition: moValue.cpp:417
MOdouble mousefactor
Definition: moEffect.h:254
MOdouble Double() const
Definition: moValue.cpp:859
virtual void Unsynchronize()
Definition: moEffect.cpp:812
virtual void Start()
Inicia el temporizador.
Definition: moTimer.cpp:196
MOint isyncro
Definition: moEffect.h:197
Conector Inlet, conector que recibe datos.
Definition: moConnectors.h:374
MOdouble mouseybuttonleft
Definition: moEffect.h:255
virtual void Continue()
Definition: moEffect.cpp:974
moValueBase & GetSubValue(MOint p_indexsubvalue=0)
Definition: moValue.h:539
virtual void TintCSV(double tintc, double tints, double tint)
Definition: moEffect.cpp:916
virtual MOboolean CreateConnectors()
virtual void Play()
Definition: moEffect.cpp:959
virtual void ScriptExeDraw()
Definition: moEffect.cpp:314
void SetDouble(MOdouble pdouble)
Definition: moValue.cpp:172
moInlet * InletMouseXButtonMiddle
Definition: moEffect.h:246
sustracción
Definition: moTypes.h:462
moDefineDynamicArray(moEffectsArray) typedef enum
Definition: moEffect.cpp:45
virtual void LoadCodes(moIODeviceManager *)
Definition: moEffect.cpp:460
int luaPlay(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1087
virtual double TempoFactor(double p_factor)
Definition: moEffect.cpp:863
moRenderManager * GetRenderMan()
moInlet * InletMouseYButtonLeft
Definition: moEffect.h:248
#define MOboolean
Definition: moTypes.h:385
#define MO_OFF
Definition: moTypes.h:366
virtual void Activate()
Real W() const
Definition: moMathVector4.h:81
virtual int ScriptCalling(moLuaVirtualMachine &vm, int iFunctionNumber)
int GetParamIndex(moText p_paramname)
Devuelve el �ndice correspondiente al par�metro por nombre.
Definition: moConfig.cpp:1008
virtual MOdevcode GetCode(moText)=0
bool RunSelectedFunction(int nReturns=0)
Definition: moScript.cpp:529
virtual void Pause()
Definition: moEffect.cpp:969
virtual void Disable()
Definition: moEffect.cpp:794
MOswitch enabled
Definition: moEffectState.h:85
int luaDisable(moLuaVirtualMachine &vm)
habilita deshabilita
Definition: moEffect.cpp:1156
virtual void Synchronize()
Definition: moEffect.cpp:807
value type: NUM or FUNCTION
Definition: moParam.h:46
int luaPause(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1096
moInlet * InletTime
Definition: moEffect.h:229
int luaStop(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1105
virtual moTimerState State()
Definition: moEffect.cpp:979
virtual ~moEffect()
Definition: moEffect.cpp:82
Objeto indefinido.
Definition: moTypes.h:527
MOulong moGetTicksAbsolute(bool force_real_absolute)
Devuelve en milisegundos el valor del reloj de Moldeo.
Definition: moTimer.cpp:15
moInlet * InletTempo
Definition: moEffect.h:235
virtual MOboolean PreInit()
Definition: moEffect.cpp:122
MOdouble syncro
Syncronización o factor fraccionario, 1.0 predeterminado, sino KX donde K puede ser fraccional (un nú...
Definition: moTempo.h:79
MOboolean CheckErrors(moText p_location)
MOuint Length() const
Definition: moText.cpp:347
moInlets m_Inlets
Conectores de entrada, Arreglo de moInlet&#39;s.
virtual void BeginDraw(moTempo *, moEffectState *parentstate=NULL)
Definition: moEffect.cpp:343
const moText & GetLabelName() const
Real Y() const
Definition: moMathVector4.h:77
moGLManager * GetGLMan()
definici�n de todos los par�metros a encontrar o a crear dentro del moConfig
Definition: moConfig.h:57
virtual double GetMagnitude() const
Definition: moEffect.cpp:911
MOdouble mouseybuttonmiddle
Definition: moEffect.h:257
#define MOfloat
Definition: moTypes.h:403
MOint ScreenHeight() const
MOdouble delta
variacion de frecuencia entre 0X y 2X, delta es real
Definition: moTempo.h:69
void Add(MOint, MOint, MOint=0)
value type: TXT or LNK
Definition: moParam.h:57
virtual const moMobState & GetState()
Definition: moEffect.cpp:102
virtual double Alpha(double alpha)
Definition: moEffect.cpp:879
moPolygonModes m_PolygonMode
Definition: moGUIManager.h:276
moInlet * InletMouseXButtonLeft
Definition: moEffect.h:244
clase de para manejar textos
Definition: moText.h:75
virtual void TurnOff()
Definition: moEffect.cpp:785
moInlet * InletMouseXButtonRight
Definition: moEffect.h:245
MOuint GetValuesCount(int p_paramindex)
Devuelve la cantidad de valores que contiene el par�metro indexado.
Definition: moConfig.cpp:1019
aditivo según transparencia
Definition: moTypes.h:456
virtual void Stop()
Definition: moEffect.cpp:964
moResourceManager * m_pResourceManager
Puntero al administrador de recursos.
virtual const moEffectState & GetEffectState()
Definition: moEffect.cpp:88
void Stop()
Detiene el temporizador.
Definition: moTimer.h:219
moInlet * InletTimems
Definition: moEffect.h:230
MOint ScreenWidth() const
virtual moConfigDefinition * GetDefinition(moConfigDefinition *p_configdefinition=NULL)
Definition: moEffect.cpp:998
virtual moConfigDefinition * GetDefinition(moConfigDefinition *p_configdefinition=NULL)
void Log(moText p_text)
Escribe un mensaje en el archivo de registro (log)
Definition: moAbstract.cpp:123
void SetCurrentValueIndex(int p_paramindex, int p_valueindex)
Posiciona el puntero de selecci�n del valor del par�metro a la posici�n indicada.
Definition: moConfig.cpp:1501
moText0 & Trim()
Definition: moText.cpp:604
moMaterial m_Material
Definition: moGUIManager.h:317
moInlet * InletTimes
Definition: moEffect.h:232
moText0 moText
Definition: moText.h:291
moConfig m_Config
Configuración de parámetros del objeto.
moEffectState m_EffectState
Definition: moEffect.h:206
moColorRGB moColor
Definition: moGUIManager.h:49
MOboolean Init()
Inicializa el objeto.
moInlet * InletT
Definition: moEffect.h:234
virtual void EndDraw()
Definition: moEffect.cpp:433
bool Activated() const
int luaEnable(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1145
moMobState m_MobState
Moldeo Object State.
MOdouble getTempo()
Definition: moTempo.cpp:153
#define MOint
Definition: moTypes.h:388
moEventCode
Definition: moEffect.cpp:55
moInlet * InletMouseYButtonRight
Definition: moEffect.h:249
MOswitch synchronized
Definition: moEffectState.h:77
moTimerState
Estado del temporizador.
Definition: moTimer.h:75
Real Z() const
Definition: moMathVector3.h:77
virtual int ResetScriptCalling()
Definition: moScript.h:172
bool ScriptHasFunction(const char *strScriptName)
Definition: moScript.cpp:417
moInlet * InletMouseFactor
Definition: moEffect.h:238
MOdouble mousebuttonleft
Definition: moEffect.h:254
moInlet * InletMouseButtonRight
Definition: moEffect.h:241
moColor m_Color
Definition: moGUIManager.h:273
#define MO_DEACTIVATED
Definition: moTypes.h:368
virtual const moText & ToJSON()
Definition: moEffect.cpp:1198
#define MO_IODEVICE_MOUSE
virtual MOboolean PreFinish()
Definition: moEffect.cpp:451
void Pause()
Congela o pausa el temporizador.
Definition: moTimer.h:231
virtual moTimerState State() const
Definition: moTimer.cpp:101
moVector4f moColorRGBA
Definition: moGUIManager.h:48
#define MO_PARAM_NOT_FOUND
Definition: moConfig.h:41
virtual double GetTempoDelta() const
Definition: moEffect.cpp:857
MOdouble factor
Multiplicador a partir de 2X hasta KX, donde K en principio es entero.
Definition: moTempo.h:76
virtual void SwitchEnabled()
Definition: moEffect.cpp:802
virtual void SwitchOn()
Definition: moEffect.cpp:798
virtual double Amplitude(double amplitude)
Definition: moEffect.cpp:894
virtual void Update(moEventList *p_EventList)
#define MO_GREEN
Definition: moTypes.h:442
void BeatPulse(MOulong tik)
Definition: moTempo.cpp:209
void Continue()
Prosigue el temporizador.
Definition: moTimer.h:239
int luaGetTicks(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1136
MOdouble mousexbuttonleft
Definition: moEffect.h:255
multipliación
Definition: moTypes.h:458
moInlet * InletMouseYButtonMiddle
Definition: moEffect.h:250
virtual bool SetEffectState(const moEffectState &p_state)
Definition: moEffect.cpp:92
Real Y() const
Definition: moMathVector3.h:75
moObject3D m_Effect3D
Definition: moEffect.h:207
virtual void RegisterFunctions()
beware ! call only once or die!!!
static moDebug * MODebug2
Clase de impresión de errores para depuración.
Definition: moAbstract.h:225
Real X() const
Definition: moMathVector4.h:75
MOdouble mousey
Definition: moEffect.h:253
value type: NUM or FUNCTION
Definition: moParam.h:42
virtual void BeatPulse()
Definition: moEffect.cpp:820
void SetBlending(moBlendingModes blending)
Definition: moEffect.cpp:709
moText Text()
Definition: moValue.cpp:539
MOdouble mousexbuttonmiddle
Definition: moEffect.h:257
Real Z() const
Definition: moMathVector4.h:79
virtual double Eval()
void Deactivate()
moDeviceCodeList * devicecode
Definition: moEffect.h:194
void Push(moText p_text)
Apila el mensaje dentro de la pila de mensajes.
Definition: moAbstract.h:115
MOswitch fulldebug
saturación
static double FMod(double fX, double fY)
Definition: moMath.h:200
#define MO_SELECTED
Definition: moConfig.h:44
moInlet * InletMouseY
Definition: moEffect.h:237
moValue & GetValue(MOint i=-1)
Definition: moParam.cpp:1204
void SetColor(const moColorRGBA &color_rgba, double alpha, moEffectState &pstate)
Definition: moEffect.cpp:637
moInlet * InletMilliseconds
Definition: moEffect.h:231
Real X() const
Definition: moMathVector3.h:73
moParam & GetParam(MOint p_paramindex=-1)
Devuelve el par�metro por �ndice.
Definition: moConfig.cpp:984
value type: NUM or TEXT ( 0:FILL 1:LINE 2:POINT)
Definition: moParam.h:45
#define MOdouble
Definition: moTypes.h:404
#define MO_ON
Definition: moTypes.h:365
moBlendingModes m_Blending
Definition: moGUIManager.h:277
virtual double Magnitude(double magnitude)
Definition: moEffect.cpp:905
virtual long Duration()
Devuelve el valor del reloj del temporizador.
Definition: moTempo.cpp:146
MOfloat amplitude
Definition: moEffectState.h:88
MOdouble mousebuttonmiddle
Definition: moEffect.h:254
virtual void PreDraw(moTempo *, moEffectState *parentstate=NULL)
Definition: moEffect.cpp:337
void Add(const moText &p_name, moParamType p_type, int p_index=-1, const moValue &p_defaultvalue=moValue("INVALID", MO_VALUE_UNDEFINED), const moText &p_OptionsStr=moText(""))
Agrega la definici�n de un par�metro con un valor predeterminado a tomar.
Definition: moConfig.cpp:139
transparencia
Definition: moTypes.h:455
const MOlong TWO_PI
Definition: moMath.cpp:45
virtual void Interaction(moIODeviceManager *)
Definition: moEffect.cpp:542
#define MOuint
Definition: moTypes.h:387
moVector3< MOfloat > moVector3f
LIBMOLDEO_API moText0 IntToStr(int a)
Definition: moText.cpp:1070
virtual void Enable()
Definition: moEffect.cpp:790
int luaSetTicks(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1125
moInlet * InletMouseButtonLeft
Definition: moEffect.h:240
bool SetCurrentParamIndex(int)
Selecciona el par�metro por el �ndice.
Definition: moConfig.cpp:1528
virtual const moText & ToJSON()
exclusión
Definition: moTypes.h:459
MOuint GetSubValueCount()
Definition: moValue.h:545
moIODevicesArray & IODevices()
moData * GetData()
Definition: moParam.cpp:1286
moEventList * GetEvents()
MOdouble mousex
Definition: moEffect.h:253
virtual bool Synchronized()
Definition: moEffect.cpp:816
#define MO_ACTIVATED
Definition: moTypes.h:367
MOint iphase
Definition: moEffect.h:198
virtual int ScriptCalling(moLuaVirtualMachine &vm, int iFunctionNumber)
Definition: moEffect.cpp:1035
bool SelectScriptFunction(const char *strFuncName)
Definition: moScript.cpp:370
Conector para vincular objetos con datos.
Definition: moConnectors.h:57
MOdouble ang
Definition: moTempo.h:81
moData * GetData()
MOint ncodes
Definition: moEffect.h:195
void Message(moText p_text)
Anuncia un mensaje al usuario además de guardarlo en el log de texto.
Definition: moAbstract.cpp:114
void SetPolygonMode(moPolygonModes polygonmode)
Definition: moEffect.cpp:683
MOfloat magnitude
Definition: moEffectState.h:87
moMathFunction
bool FirstValue()
Selecciona el primer valor del par�metro actual.
Definition: moConfig.cpp:1563
virtual double GetTempoFactor() const
Definition: moEffect.cpp:874
MOdouble mouseybuttonright
Definition: moEffect.h:256
moPolygonModes
Modos de dibujado de polígonos.
Definition: moTypes.h:472
void SetType(moMoldeoObjectType p_type)
virtual void ScriptExeRun()
virtual double GetAlpha() const
Definition: moEffect.cpp:889
const moText & GetConfigName() const
int RegisterFunction(const char *strFuncName, moScript::Function &fun)
Definition: moScript.cpp:286
virtual void TurnOn()
Definition: moEffect.cpp:780
const moText & GetName() const
moBlendingModes
Modos de combinación.
Definition: moTypes.h:453
int m_iMethodBase
Definition: moScript.h:206
#define MO_ALPHA
Definition: moTypes.h:444
int luaGetEffectState(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1183
#define MO_RED
Definition: moTypes.h:441
moInlet * InletSeconds
Definition: moEffect.h:233
virtual const moText & ToJSON()
MOulong moGetTicks()
Devuelve en milisegundos el valor del reloj de Moldeo.
Definition: moTimer.cpp:138
virtual MOboolean Init()
virtual bool SetState(const moMobState &p_MobState)
Definition: moEffect.cpp:107
int luaSetEffectState(moLuaVirtualMachine &vm)
Definition: moEffect.cpp:1167