## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# imesh/emit.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2000 by Jorrit Tyberghein
    00003     Copyright (C) 2001 by W.C.A. Wijngaards
    00004
    00005     This library is free software; you can redistribute it and/or
    00006     modify it under the terms of the GNU Library General Public
    00007     License as published by the Free Software Foundation; either
    00008     version 2 of the License, or (at your option) any later version.
    00009
    00010     This library is distributed in the hope that it will be useful,
    00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013     Library General Public License for more details.
    00014
    00015     You should have received a copy of the GNU Library General Public
    00016     License along with this library; if not, write to the Free
    00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00018 */
    00019
    00020 #ifndef __CS_IMESH_EMIT_H__
    00021 #define __CS_IMESH_EMIT_H__
    00022
    00027 #include "csutil/scf.h"
    00028
    00029 class csColor;
    00030 class csVector3;
    00031
    00032 SCF_VERSION (iEmitGen3D, 0, 0, 1);
    00033 SCF_VERSION (iEmitFixed, 0, 0, 1);
    00034 SCF_VERSION (iEmitSphere, 0, 0, 1);
    00035 SCF_VERSION (iEmitBox, 0, 0, 1);
    00036 SCF_VERSION (iEmitCone, 0, 0, 1);
    00037 SCF_VERSION (iEmitCylinder, 0, 0, 1);
    00038 SCF_VERSION (iEmitMix, 0, 0, 1);
    00039 SCF_VERSION (iEmitLine, 0, 0, 1);
    00040 SCF_VERSION (iEmitSphereTangent, 0, 0, 1);
    00041 SCF_VERSION (iEmitCylinderTangent, 0, 0, 1);
    00042
    00050 struct iEmitGen3D : public iBase
    00051 {
    00053   virtual void GetValue(csVector3& value, csVector3 &given) = 0;
    00054 };
    00055
    00065 struct iEmitFixed : public iEmitGen3D
    00066 {
    00068   virtual void SetValue(const csVector3& value) = 0;
    00069 };
    00070
    00080 struct iEmitSphere : public iEmitGen3D
    00081 {
    00083   virtual void SetContent(const csVector3& center, float min, float max) = 0;
    00085   virtual void GetContent(csVector3& center, float& min, float& max) = 0;
    00086 };
    00087
    00097 struct iEmitBox : public iEmitGen3D
    00098 {
    00100   virtual void SetContent(const csVector3& min, const csVector3& max) = 0;
    00102   virtual void GetContent(csVector3& min, csVector3& max) = 0;
    00103 };
    00104
    00114 struct iEmitCone : public iEmitGen3D
    00115 {
    00120   virtual void SetContent(const csVector3& origin, float elevation,
    00121     float azimuth, float aperture, float min, float max) = 0;
    00123   virtual void GetContent(csVector3& origin, float& elevation,
    00124     float& azimuth, float& aperture, float& min, float& max) = 0;
    00125 };
    00126
    00136 struct iEmitMix : public iEmitGen3D
    00137 {
    00139   virtual void AddEmitter(float weight, iEmitGen3D* emit) = 0;
    00145   virtual void RemoveEmitter(int num) = 0;
    00147   virtual float GetTotalWeight() = 0;
    00149   virtual int GetEmitterCount() = 0;
    00155   virtual void AdjustEmitterWeight(int num,float weight) = 0;
    00157   virtual void GetContent(int num, float& weight, iEmitGen3D*& emit) = 0;
    00158 };
    00159
    00169 struct iEmitLine : public iEmitGen3D
    00170 {
    00172   virtual void SetContent(const csVector3& start, const csVector3& end) = 0;
    00174   virtual void GetContent(csVector3& start, csVector3& end) = 0;
    00175 };
    00176
    00186 struct iEmitCylinder : public iEmitGen3D
    00187 {
    00189   virtual void SetContent(const csVector3& start, const csVector3& end,
    00190     float min, float max) = 0;
    00192   virtual void GetContent(csVector3& start, csVector3& end,
    00193     float& min, float& max) = 0;
    00194 };
    00195
    00206 struct iEmitSphereTangent : public iEmitGen3D
    00207 {
    00209   virtual void SetContent(const csVector3& center, float min, float max) = 0;
    00211   virtual void GetContent(csVector3& center, float& min, float& max) = 0;
    00212 };
    00213
    00224 struct iEmitCylinderTangent : public iEmitGen3D
    00225 {
    00227   virtual void SetContent(const csVector3& start, const csVector3& end,
    00228     float min, float max) = 0;
    00230   virtual void GetContent(csVector3& start, csVector3& end,
    00231     float& min, float& max) = 0;
    00232 };
    00233
    00234 SCF_VERSION (iEmitFactoryState, 0, 0, 2);
    00235
    00249 struct iEmitFactoryState : public iBase
    00250 {
    00252   virtual csRef<iEmitFixed> CreateFixed() = 0;
    00254   virtual csRef<iEmitBox> CreateBox() = 0;
    00256   virtual csRef<iEmitSphere> CreateSphere() = 0;
    00258   virtual csRef<iEmitCone> CreateCone() = 0;
    00260   virtual csRef<iEmitMix> CreateMix() = 0;
    00262   virtual csRef<iEmitLine> CreateLine() = 0;
    00264   virtual csRef<iEmitCylinder> CreateCylinder() = 0;
    00266   virtual csRef<iEmitSphereTangent> CreateSphereTangent() = 0;
    00268   virtual csRef<iEmitCylinderTangent> CreateCylinderTangent() = 0;
    00269 };
    00270
    00271 SCF_VERSION (iEmitState, 0, 0, 1);
    00272
    00286 struct iEmitState : public iBase
    00287 {
    00289   virtual void SetParticleCount (int num) = 0;
    00291   virtual int GetParticleCount () const = 0;
    00293   virtual void SetLighting (bool l) = 0;
    00295   virtual bool GetLighting () const = 0;
    00297   virtual void SetParticleTime(int ttl) = 0;
    00299   virtual int GetParticleTime() const = 0;
    00301   virtual void SetStartPosEmit(iEmitGen3D *emit) = 0;
    00303   virtual iEmitGen3D* GetStartPosEmit() const = 0;
    00305   virtual void SetStartSpeedEmit(iEmitGen3D *emit) = 0;
    00307   virtual iEmitGen3D* GetStartSpeedEmit() const = 0;
    00309   virtual void SetStartAccelEmit(iEmitGen3D *emit) = 0;
    00311   virtual iEmitGen3D* GetStartAccelEmit() const = 0;
    00313   virtual void SetAttractorEmit(iEmitGen3D *emit) = 0;
    00315   virtual iEmitGen3D* GetAttractorEmit() const = 0;
    00316
    00318   virtual void SetAttractorForce(float f) = 0;
    00320   virtual float GetAttractorForce() const = 0;
    00321
    00323   virtual void SetFieldSpeedEmit(iEmitGen3D *emit) = 0;
    00325   virtual iEmitGen3D* GetFieldSpeedEmit() const = 0;
    00327   virtual void SetFieldAccelEmit(iEmitGen3D *emit) = 0;
    00329   virtual iEmitGen3D* GetFieldAccelEmit() const = 0;
    00330
    00341   virtual void AddAge(int time, const csColor& color, float alpha,
    00342     float swirl, float rotspeed, float scale) = 0;
    00344   virtual int GetAgingCount() const = 0;
    00346   virtual void GetAgingMoment(int i, int& time, csColor& color, float &alpha,
    00347     float& swirl, float& rotspeed, float& scale) = 0;
    00349   virtual void RemoveAge(int time, const csColor& color, float alpha,
    00350         float swirl, float rotspeed, float scale) = 0;
    00352   virtual void ReplaceAge(int time, const csColor& color, float alpha,
    00353     float swirl, float rotspeed, float scale) = 0;
    00354
    00356   virtual void SetRectParticles(float w, float h) = 0;
    00358   virtual void SetRegularParticles(int n, float radius) = 0;
    00360   virtual bool UsingRectParticles() const = 0;
    00362   virtual void GetRectParticles(float &w, float &h) const = 0;
    00364   virtual void GetRegularParticles(int& n, float& radius) const = 0;
    00365
    00367   virtual void SetContainerBox(bool enabled, const csVector3& min,
    00368     const csVector3& max) = 0;
    00375   virtual bool GetContainerBox(csVector3& min, csVector3& max) const = 0;
    00376 };
    00377
    00380 #endif // __CS_IMESH_EMIT_H__
    00381