## 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_interface.h"
    00028
    00029 class csColor;
    00030 class csVector3;
    00031
    00039 struct iEmitGen3D : public virtual iBase
    00040 {
    00041   SCF_INTERFACE(iEmitGen3D, 2, 0, 0);
    00042
    00044   virtual void GetValue(csVector3& value, csVector3 &given) = 0;
    00045 };
    00046
    00056 struct iEmitFixed : public iEmitGen3D
    00057 {
    00058   SCF_INTERFACE(iEmitFixed, 2, 0, 0);
    00059
    00061   virtual void SetValue(const csVector3& value) = 0;
    00062 };
    00063
    00073 struct iEmitSphere : public iEmitGen3D
    00074 {
    00075   SCF_INTERFACE(iEmitSphere, 2, 0, 0);
    00076
    00078   virtual void SetContent(const csVector3& center, float min, float max) = 0;
    00080   virtual void GetContent(csVector3& center, float& min, float& max) = 0;
    00081 };
    00082
    00092 struct iEmitBox : public iEmitGen3D
    00093 {
    00094   SCF_INTERFACE(iEmitBox, 2, 0, 0);
    00095
    00097   virtual void SetContent(const csVector3& min, const csVector3& max) = 0;
    00099   virtual void GetContent(csVector3& min, csVector3& max) = 0;
    00100 };
    00101
    00111 struct iEmitCone : public iEmitGen3D
    00112 {
    00113   SCF_INTERFACE(iEmitCone, 2, 0, 0);
    00114
    00119   virtual void SetContent(const csVector3& origin, float elevation,
    00120     float azimuth, float aperture, float min, float max) = 0;
    00122   virtual void GetContent(csVector3& origin, float& elevation,
    00123     float& azimuth, float& aperture, float& min, float& max) = 0;
    00124 };
    00125
    00135 struct iEmitMix : public iEmitGen3D
    00136 {
    00137   SCF_INTERFACE(iEmitMix, 2, 0, 0);
    00138
    00140   virtual void AddEmitter(float weight, iEmitGen3D* emit) = 0;
    00146   virtual void RemoveEmitter(int num) = 0;
    00148   virtual float GetTotalWeight() = 0;
    00150   virtual int GetEmitterCount() = 0;
    00156   virtual void AdjustEmitterWeight(int num,float weight) = 0;
    00158   virtual void GetContent(int num, float& weight, iEmitGen3D*& emit) = 0;
    00159 };
    00160
    00170 struct iEmitLine : public iEmitGen3D
    00171 {
    00172   SCF_INTERFACE(iEmitLine, 2, 0, 0);
    00173
    00175   virtual void SetContent(const csVector3& start, const csVector3& end) = 0;
    00177   virtual void GetContent(csVector3& start, csVector3& end) = 0;
    00178 };
    00179
    00189 struct iEmitCylinder : public iEmitGen3D
    00190 {
    00191   SCF_INTERFACE(iEmitCylinder, 2, 0, 0);
    00192
    00194   virtual void SetContent(const csVector3& start, const csVector3& end,
    00195     float min, float max) = 0;
    00197   virtual void GetContent(csVector3& start, csVector3& end,
    00198     float& min, float& max) = 0;
    00199 };
    00200
    00211 struct iEmitSphereTangent : public iEmitGen3D
    00212 {
    00213   SCF_INTERFACE(iEmitSphereTangent, 2, 0, 0);
    00214
    00216   virtual void SetContent(const csVector3& center, float min, float max) = 0;
    00218   virtual void GetContent(csVector3& center, float& min, float& max) = 0;
    00219 };
    00220
    00231 struct iEmitCylinderTangent : public iEmitGen3D
    00232 {
    00233   SCF_INTERFACE(iEmitCylinderTangent, 2, 0, 0);
    00234
    00236   virtual void SetContent(const csVector3& start, const csVector3& end,
    00237     float min, float max) = 0;
    00239   virtual void GetContent(csVector3& start, csVector3& end,
    00240     float& min, float& max) = 0;
    00241 };
    00242
    00256 struct iEmitFactoryState : public virtual iBase
    00257 {
    00258   SCF_INTERFACE(iEmitFactoryState, 2, 0, 0);
    00259
    00261   virtual csRef<iEmitFixed> CreateFixed() = 0;
    00263   virtual csRef<iEmitBox> CreateBox() = 0;
    00265   virtual csRef<iEmitSphere> CreateSphere() = 0;
    00267   virtual csRef<iEmitCone> CreateCone() = 0;
    00269   virtual csRef<iEmitMix> CreateMix() = 0;
    00271   virtual csRef<iEmitLine> CreateLine() = 0;
    00273   virtual csRef<iEmitCylinder> CreateCylinder() = 0;
    00275   virtual csRef<iEmitSphereTangent> CreateSphereTangent() = 0;
    00277   virtual csRef<iEmitCylinderTangent> CreateCylinderTangent() = 0;
    00278 };
    00279
    00293 struct iEmitState : public virtual iBase
    00294 {
    00295   SCF_INTERFACE(iEmitState, 2, 0, 0);
    00296
    00298   virtual void SetParticleCount (int num) = 0;
    00300   virtual size_t GetParticleCount () const = 0;
    00302   virtual void SetLighting (bool l) = 0;
    00304   virtual bool GetLighting () const = 0;
    00306   virtual void SetParticleTime(int ttl) = 0;
    00308   virtual int GetParticleTime() const = 0;
    00310   virtual void SetStartPosEmit(iEmitGen3D *emit) = 0;
    00312   virtual iEmitGen3D* GetStartPosEmit() const = 0;
    00314   virtual void SetStartSpeedEmit(iEmitGen3D *emit) = 0;
    00316   virtual iEmitGen3D* GetStartSpeedEmit() const = 0;
    00318   virtual void SetStartAccelEmit(iEmitGen3D *emit) = 0;
    00320   virtual iEmitGen3D* GetStartAccelEmit() const = 0;
    00322   virtual void SetAttractorEmit(iEmitGen3D *emit) = 0;
    00324   virtual iEmitGen3D* GetAttractorEmit() const = 0;
    00325
    00327   virtual void SetAttractorForce(float f) = 0;
    00329   virtual float GetAttractorForce() const = 0;
    00330
    00332   virtual void SetFieldSpeedEmit(iEmitGen3D *emit) = 0;
    00334   virtual iEmitGen3D* GetFieldSpeedEmit() const = 0;
    00336   virtual void SetFieldAccelEmit(iEmitGen3D *emit) = 0;
    00338   virtual iEmitGen3D* GetFieldAccelEmit() const = 0;
    00339
    00350   virtual void AddAge(int time, const csColor& color, float alpha,
    00351     float swirl, float rotspeed, float scale) = 0;
    00353   virtual int GetAgingCount() const = 0;
    00355   virtual void GetAgingMoment(int i, int& time, csColor& color, float &alpha,
    00356     float& swirl, float& rotspeed, float& scale) = 0;
    00358   virtual void RemoveAge(int time, const csColor& color, float alpha,
    00359         float swirl, float rotspeed, float scale) = 0;
    00361   virtual void ReplaceAge(int time, const csColor& color, float alpha,
    00362     float swirl, float rotspeed, float scale) = 0;
    00363
    00365   virtual void SetRectParticles(float w, float h) = 0;
    00367   virtual void SetRegularParticles(int n, float radius) = 0;
    00369   virtual bool UsingRectParticles() const = 0;
    00371   virtual void GetRectParticles(float &w, float &h) const = 0;
    00373   virtual void GetRegularParticles(int& n, float& radius) const = 0;
    00374
    00376   virtual void SetContainerBox(bool enabled, const csVector3& min,
    00377     const csVector3& max) = 0;
    00384   virtual bool GetContainerBox(csVector3& min, csVector3& max) const = 0;
    00385 };
    00386
    00389 #endif // __CS_IMESH_EMIT_H__
    00390