|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MTV3D65;
namespace gefx
{
public class Particles
{
TVParticleSystem ParticlesSys;
public List<TVParticleSystem> Particle = new List<TVParticleSystem>();
public Particles()
{
ParticlesSys = new TVParticleSystem();
}
public void AddParticles(ref TVScene Scene, string PathToFile, string Name)
{
ParticlesSys = Scene.CreateParticleSystem(Name);
ParticlesSys.Load(PathToFile);
ParticlesSys.SetName(Name);
Particle.Add(ParticlesSys);
}
public void DrawParticles(string Name)
{
if (Name == "All")
{
foreach (TVParticleSystem s in Particle)
{
s.Render();
}
}
else
{
foreach (TVParticleSystem s in Particle)
{
if (s.GetName() == Name)
{
s.Render();
break;
}
}
}
}
public void UpdateParticles(string Name)
{
if (Name == "All")
{
foreach (TVParticleSystem s in Particle)
{
s.Update();
}
}
else
{
foreach (TVParticleSystem s in Particle)
{
if (s.GetName() == Name)
{
s.Update();
break;
}
}
}
}
public TV_3DVECTOR GetEmmiterPosition(string Name,int emmiter)
{
TV_3DVECTOR r = new TV_3DVECTOR(0, 0, 0);
foreach (TVParticleSystem part in Particle)
{
if (part.GetName() == Name)
{
r = part.GetEmitterPosition(emmiter);
break;
}
}
return r;
}
public void SetEmmiterPosition(string Name,TV_3DVECTOR P,int emmiter)
{
foreach (TVParticleSystem part in Particle)
{
if (part.GetName() == Name)
{
part.SetEmitterPosition(emmiter, P);
break;
}
}
}
public void MoveEmitter(string Name, TV_3DVECTOR P, int emmiter)
{
foreach (TVParticleSystem part in Particle)
{
if (part.GetName() == Name)
{
part.MoveEmitter(emmiter, P);
break;
}
}
}
public TV_3DVECTOR GetEmmiterDirection(string Name, int emmiter)
{
TV_3DVECTOR r = new TV_3DVECTOR(0, 0, 0);
foreach (TVParticleSystem part in Particle)
{
if (part.GetName() == Name)
{
r = part.GetEmitterDirection(emmiter);
break;
}
}
return r;
}
public void SetEmmiterDirection(string Name, TV_3DVECTOR s,int emitter)
{
foreach (TVParticleSystem part in Particle)
{
if (part.GetName() == Name)
{
part.SetEmitterDirection(emitter, true, s, new TV_3DVECTOR(0, 0, 0));
break;
}
}
}
public void AttachToActor(string Name,int IDActor,int Emitter)
{
foreach (TVParticleSystem p in Particle)
{
if (p.GetName() == Name)
{
p.AttachTo(Emitter, CONST_TV_NODETYPE.TV_NODETYPE_ACTOR, IDActor, 1);
}
}
}
public void Loop(string Name, int emitter, bool b)
{
foreach (TVParticleSystem part in Particle)
{
if (part.GetName() == Name)
{
break;
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.