<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Cfk,<BR>
 <BR>
good progress; alas, I don't have good answers to your questions; as they are a bit too specific for my knowledge;<BR>
 <BR>
however, one minor c# tweak; I'd do<BR>
 <BR><FONT color=#0000ff size=2>
<FONT color=#008080 size=2>Primitive</FONT><FONT size=2>.</FONT><FONT color=#008080 size=2>ParticleSystem</FONT><FONT size=2> prules = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>Primitive</FONT><FONT size=2>.</FONT><FONT color=#008080 size=2>ParticleSystem</FONT><FONT size=2>();<BR>
</FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> i = 0; i < rules.Count; i += 2)<BR>
{<BR>
   PrimitiveRule rule = (PrimitiveRule)rules[i + 1];<BR>
 <BR>
</FONT>switch</FONT><FONT size=2> ( rule </FONT><FONT size=2>)<BR>
{<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_FLAGS:<BR>
prules.PartFlags = (</FONT><FONT color=#0000ff size=2>uint</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><BR>...<BR>
 <BR>
this is somewhat cleaner; a bit faster (less expensive casts) and will also (not sure, but I think so) explode if there is no corresponding enum for the value (which is good, but you might want to catch that)<BR>
<BR>Best regards,<BR>
/Stefan (aka lbsa71)<BR>
<BR><BR> <BR>
<BLOCKQUOTE>
<HR id=EC_stopSpelling>
Date: Wed, 26 Sep 2007 07:39:57 -0700<BR>From: cfk@pacbell.net<BR>To: opensim-dev@lists.berlios.de<BR>Subject: [Opensim-dev] llParticleSystem progress & questions<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<STYLE>
.ExternalClass DIV
{;}

</STYLE>

<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: arial, helvetica, sans-serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: arial, helvetica, sans-serif"><FONT size=2></FONT><BR>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: arial, helvetica, sans-serif">
<DIV>Dear Tedd & others:</DIV>
<DIV> </DIV>
<DIV>Please view the logic below as pseudo-code right now, although it does compile in LSL_BuiltIn_Commands.cs, and most of it is in focus, I am struggling with a few notions that I tried to encapsulate in my 4 questions. And thank you, lbsa and Tedd for getting me this far. Just bear with me as I work through the rest.</DIV>
<DIV> </DIV>
<DIV>Questions:</DIV>
<DIV> </DIV>
<DIV>1. It is not obvious to me how the CRC is calculated, nor which rule number, if any, it should be. We do have a CRC member in the Primitive.ParticleSystem structure and I assume that the client needs it in order to process the packet.</DIV>
<DIV> </DIV>
<DIV>2. I dont see where AngularVelocity is coming from the client, and I do see it defined in libsecondlife.ParticleSystem.cs;GetBytes().</DIV>
<DIV> </DIV>
<DIV>3. I see Omega, maybe coming in from the client, but I dont see it defined in libsecondlife.ParticleSystem.cs:GetBytes()</DIV>
<DIV> </DIV>
<DIV>4. StartScale and EndScale are two seperate items from the wiki.secondlife.com viewpoiont, that is X & Y, but appear to be one rule from the "www.caligari-designs.com/p4u2' viewpoint.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT size=2>
</FONT><FONT color=#008000 size=2>/* particle system rules should be coming into this routine as doublets, that is<BR>
rule[0] should be an integer from this list and rule[1] should be the arg<BR>
for the same integer. wiki.secondlife.com has most of this mapping, but some<BR>
came from http://www.caligari-designs.com/p4u2<BR>
We iterate through the list for 'Count' elements, incrementing by two for each<BR>
iteration and set the members of Primitive.ParticleSystem, one at a time.<BR>
*/<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>enum</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2> : </FONT><FONT color=#0000ff size=2>int<BR></FONT><FONT size=2>
{<BR>
PSYS_PART_FLAGS = 0, <BR>
PSYS_PART_START_COLOR = 1,<BR>
PSYS_PART_START_ALPHA = 2,<BR>
PSYS_PART_END_COLOR = 3,<BR>
PSYS_PART_END_ALPHA = 4,<BR>
PSYS_PART_START_SCALE = 5,<BR>
PSYS_PART_END_SCALE = 6,<BR>
PSYS_PART_MAX_AGE = 7,<BR>
PSYS_SRC_ACCEL = 8,<BR>
PSYS_SRC_PATTERN = 9,<BR>
PSYS_SRC_TEXTURE = 12,<BR>
PSYS_SRC_BURST_RATE = 13,<BR>
PSYS_SRC_BURST_PART_COUNT = 15,<BR>
PSYS_SRC_BURST_RADIUS = 16,<BR>
PSYS_SRC_BURST_SPEED_MIN = 17,<BR>
PSYS_SRC_BURST_SPEED_MAX = 18,<BR>
PSYS_SRC_MAX_AGE = 19,<BR>
PSYS_SRC_TARGET_KEY = 20,<BR>
PSYS_SRC_OMEGA = 21,<BR>
PSYS_SRC_ANGLE_BEGIN = 22,<BR>
PSYS_SRC_ANGLE_END = 23<BR>
}<BR>
</FONT><FONT color=#0000ff size=2>public</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>void</FONT><FONT size=2> llParticleSystem(</FONT><FONT color=#008080 size=2>List</FONT><FONT size=2><</FONT><FONT color=#008080 size=2>Object</FONT><FONT size=2>> rules) <BR>
{<BR>
</FONT><FONT color=#008080 size=2>Primitive</FONT><FONT size=2>.</FONT><FONT color=#008080 size=2>ParticleSystem</FONT><FONT size=2> prules = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>Primitive</FONT><FONT size=2>.</FONT><FONT color=#008080 size=2>ParticleSystem</FONT><FONT size=2>();<BR>
</FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> i = 0; i < rules.Count; i += 2)<BR>
{<BR>
</FONT><FONT color=#0000ff size=2>switch</FONT><FONT size=2> ( (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)rules[i])<BR>
{<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_FLAGS:<BR>
prules.PartFlags = (</FONT><FONT color=#0000ff size=2>uint</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_START_COLOR:<BR>
prules.PartStartColor = (</FONT><FONT color=#008080 size=2>LLColor</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_START_ALPHA:<BR></FONT><FONT color=#008000 size=2>
//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_END_COLOR:<BR>
prules.PartEndColor = (</FONT><FONT color=#008080 size=2>LLColor</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_END_ALPHA:<BR></FONT><FONT color=#008000 size=2>
//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_START_SCALE:<BR></FONT><FONT color=#008000 size=2>
//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_END_SCALE:<BR>
</FONT><FONT color=#008000 size=2>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_PART_MAX_AGE:<BR>
prules.MaxAge = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_ACCEL:<BR>
</FONT><FONT color=#008000 size=2>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_PATTERN:<BR>
</FONT><FONT color=#008000 size=2>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_TEXTURE:<BR>
prules.Texture = (</FONT><FONT color=#008080 size=2>LLUUID</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_BURST_RATE:<BR>
prules.BurstRate = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_BURST_PART_COUNT:<BR>
prules.BurstPartCount = (</FONT><FONT color=#0000ff size=2>byte</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_BURST_RADIUS:<BR>
prules.BurstRadius = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_BURST_SPEED_MIN:<BR>
prules.BurstSpeedMin = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_BURST_SPEED_MAX:<BR>
prules.BurstSpeedMax = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_MAX_AGE:<BR>
prules.MaxAge = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_TARGET_KEY:<BR>
prules.Target = (</FONT><FONT color=#008080 size=2>LLUUID</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_OMEGA:<BR>
</FONT><FONT color=#008000 size=2>//cast?? prules.MaxAge = (float)rules[i + 1];<BR></FONT><FONT size=2>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_ANGLE_BEGIN:<BR>
prules.InnerAngle = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
</FONT><FONT color=#0000ff size=2>case</FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)</FONT><FONT color=#008080 size=2>PrimitiveRule</FONT><FONT size=2>.PSYS_SRC_ANGLE_END:<BR>
prules.OuterAngle = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];<BR>
</FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;<BR>
}<BR>
}<BR></FONT><FONT color=#008000 size=2>
// prules.AngularVelocity = (LLVector3)rules[0];<BR>
// prules.CRC = (uint)rules[6];<BR>
// prules.PartAcceleration = (LLVector3)rules[10];<BR>
// prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)rules[11];<BR>
// prules.PartEndScaleX = (float)rules[13];<BR>
// prules.PartEndScaleY = (float)rules[14];<BR>
// prules.PartStartScaleX = (float)rules[18];<BR>
// prules.PartStartScaleY = (float)rules[19];<BR>
// prules.StartAge = (float)rules[21];<BR></FONT><FONT size=2>
m_host.AddNewParticleSystem( prules );<BR>
}<BR></FONT></DIV></DIV>
<DIV id=EC_highlighterDiv style="DISPLAY: none; Z-INDEX: -1; BACKGROUND-COLOR: yellow"></DIV></DIV></DIV></BLOCKQUOTE></body>
</html>