diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 174 |
1 files changed, 174 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 2b06e3d..103ffff 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -1161,6 +1161,106 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
1161 | } | 1161 | } |
1162 | } | 1162 | } |
1163 | 1163 | ||
1164 | public void SetGlow(SceneObjectPart part, int face, float glow) | ||
1165 | { | ||
1166 | LLObject.TextureEntry tex = part.Shape.Textures; | ||
1167 | if (face > -1) | ||
1168 | { | ||
1169 | tex.CreateFace((uint)face); | ||
1170 | tex.FaceTextures[face].Glow = glow; | ||
1171 | part.UpdateTexture(tex); | ||
1172 | return; | ||
1173 | } | ||
1174 | else if (face == -1) | ||
1175 | { | ||
1176 | for (uint i = 0; i < 32; i++) | ||
1177 | { | ||
1178 | if (tex.FaceTextures[i] != null) | ||
1179 | { | ||
1180 | tex.FaceTextures[i].Glow = glow; | ||
1181 | } | ||
1182 | tex.DefaultTexture.Glow = glow; | ||
1183 | } | ||
1184 | part.UpdateTexture(tex); | ||
1185 | return; | ||
1186 | } | ||
1187 | } | ||
1188 | |||
1189 | public void SetShiny(SceneObjectPart part, int face, int shiny, Bumpiness bump) | ||
1190 | { | ||
1191 | |||
1192 | Shininess sval = new Shininess(); | ||
1193 | |||
1194 | switch (shiny) | ||
1195 | { | ||
1196 | case 0: | ||
1197 | sval = Shininess.None; | ||
1198 | break; | ||
1199 | case 1: | ||
1200 | sval = Shininess.Low; | ||
1201 | break; | ||
1202 | case 2: | ||
1203 | sval = Shininess.Medium; | ||
1204 | break; | ||
1205 | case 3: | ||
1206 | sval = Shininess.High; | ||
1207 | break; | ||
1208 | default: | ||
1209 | sval = Shininess.None; | ||
1210 | break; | ||
1211 | } | ||
1212 | |||
1213 | LLObject.TextureEntry tex = part.Shape.Textures; | ||
1214 | if (face > -1) | ||
1215 | { | ||
1216 | tex.CreateFace((uint)face); | ||
1217 | tex.FaceTextures[face].Shiny = sval; | ||
1218 | tex.FaceTextures[face].Bump = bump; | ||
1219 | part.UpdateTexture(tex); | ||
1220 | return; | ||
1221 | } | ||
1222 | else if (face == -1) | ||
1223 | { | ||
1224 | for (uint i = 0; i < 32; i++) | ||
1225 | { | ||
1226 | if (tex.FaceTextures[i] != null) | ||
1227 | { | ||
1228 | tex.FaceTextures[i].Shiny = sval; | ||
1229 | tex.FaceTextures[i].Bump = bump; ; | ||
1230 | } | ||
1231 | tex.DefaultTexture.Shiny = sval; | ||
1232 | tex.DefaultTexture.Bump = bump; | ||
1233 | } | ||
1234 | part.UpdateTexture(tex); | ||
1235 | return; | ||
1236 | } | ||
1237 | } | ||
1238 | |||
1239 | public void SetFullBright(SceneObjectPart part, int face, bool bright) | ||
1240 | { | ||
1241 | LLObject.TextureEntry tex = part.Shape.Textures; | ||
1242 | if (face > -1) | ||
1243 | { | ||
1244 | tex.CreateFace((uint)face); | ||
1245 | tex.FaceTextures[face].Fullbright = bright; | ||
1246 | part.UpdateTexture(tex); | ||
1247 | return; | ||
1248 | } | ||
1249 | else if (face == -1) | ||
1250 | { | ||
1251 | for (uint i = 0; i < 32; i++) | ||
1252 | { | ||
1253 | if (tex.FaceTextures[i] != null) | ||
1254 | { | ||
1255 | tex.FaceTextures[i].Fullbright = bright; | ||
1256 | } | ||
1257 | } | ||
1258 | tex.DefaultTexture.Fullbright = bright; | ||
1259 | part.UpdateTexture(tex); | ||
1260 | return; | ||
1261 | } | ||
1262 | } | ||
1263 | |||
1164 | public double llGetAlpha(int face) | 1264 | public double llGetAlpha(int face) |
1165 | { | 1265 | { |
1166 | m_host.AddScriptLPS(1); | 1266 | m_host.AddScriptLPS(1); |
@@ -5773,6 +5873,80 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
5773 | SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); | 5873 | SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); |
5774 | 5874 | ||
5775 | break; | 5875 | break; |
5876 | case (int)BuiltIn_Commands_BaseClass.PRIM_GLOW: | ||
5877 | if (remain < 2) | ||
5878 | return; | ||
5879 | face = Convert.ToInt32(rules.Data[idx++]); | ||
5880 | float glow = (float)Convert.ToDouble(rules.Data[idx++]); | ||
5881 | |||
5882 | SetGlow(part, face, glow); | ||
5883 | |||
5884 | break; | ||
5885 | case (int)BuiltIn_Commands_BaseClass.PRIM_BUMP_SHINY: | ||
5886 | if (remain < 3) | ||
5887 | return; | ||
5888 | face = Convert.ToInt32(rules.Data[idx++]); | ||
5889 | int shiny = Convert.ToInt32(rules.Data[idx++]); | ||
5890 | Bumpiness bump = (Bumpiness)Convert.ToByte(rules.Data[idx++]); | ||
5891 | |||
5892 | SetShiny(part, face, shiny, bump); | ||
5893 | |||
5894 | break; | ||
5895 | case (int)BuiltIn_Commands_BaseClass.PRIM_FULLBRIGHT: | ||
5896 | if (remain < 2) | ||
5897 | return; | ||
5898 | face = Convert.ToInt32(rules.Data[idx++]); | ||
5899 | string bv = rules.Data[idx++].ToString(); | ||
5900 | bool st; | ||
5901 | if (bv.Equals("1")) | ||
5902 | st = true; | ||
5903 | else | ||
5904 | st = false; | ||
5905 | |||
5906 | SetFullBright(part, face, st); | ||
5907 | break; | ||
5908 | case (int)BuiltIn_Commands_BaseClass.PRIM_MATERIAL: | ||
5909 | if (remain < 1) | ||
5910 | return; | ||
5911 | if (part != null) | ||
5912 | { | ||
5913 | /* Unhandled at this time - sends "Unhandled" message | ||
5914 | will enable when available | ||
5915 | byte material = (byte)Convert.ToByte( rules.Data[idx++]); | ||
5916 | part.Material = material; | ||
5917 | */ | ||
5918 | return; | ||
5919 | } | ||
5920 | break; | ||
5921 | case (int)BuiltIn_Commands_BaseClass.PRIM_PHANTOM: | ||
5922 | if (remain < 1) | ||
5923 | return; | ||
5924 | |||
5925 | string ph = rules.Data[idx++].ToString(); | ||
5926 | bool phantom; | ||
5927 | |||
5928 | if (ph.Equals("1")) | ||
5929 | phantom = true; | ||
5930 | else | ||
5931 | phantom = false; | ||
5932 | |||
5933 | part.ScriptSetPhantomStatus(phantom); | ||
5934 | part.ScheduleFullUpdate(); | ||
5935 | break; | ||
5936 | case (int)BuiltIn_Commands_BaseClass.PRIM_PHYSICS: | ||
5937 | if (remain < 1) | ||
5938 | return; | ||
5939 | string phy = rules.Data[idx++].ToString(); | ||
5940 | bool physics; | ||
5941 | |||
5942 | if (phy.Equals("1")) | ||
5943 | physics = true; | ||
5944 | else | ||
5945 | physics = false; | ||
5946 | |||
5947 | m_host.ScriptSetPhysicsStatus(physics); | ||
5948 | part.ScheduleFullUpdate(); | ||
5949 | break; | ||
5776 | } | 5950 | } |
5777 | } | 5951 | } |
5778 | } | 5952 | } |