Mantis#1521. Thank you kindly, Lmmz for a patch that:
Improves the implementation of the particle system.0.6.0-stable
parent
2248ad2ed2
commit
10822a139f
|
@ -1056,6 +1056,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_particleSystem = pSystem.GetBytes();
|
m_particleSystem = pSystem.GetBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RemoveParticleSystem()
|
||||||
|
{
|
||||||
|
m_particleSystem = new byte[0];
|
||||||
|
}
|
||||||
|
|
||||||
/// Terse updates
|
/// Terse updates
|
||||||
public void AddTerseUpdateToAllAvatars()
|
public void AddTerseUpdateToAllAvatars()
|
||||||
{
|
{
|
||||||
|
|
|
@ -4322,11 +4322,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
return returnval;
|
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)
|
public void llParticleSystem(LSL_Types.list rules)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
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();
|
LSL_Types.Vector3 tempv = new LSL_Types.Vector3();
|
||||||
|
|
||||||
float tempf = 0;
|
float tempf = 0;
|
||||||
|
@ -4467,6 +4490,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
prules.CRC = 1;
|
prules.CRC = 1;
|
||||||
|
|
||||||
m_host.AddNewParticleSystem(prules);
|
m_host.AddNewParticleSystem(prules);
|
||||||
|
}
|
||||||
m_host.SendFullUpdateToAllClients();
|
m_host.SendFullUpdateToAllClients();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue