CrystalSpace

Public API Reference

ivaria/engseq.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2002 by Jorrit Tyberghein
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public
00015     License along with this library; if not, write to the Free
00016     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017 */
00018 
00019 #ifndef __CS_IVARIA_ENGSEQ_H__
00020 #define __CS_IVARIA_ENGSEQ_H__
00021 
00022 #include "csutil/scf.h"
00023 
00029 struct iLight;
00030 struct iMeshWrapper;
00031 struct iObject;
00032 struct iSector;
00033 struct iSharedVariable;
00034 
00035 class csBox3;
00036 class csColor;
00037 class csSphere;
00038 class csVector3;
00039 
00040 struct iSequence;
00041 struct iSequenceManager;
00042 struct iSequenceTrigger;
00043 struct iSequenceWrapper;
00044 
00046 
00049 enum
00050 {
00052   CS_SEQUENCE_LIGHTCHANGE_NONE = 0,
00054   CS_SEQUENCE_LIGHTCHANGE_LESS = 1,
00056   CS_SEQUENCE_LIGHTCHANGE_GREATER = 2
00057 };
00059 
00083 struct iParameterESM : public virtual iBase
00084 {
00085   SCF_INTERFACE (iParameterESM, 1, 0, 0);
00086 
00093   virtual iBase* GetValue (iBase* params = 0) const = 0;
00094 
00102   virtual bool IsConstant () const = 0;
00103 };
00104 
00129 struct iEngineSequenceParameters : public virtual iBase
00130 {
00131   SCF_INTERFACE (iEngineSequenceParameters, 1, 0, 0);
00132 
00136   virtual size_t GetParameterCount () const = 0;
00137 
00141   virtual iBase* GetParameter (size_t idx) const = 0;
00142 
00146   virtual iBase* GetParameter (const char* name) const = 0;
00147 
00151   virtual size_t GetParameterIdx (const char* name) const = 0;
00152 
00156   virtual const char* GetParameterName (size_t idx) const = 0;
00157 
00163   virtual void AddParameter (const char* name, iBase* def_value = 0) = 0;
00164 
00168   virtual void SetParameter (size_t idx, iBase* value) = 0;
00169 
00173   virtual void SetParameter (const char* name, iBase* value) = 0;
00174 
00181   virtual csPtr<iParameterESM> CreateParameterESM (const char* name) = 0;
00182 };
00183 
00206 struct iSequenceWrapper : public virtual iBase
00207 {
00208   SCF_INTERFACE (iSequenceWrapper, 0, 3, 0);
00212   virtual iObject* QueryObject () = 0;
00213 
00222   virtual iSequence* GetSequence () = 0;
00223 
00231   virtual iEngineSequenceParameters* CreateBaseParameterBlock () = 0;
00232 
00237   virtual iEngineSequenceParameters* GetBaseParameterBlock () = 0;
00238 
00250   virtual csPtr<iEngineSequenceParameters> CreateParameterBlock () = 0; 
00251 
00263   virtual void AddOperationSetVariable (csTicks time,
00264                 iSharedVariable* var, float value, float dvalue = 0) = 0;
00265 
00278   virtual void AddOperationSetVariable (csTicks time,
00279                 iSharedVariable* var, iSharedVariable* value,
00280                 iSharedVariable* dvalue = 0) = 0;
00281 
00288   virtual void AddOperationSetVariable (csTicks time,
00289                 iSharedVariable* var, const csVector3& v) = 0;
00290 
00297   virtual void AddOperationSetVariable (csTicks time,
00298                 iSharedVariable* var, const csColor& c) = 0;
00299 
00307   virtual void AddOperationSetMaterial (csTicks time, iParameterESM* mesh,
00308                   iParameterESM* mat) = 0;
00309 
00317   virtual void AddOperationSetPolygonMaterial (csTicks time,
00318                   iParameterESM* polygon, iParameterESM* mat) = 0;
00319 
00327   virtual void AddOperationSetLight (csTicks time, iParameterESM* light,
00328                   const csColor& color) = 0;
00329 
00340   virtual void AddOperationFadeLight (csTicks time, iParameterESM* light,
00341                   const csColor& color, csTicks duration) = 0;
00342 
00352   virtual void AddOperationSetAmbient (csTicks time, iParameterESM* sector,
00353                   const csColor& color, iSharedVariable *colorvar) = 0;
00354 
00365   virtual void AddOperationFadeAmbient (csTicks time, iParameterESM* sector,
00366                   const csColor& color, csTicks duration) = 0;
00367 
00375   virtual void AddOperationRandomDelay (csTicks time, int min, int max) = 0;
00376 
00384   virtual void AddOperationSetMeshColor (csTicks time, iParameterESM* mesh,
00385                   const csColor& color) = 0;
00386 
00397   virtual void AddOperationFadeMeshColor (csTicks time, iParameterESM* mesh,
00398                   const csColor& color, csTicks duration) = 0;
00399 
00408   virtual void AddOperationSetFog (csTicks time, iParameterESM* sector,
00409                   const csColor& color, float density) = 0;
00410 
00422   virtual void AddOperationFadeFog (csTicks time, iParameterESM* sector,
00423                   const csColor& color, float density, csTicks duration) = 0;
00424 
00443   virtual void AddOperationRotateDuration (csTicks time, iParameterESM* mesh,
00444                 int axis1, float tot_angle1,
00445                 int axis2, float tot_angle2,
00446                 int axis3, float tot_angle3,
00447                 const csVector3& offset,
00448                 csTicks duration) = 0;
00449 
00460   virtual void AddOperationMoveDuration (csTicks time, iParameterESM* mesh,
00461                 const csVector3& offset, csTicks duration) = 0;
00462 
00470   virtual void AddOperationTriggerState (csTicks time,
00471                   iParameterESM* trigger, bool en) = 0;
00472 
00482   virtual void AddOperationCheckTrigger (csTicks time,
00483                   iParameterESM* trigger, csTicks delay) = 0;
00484 
00498   virtual void AddOperationTestTrigger (csTicks time,
00499                   iParameterESM* trigger,
00500                   iSequence* trueSequence,
00501                   iSequence* falseSequence) = 0;
00502 };
00503 
00520 struct iSequenceTrigger : public virtual iBase
00521 {
00522   SCF_INTERFACE (iSequenceTrigger, 0, 0, 3);
00523 
00527   virtual iObject* QueryObject () = 0;
00528 
00532   virtual void AddConditionInSector (iSector* sector) = 0;
00533 
00537   virtual void AddConditionInSector (iSector* sector,
00538         const csBox3& box) = 0;
00539 
00543   virtual void AddConditionInSector (iSector* sector,
00544         const csSphere& sphere) = 0;
00545 
00549   virtual void AddConditionSectorVisible (iSector* sector) = 0;
00550 
00554   virtual void AddConditionMeshClick (iMeshWrapper* mesh) = 0;
00555 
00567   virtual void AddConditionLightChange (iLight *whichlight, 
00568                                         int oper, const csColor& color) = 0;
00569 
00575   virtual void AddConditionManual () = 0;
00576 
00581   virtual void SetEnabled (bool en) = 0;
00582 
00586   virtual bool IsEnabled () const = 0;
00587 
00591   virtual void ClearConditions () = 0;
00592 
00596   virtual void Trigger () = 0;
00597 
00601   virtual void SetParameters (iEngineSequenceParameters* params) = 0;
00602 
00606   virtual iEngineSequenceParameters* GetParameters () const = 0;
00607 
00614   virtual void FireSequence (csTicks delay, iSequenceWrapper* seq) = 0;
00615 
00619   virtual iSequenceWrapper* GetFiredSequence () = 0;
00620 
00626   virtual void TestConditions (csTicks delay) = 0;
00627 
00635   virtual bool CheckState () = 0;
00636 
00652   virtual void ForceFire (bool now = false) = 0;
00653 };
00654 
00672 struct iSequenceTimedOperation : public virtual iBase
00673 {
00674   SCF_INTERFACE (iSequenceTimedOperation, 1, 0, 0);
00675 
00679   virtual void Do (float time, iBase* params) = 0;
00680 };
00681 
00693 struct iEngineSequenceManager : public virtual iBase
00694 {
00695   SCF_INTERFACE (iEngineSequenceManager, 1, 0, 0);
00696  
00701   virtual iSequenceManager* GetSequenceManager () = 0;
00702 
00706   virtual csPtr<iParameterESM> CreateParameterESM (iBase* value) = 0;
00707 
00708   //-----------------------------------------------------------------------
00709 
00713   virtual csPtr<iSequenceTrigger> CreateTrigger (const char* name) = 0;
00714 
00718   virtual void RemoveTrigger (iSequenceTrigger* trigger) = 0;
00719 
00723   virtual void RemoveTriggers () = 0;
00724 
00728   virtual size_t GetTriggerCount () const = 0;
00729 
00733   virtual iSequenceTrigger* GetTrigger (size_t idx) const = 0;
00734 
00738   virtual iSequenceTrigger* FindTriggerByName (const char* name) const = 0;
00739 
00746   virtual bool FireTriggerByName (const char *name, bool now = false) const = 0;
00747 
00748   //-----------------------------------------------------------------------
00749 
00753   virtual csPtr<iSequenceWrapper> CreateSequence (const char* name) = 0;
00754 
00758   virtual void RemoveSequence (iSequenceWrapper* seq) = 0;
00759 
00763   virtual void RemoveSequences () = 0;
00764 
00768   virtual size_t GetSequenceCount () const = 0;
00769 
00773   virtual iSequenceWrapper* GetSequence (size_t idx) const = 0;
00774 
00778   virtual iSequenceWrapper* FindSequenceByName (const char* name) const = 0;
00779 
00783   virtual bool RunSequenceByName (const char *name,int delay) const = 0;
00784 
00785   //-----------------------------------------------------------------------
00786 
00798   virtual void FireTimedOperation (csTicks delta, csTicks duration,
00799         iSequenceTimedOperation* op, iBase* params = 0,
00800         uint sequence_id = 0) = 0;
00801 
00805   virtual void DestroyTimedOperations (uint sequence_id) = 0;
00806 
00807   //-----------------------------------------------------------------------
00808 };
00809 
00810 #endif // __CS_IVARIA_ENGSEQ_H__
00811 

Generated for Crystal Space by doxygen 1.4.7