aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-04-11 12:49:00 +0000
committerMW2007-04-11 12:49:00 +0000
commit2f3b6c4b1060a574263c4be114cb33d505ac6e71 (patch)
treed0e47a1343034945f4830da2b345788f04f512d3
parent* ignoring some binaries (diff)
downloadopensim-SC_OLD-2f3b6c4b1060a574263c4be114cb33d505ac6e71.zip
opensim-SC_OLD-2f3b6c4b1060a574263c4be114cb33d505ac6e71.tar.gz
opensim-SC_OLD-2f3b6c4b1060a574263c4be114cb33d505ac6e71.tar.bz2
opensim-SC_OLD-2f3b6c4b1060a574263c4be114cb33d505ac6e71.tar.xz
small improvement to the jvm and test script
-rw-r--r--OpenSim.RegionServer/world/WorldScripting.cs1
-rw-r--r--OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs24
-rw-r--r--bin/script1.txt16
3 files changed, 39 insertions, 2 deletions
diff --git a/OpenSim.RegionServer/world/WorldScripting.cs b/OpenSim.RegionServer/world/WorldScripting.cs
index 83838b4..2f85869 100644
--- a/OpenSim.RegionServer/world/WorldScripting.cs
+++ b/OpenSim.RegionServer/world/WorldScripting.cs
@@ -92,6 +92,7 @@ namespace OpenSim.world
92 { 92 {
93 LLVector3 pos = entity.Pos; 93 LLVector3 pos = entity.Pos;
94 pos.X = x; 94 pos.X = x;
95 pos.Y = y;
95 Primitive prim = entity as Primitive; 96 Primitive prim = entity as Primitive;
96 // Of course, we really should have asked the physEngine if this is possible, and if not, returned false. 97 // Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
97 prim.UpdatePosition(pos); 98 prim.UpdatePosition(pos);
diff --git a/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs b/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs
index 8c895af..3b7da35 100644
--- a/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs
+++ b/OpenSim.Scripting.EmbeddedJVM/InterpreterLogic.cs
@@ -90,6 +90,20 @@ namespace OpenSim.Scripting.EmbeddedJVM
90 this._mThread.PC += 2; 90 this._mThread.PC += 2;
91 result = true; 91 result = true;
92 break; 92 break;
93 case 23:
94 short findex1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]));
95 Float fload = new Float();
96 if (this._mThread.currentFrame.LocalVariables[findex1] != null)
97 {
98 if (this._mThread.currentFrame.LocalVariables[findex1] is Float)
99 {
100 fload.mValue = ((Float)this._mThread.currentFrame.LocalVariables[findex1]).mValue;
101 this._mThread.currentFrame.OpStack.Push(fload);
102 }
103 }
104 this._mThread.PC++;
105 result = true;
106 break;
93 case 26: 107 case 26:
94 if (this._mThread.currentFrame.LocalVariables[0] != null) 108 if (this._mThread.currentFrame.LocalVariables[0] != null)
95 { 109 {
@@ -162,6 +176,16 @@ namespace OpenSim.Scripting.EmbeddedJVM
162 } 176 }
163 result = true; 177 result = true;
164 break; 178 break;
179 case 56:
180 short findex = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] ));
181 BaseType fstor = this._mThread.currentFrame.OpStack.Pop();
182 if (fstor is Float)
183 {
184 this._mThread.currentFrame.LocalVariables[findex] = (Float)fstor;
185 }
186 this._mThread.PC++;
187 result = true;
188 break;
165 case 59: 189 case 59:
166 BaseType baset = this._mThread.currentFrame.OpStack.Pop(); 190 BaseType baset = this._mThread.currentFrame.OpStack.Pop();
167 if (baset is Int) 191 if (baset is Int)
diff --git a/bin/script1.txt b/bin/script1.txt
index dd67c50..63780c2 100644
--- a/bin/script1.txt
+++ b/bin/script1.txt
@@ -7,7 +7,9 @@
7 int avid = OpenSimAPI.GetRandomAvatarID(); 7 int avid = OpenSimAPI.GetRandomAvatarID();
8 float x = OpenSimAPI.GetEntityPositionX(own); 8 float x = OpenSimAPI.GetEntityPositionX(own);
9 float avx = OpenSimAPI.GetEntityPositionX(avid); 9 float avx = OpenSimAPI.GetEntityPositionX(avid);
10 10 float y = OpenSimAPI.GetEntityPositionY(own);
11 float avy = OpenSimAPI.GetEntityPositionY(avid);
12
11 if(x> avx) 13 if(x> avx)
12 { 14 {
13 x = x -1f; 15 x = x -1f;
@@ -16,7 +18,17 @@
16 { 18 {
17 x = x+ 1f; 19 x = x+ 1f;
18 } 20 }
19 OpenSimAPI.SetEntityPosition(own, x, 0, 0); 21
22 if(y > avy)
23 {
24 y= y -1f;
25 }
26 else
27 {
28 y = y +1f;
29 }
30
31 OpenSimAPI.SetEntityPosition(own, x, y, 0);
20 } 32 }
21 33
22}</Script> \ No newline at end of file 34}</Script> \ No newline at end of file