diff options
author | Teravus Ovares | 2008-01-31 18:27:11 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-01-31 18:27:11 +0000 |
commit | e2f783789c7efc96c98debac288b7d1a95f3f1aa (patch) | |
tree | 5860c84d6803ddb615dc1f41936d9c59426599eb | |
parent | revert last IRC bridge changes as this broke chat on my test environment. (diff) | |
download | opensim-SC_OLD-e2f783789c7efc96c98debac288b7d1a95f3f1aa.zip opensim-SC_OLD-e2f783789c7efc96c98debac288b7d1a95f3f1aa.tar.gz opensim-SC_OLD-e2f783789c7efc96c98debac288b7d1a95f3f1aa.tar.bz2 opensim-SC_OLD-e2f783789c7efc96c98debac288b7d1a95f3f1aa.tar.xz |
* Adding limited support for LLParticleSystem.
* We still need to set the 'default particle' texture as, a particle system with no texture set doesn't work.
* The particle System Flags don't seem to be quite right yet as some flags don't seem to have an effect. So no alpha in/out, color change, affected by the wind, etc.. yet
* Thanks to Alondria for some massive work here. This update just tweaks a few things that she did.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 52 |
1 files changed, 38 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 9cdec11..b11ad05 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -2139,20 +2139,30 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2139 | PSYS_SRC_ANGLE_END = 23 | 2139 | PSYS_SRC_ANGLE_END = 23 |
2140 | } | 2140 | } |
2141 | 2141 | ||
2142 | internal Primitive.ParticleSystem.ParticleDataFlags ConvertUINTtoFlags(uint flags) | ||
2143 | { | ||
2144 | Primitive.ParticleSystem.ParticleDataFlags returnval = Primitive.ParticleSystem.ParticleDataFlags.None; | ||
2145 | |||
2146 | return returnval; | ||
2147 | } | ||
2148 | |||
2142 | // AL: This does not actually do anything yet. There are issues within Libsecondlife revolving around PSYS_PART_FLAGS | 2149 | // AL: This does not actually do anything yet. There are issues within Libsecondlife revolving around PSYS_PART_FLAGS |
2143 | // (need to OR the values, but currently stores this within an enum) as well as discovery of how the CRC works and the | 2150 | // (need to OR the values, but currently stores this within an enum) as well as discovery of how the CRC works and the |
2144 | // actual packet. | 2151 | // actual packet. |
2152 | |||
2145 | public void llParticleSystem(LSL_Types.list rules) | 2153 | public void llParticleSystem(LSL_Types.list rules) |
2146 | { | 2154 | { |
2147 | Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); | 2155 | Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); |
2148 | LSL_Types.Vector3 tempv = new LSL_Types.Vector3(); | 2156 | LSL_Types.Vector3 tempv = new LSL_Types.Vector3(); |
2157 | |||
2158 | float tempf = 0; | ||
2149 | 2159 | ||
2150 | for (int i = 0; i < rules.Length; i += 2) | 2160 | for (int i = 0; i < rules.Length; i += 2) |
2151 | { | 2161 | { |
2152 | switch ((int)rules.Data[i]) | 2162 | switch ((int)rules.Data[i]) |
2153 | { | 2163 | { |
2154 | case (int)LSL_BaseClass.PSYS_PART_FLAGS: | 2164 | case (int)LSL_BaseClass.PSYS_PART_FLAGS: |
2155 | prules.PartFlags = (uint)rules.Data[i + 1]; | 2165 | prules.PartFlags = (uint)Convert.ToInt32(rules.Data[i + 1].ToString()); |
2156 | break; | 2166 | break; |
2157 | 2167 | ||
2158 | case (int)LSL_BaseClass.PSYS_PART_START_COLOR: | 2168 | case (int)LSL_BaseClass.PSYS_PART_START_COLOR: |
@@ -2163,19 +2173,22 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2163 | break; | 2173 | break; |
2164 | 2174 | ||
2165 | case (int)LSL_BaseClass.PSYS_PART_START_ALPHA: | 2175 | case (int)LSL_BaseClass.PSYS_PART_START_ALPHA: |
2166 | prules.PartStartColor.A = (float)rules.Data[i + 1]; | 2176 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2177 | prules.PartStartColor.A = (float)tempf; | ||
2167 | break; | 2178 | break; |
2168 | 2179 | ||
2169 | case (int)LSL_BaseClass.PSYS_PART_END_COLOR: | 2180 | case (int)LSL_BaseClass.PSYS_PART_END_COLOR: |
2170 | prules.PartEndColor = (LLColor)rules.Data[i + 1]; | ||
2171 | tempv = (LSL_Types.Vector3)rules.Data[i + 1]; | 2181 | tempv = (LSL_Types.Vector3)rules.Data[i + 1]; |
2182 | //prules.PartEndColor = new LLColor(tempv.x,tempv.y,tempv.z,1); | ||
2183 | |||
2172 | prules.PartEndColor.R = (float)tempv.x; | 2184 | prules.PartEndColor.R = (float)tempv.x; |
2173 | prules.PartEndColor.G = (float)tempv.y; | 2185 | prules.PartEndColor.G = (float)tempv.y; |
2174 | prules.PartEndColor.B = (float)tempv.z; | 2186 | prules.PartEndColor.B = (float)tempv.z; |
2175 | break; | 2187 | break; |
2176 | 2188 | ||
2177 | case (int)LSL_BaseClass.PSYS_PART_END_ALPHA: | 2189 | case (int)LSL_BaseClass.PSYS_PART_END_ALPHA: |
2178 | prules.PartEndColor.A = (float)rules.Data[i + 1]; | 2190 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2191 | prules.PartEndColor.A = (float)tempf; | ||
2179 | break; | 2192 | break; |
2180 | 2193 | ||
2181 | case (int)LSL_BaseClass.PSYS_PART_START_SCALE: | 2194 | case (int)LSL_BaseClass.PSYS_PART_START_SCALE: |
@@ -2191,7 +2204,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2191 | break; | 2204 | break; |
2192 | 2205 | ||
2193 | case (int)LSL_BaseClass.PSYS_PART_MAX_AGE: | 2206 | case (int)LSL_BaseClass.PSYS_PART_MAX_AGE: |
2194 | prules.MaxAge = (float)rules.Data[i + 1]; | 2207 | //tempf = (LSL_Types.LSLFloat)rules.Data[i + 1]; |
2208 | prules.MaxAge = 7;//(float)tempf; | ||
2195 | break; | 2209 | break; |
2196 | 2210 | ||
2197 | case (int)LSL_BaseClass.PSYS_SRC_ACCEL: | 2211 | case (int)LSL_BaseClass.PSYS_SRC_ACCEL: |
@@ -2211,27 +2225,32 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2211 | break; | 2225 | break; |
2212 | 2226 | ||
2213 | case (int)LSL_BaseClass.PSYS_SRC_BURST_RATE: | 2227 | case (int)LSL_BaseClass.PSYS_SRC_BURST_RATE: |
2214 | prules.BurstRate = (float)rules.Data[i + 1]; | 2228 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2229 | prules.BurstRate = (float)tempf; | ||
2215 | break; | 2230 | break; |
2216 | 2231 | ||
2217 | case (int)LSL_BaseClass.PSYS_SRC_BURST_PART_COUNT: | 2232 | case (int)LSL_BaseClass.PSYS_SRC_BURST_PART_COUNT: |
2218 | prules.BurstPartCount = (byte)rules.Data[i + 1]; | 2233 | prules.BurstPartCount = (byte)Convert.ToByte(rules.Data[i + 1].ToString()); |
2219 | break; | 2234 | break; |
2220 | 2235 | ||
2221 | case (int)LSL_BaseClass.PSYS_SRC_BURST_RADIUS: | 2236 | case (int)LSL_BaseClass.PSYS_SRC_BURST_RADIUS: |
2222 | prules.BurstRadius = (float)rules.Data[i + 1]; | 2237 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2238 | prules.BurstRadius = (float)tempf; | ||
2223 | break; | 2239 | break; |
2224 | 2240 | ||
2225 | case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MIN: | 2241 | case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MIN: |
2226 | prules.BurstSpeedMin = (float)rules.Data[i + 1]; | 2242 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2243 | prules.BurstSpeedMin = (float)tempf; | ||
2227 | break; | 2244 | break; |
2228 | 2245 | ||
2229 | case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MAX: | 2246 | case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MAX: |
2230 | prules.BurstSpeedMax = (float)rules.Data[i + 1]; | 2247 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2248 | prules.BurstSpeedMax = (float)tempf; | ||
2231 | break; | 2249 | break; |
2232 | 2250 | ||
2233 | case (int)LSL_BaseClass.PSYS_SRC_MAX_AGE: | 2251 | case (int)LSL_BaseClass.PSYS_SRC_MAX_AGE: |
2234 | prules.MaxAge = (float)rules.Data[i + 1]; | 2252 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2253 | prules.MaxAge = (float)tempf; | ||
2235 | break; | 2254 | break; |
2236 | 2255 | ||
2237 | case (int)LSL_BaseClass.PSYS_SRC_TARGET_KEY: | 2256 | case (int)LSL_BaseClass.PSYS_SRC_TARGET_KEY: |
@@ -2248,16 +2267,21 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2248 | break; | 2267 | break; |
2249 | 2268 | ||
2250 | case (int)LSL_BaseClass.PSYS_SRC_ANGLE_BEGIN: | 2269 | case (int)LSL_BaseClass.PSYS_SRC_ANGLE_BEGIN: |
2251 | prules.InnerAngle = (float)rules.Data[i + 1]; | 2270 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2271 | prules.InnerAngle = (float)tempf; | ||
2252 | break; | 2272 | break; |
2253 | 2273 | ||
2254 | case (int)LSL_BaseClass.PSYS_SRC_ANGLE_END: | 2274 | case (int)LSL_BaseClass.PSYS_SRC_ANGLE_END: |
2255 | prules.OuterAngle = (float)rules.Data[i + 1]; | 2275 | tempf = Convert.ToSingle(rules.Data[i + 1].ToString()); |
2276 | prules.OuterAngle = (float)tempf; | ||
2256 | break; | 2277 | break; |
2257 | } | 2278 | } |
2258 | } | ||
2259 | 2279 | ||
2280 | } | ||
2281 | prules.CRC = 1; | ||
2282 | OpenSim.Framework.Console.MainLog.Instance.Verbose("PARTICLE", "PS: " + prules.ToString()); | ||
2260 | m_host.AddNewParticleSystem(prules); | 2283 | m_host.AddNewParticleSystem(prules); |
2284 | m_host.SendFullUpdateToAllClients(); | ||
2261 | } | 2285 | } |
2262 | 2286 | ||
2263 | public void llGroundRepel(double height, int water, double tau) | 2287 | public void llGroundRepel(double height, int water, double tau) |