Mantis#1521. Thank you kindly, Lmmz for a patch that:

Improves the implementation of the particle system.
0.6.0-stable
Charles Krinke 2008-08-08 15:16:30 +00:00
parent 2248ad2ed2
commit 10822a139f
2 changed files with 168 additions and 139 deletions

View File

@ -1056,6 +1056,11 @@ namespace OpenSim.Region.Environment.Scenes
m_particleSystem = pSystem.GetBytes();
}
public void RemoveParticleSystem()
{
m_particleSystem = new byte[0];
}
/// Terse updates
public void AddTerseUpdateToAllAvatars()
{

View File

@ -4322,11 +4322,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return returnval;
}
private Primitive.ParticleSystem getNewParticleSystemWithSLDefaultValues()
{
Primitive.ParticleSystem ps = new Primitive.ParticleSystem();
// TODO find out about the other defaults and add them here
ps.PartStartColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f);
ps.PartEndColor = new LLColor(1.0f, 1.0f, 1.0f, 1.0f);
ps.PartStartScaleX = 1.0f;
ps.PartStartScaleY = 1.0f;
ps.PartEndScaleX = 1.0f;
ps.PartEndScaleY = 1.0f;
ps.BurstSpeedMin = 1.0f;
ps.BurstSpeedMax = 1.0f;
ps.BurstRate = 0.1f;
ps.PartMaxAge = 10.0f;
return ps;
}
public void llParticleSystem(LSL_Types.list rules)
{
m_host.AddScriptLPS(1);
Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
if(rules.Length == 0)
{
m_host.RemoveParticleSystem();
}
else
{
Primitive.ParticleSystem prules = getNewParticleSystemWithSLDefaultValues();
LSL_Types.Vector3 tempv = new LSL_Types.Vector3();
float tempf = 0;
@ -4467,6 +4490,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
prules.CRC = 1;
m_host.AddNewParticleSystem(prules);
}
m_host.SendFullUpdateToAllClients();
}