diff options
author | Sean Dague | 2007-07-16 15:40:11 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-16 15:40:11 +0000 |
commit | 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch) | |
tree | e3f80ad51736cf17e856547b1bcf956010927434 /OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples | |
parent | *Trunk compiles now (diff) | |
download | opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2 opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz |
changed to native line ending encoding
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs b/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs index d9f1f0a..79d88b1 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/Engines/CSharpEngine/Examples/ExportRegionToLSL.cs | |||
@@ -1,70 +1,70 @@ | |||
1 | using OpenSim.Framework.Console; | 1 | using OpenSim.Framework.Console; |
2 | using OpenSim.Framework; | 2 | using OpenSim.Framework; |
3 | using OpenSim.Region.Environment; | 3 | using OpenSim.Region.Environment; |
4 | using OpenSim.Region.Environment.Scenes; | 4 | using OpenSim.Region.Environment.Scenes; |
5 | 5 | ||
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
7 | using libsecondlife; | 7 | using libsecondlife; |
8 | 8 | ||
9 | namespace OpenSim.Region.Scripting.Examples | 9 | namespace OpenSim.Region.Scripting.Examples |
10 | { | 10 | { |
11 | public class LSLExportScript : IScript | 11 | public class LSLExportScript : IScript |
12 | { | 12 | { |
13 | ScriptInfo script; | 13 | ScriptInfo script; |
14 | 14 | ||
15 | public string getName() | 15 | public string getName() |
16 | { | 16 | { |
17 | return "LSL Export Script 0.1"; | 17 | return "LSL Export Script 0.1"; |
18 | } | 18 | } |
19 | 19 | ||
20 | public void Initialise(ScriptInfo scriptInfo) | 20 | public void Initialise(ScriptInfo scriptInfo) |
21 | { | 21 | { |
22 | script = scriptInfo; | 22 | script = scriptInfo; |
23 | 23 | ||
24 | script.events.OnScriptConsole += new EventManager.OnScriptConsoleDelegate(ProcessConsoleMsg); | 24 | script.events.OnScriptConsole += new EventManager.OnScriptConsoleDelegate(ProcessConsoleMsg); |
25 | } | 25 | } |
26 | 26 | ||
27 | void ProcessConsoleMsg(string[] args) | 27 | void ProcessConsoleMsg(string[] args) |
28 | { | 28 | { |
29 | if (args[0].ToLower() == "lslexport") | 29 | if (args[0].ToLower() == "lslexport") |
30 | { | 30 | { |
31 | string sequence = ""; | 31 | string sequence = ""; |
32 | 32 | ||
33 | foreach (KeyValuePair<LLUUID, SceneObject> obj in script.world.Objects) | 33 | foreach (KeyValuePair<LLUUID, SceneObject> obj in script.world.Objects) |
34 | { | 34 | { |
35 | SceneObject root = obj.Value; | 35 | SceneObject root = obj.Value; |
36 | 36 | ||
37 | sequence += "NEWOBJ::" + obj.Key.ToStringHyphenated() + "\n"; | 37 | sequence += "NEWOBJ::" + obj.Key.ToStringHyphenated() + "\n"; |
38 | 38 | ||
39 | string rootPrim = processPrimitiveToString(root.rootPrimitive); | 39 | string rootPrim = processPrimitiveToString(root.rootPrimitive); |
40 | 40 | ||
41 | sequence += "ROOT:" + rootPrim; | 41 | sequence += "ROOT:" + rootPrim; |
42 | 42 | ||
43 | foreach (KeyValuePair<LLUUID, OpenSim.Region.Environment.Scenes.Primitive> prim in root.Children) | 43 | foreach (KeyValuePair<LLUUID, OpenSim.Region.Environment.Scenes.Primitive> prim in root.Children) |
44 | { | 44 | { |
45 | string child = processPrimitiveToString(prim.Value); | 45 | string child = processPrimitiveToString(prim.Value); |
46 | sequence += "CHILD:" + child; | 46 | sequence += "CHILD:" + child; |
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | System.Console.WriteLine(sequence); | 50 | System.Console.WriteLine(sequence); |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | string processPrimitiveToString(OpenSim.Region.Environment.Scenes.Primitive prim) | 54 | string processPrimitiveToString(OpenSim.Region.Environment.Scenes.Primitive prim) |
55 | { | 55 | { |
56 | string desc = prim.Description; | 56 | string desc = prim.Description; |
57 | string name = prim.Name; | 57 | string name = prim.Name; |
58 | LLVector3 pos = prim.Pos; | 58 | LLVector3 pos = prim.Pos; |
59 | LLVector3 rot = new LLVector3(); | 59 | LLVector3 rot = new LLVector3(); |
60 | LLVector3 scale = prim.Scale; | 60 | LLVector3 scale = prim.Scale; |
61 | LLVector3 rootPos = prim.WorldPos; | 61 | LLVector3 rootPos = prim.WorldPos; |
62 | 62 | ||
63 | string setPrimParams = ""; | 63 | string setPrimParams = ""; |
64 | 64 | ||
65 | setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n"; | 65 | setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n"; |
66 | 66 | ||
67 | return setPrimParams; | 67 | return setPrimParams; |
68 | } | 68 | } |
69 | } | 69 | } |
70 | } \ No newline at end of file | 70 | } \ No newline at end of file |