<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><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>
<P></FONT><FONT color=#008000 size=2>/* particle system rules should be coming into this routine as doublets, that is</P>
<P>rule[0] should be an integer from this list and rule[1] should be the arg</P>
<P>for the same integer. wiki.secondlife.com has most of this mapping, but some</P>
<P>came from http://www.caligari-designs.com/p4u2</P>
<P>We iterate through the list for 'Count' elements, incrementing by two for each</P>
<P>iteration and set the members of Primitive.ParticleSystem, one at a time.</P>
<P>*/</P></FONT><FONT size=2>
<P></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</P></FONT><FONT size=2>
<P>{</P>
<P>PSYS_PART_FLAGS = 0, </P>
<P>PSYS_PART_START_COLOR = 1,</P>
<P>PSYS_PART_START_ALPHA = 2,</P>
<P>PSYS_PART_END_COLOR = 3,</P>
<P>PSYS_PART_END_ALPHA = 4,</P>
<P>PSYS_PART_START_SCALE = 5,</P>
<P>PSYS_PART_END_SCALE = 6,</P>
<P>PSYS_PART_MAX_AGE = 7,</P>
<P>PSYS_SRC_ACCEL = 8,</P>
<P>PSYS_SRC_PATTERN = 9,</P>
<P>PSYS_SRC_TEXTURE = 12,</P>
<P>PSYS_SRC_BURST_RATE = 13,</P>
<P>PSYS_SRC_BURST_PART_COUNT = 15,</P>
<P>PSYS_SRC_BURST_RADIUS = 16,</P>
<P>PSYS_SRC_BURST_SPEED_MIN = 17,</P>
<P>PSYS_SRC_BURST_SPEED_MAX = 18,</P>
<P>PSYS_SRC_MAX_AGE = 19,</P>
<P>PSYS_SRC_TARGET_KEY = 20,</P>
<P>PSYS_SRC_OMEGA = 21,</P>
<P>PSYS_SRC_ANGLE_BEGIN = 22,</P>
<P>PSYS_SRC_ANGLE_END = 23</P>
<P>}</P>
<P></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) </P>
<P>{</P>
<P></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>();</P>
<P></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)</P>
<P>{</P>
<P></FONT><FONT color=#0000ff size=2>switch</FONT><FONT size=2> ( (</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>)rules[i])</P>
<P>{</P>
<P></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:</P>
<P>prules.PartFlags = (</FONT><FONT color=#0000ff size=2>uint</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.PartStartColor = (</FONT><FONT color=#008080 size=2>LLColor</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P></FONT><FONT color=#008000 size=2>
<P>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.PartEndColor = (</FONT><FONT color=#008080 size=2>LLColor</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P></FONT><FONT color=#008000 size=2>
<P>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P></FONT><FONT color=#008000 size=2>
<P>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P></FONT><FONT color=#008000 size=2>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.MaxAge = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P></FONT><FONT color=#008000 size=2>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P></FONT><FONT color=#008000 size=2>//what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.Texture = (</FONT><FONT color=#008080 size=2>LLUUID</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.BurstRate = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.BurstPartCount = (</FONT><FONT color=#0000ff size=2>byte</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.BurstRadius = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.BurstSpeedMin = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.BurstSpeedMax = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.MaxAge = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.Target = (</FONT><FONT color=#008080 size=2>LLUUID</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P></FONT><FONT color=#008000 size=2>//cast?? prules.MaxAge = (float)rules[i + 1];</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.InnerAngle = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P></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:</P>
<P>prules.OuterAngle = (</FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2>)rules[i + 1];</P>
<P></FONT><FONT color=#0000ff size=2>break</FONT><FONT size=2>;</P>
<P>}</P>
<P>}</P></FONT><FONT color=#008000 size=2>
<P>// prules.AngularVelocity = (LLVector3)rules[0];</P>
<P>// prules.CRC = (uint)rules[6];</P>
<P>// prules.PartAcceleration = (LLVector3)rules[10];</P>
<P>// prules.PartDataFlags = (Primitive.ParticleSystem.ParticleDataFlags)rules[11];</P>
<P>// prules.PartEndScaleX = (float)rules[13];</P>
<P>// prules.PartEndScaleY = (float)rules[14];</P>
<P>// prules.PartStartScaleX = (float)rules[18];</P>
<P>// prules.PartStartScaleY = (float)rules[19];</P>
<P>// prules.StartAge = (float)rules[21];</P></FONT><FONT size=2>
<P>m_host.AddNewParticleSystem( prules );</P>
<P>}</P></FONT></DIV></DIV>
<DIV id=highlighterDiv style="DISPLAY: none; Z-INDEX: -1; POSITION: absolute; BACKGROUND-COLOR: yellow"></DIV></DIV></div></body></html>