small improvement to the jvm and test script

0.1-prestable
MW 2007-04-11 12:49:00 +00:00
parent a98eb51c55
commit 2f3b6c4b10
3 changed files with 39 additions and 2 deletions

View File

@ -92,6 +92,7 @@ namespace OpenSim.world
{
LLVector3 pos = entity.Pos;
pos.X = x;
pos.Y = y;
Primitive prim = entity as Primitive;
// Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
prim.UpdatePosition(pos);

View File

@ -90,6 +90,20 @@ namespace OpenSim.Scripting.EmbeddedJVM
this._mThread.PC += 2;
result = true;
break;
case 23:
short findex1 = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC]));
Float fload = new Float();
if (this._mThread.currentFrame.LocalVariables[findex1] != null)
{
if (this._mThread.currentFrame.LocalVariables[findex1] is Float)
{
fload.mValue = ((Float)this._mThread.currentFrame.LocalVariables[findex1]).mValue;
this._mThread.currentFrame.OpStack.Push(fload);
}
}
this._mThread.PC++;
result = true;
break;
case 26:
if (this._mThread.currentFrame.LocalVariables[0] != null)
{
@ -162,6 +176,16 @@ namespace OpenSim.Scripting.EmbeddedJVM
}
result = true;
break;
case 56:
short findex = (short)((GlobalMemory.MethodArea.MethodBuffer[this._mThread.PC] ));
BaseType fstor = this._mThread.currentFrame.OpStack.Pop();
if (fstor is Float)
{
this._mThread.currentFrame.LocalVariables[findex] = (Float)fstor;
}
this._mThread.PC++;
result = true;
break;
case 59:
BaseType baset = this._mThread.currentFrame.OpStack.Pop();
if (baset is Int)

View File

@ -7,7 +7,9 @@
int avid = OpenSimAPI.GetRandomAvatarID();
float x = OpenSimAPI.GetEntityPositionX(own);
float avx = OpenSimAPI.GetEntityPositionX(avid);
float y = OpenSimAPI.GetEntityPositionY(own);
float avy = OpenSimAPI.GetEntityPositionY(avid);
if(x> avx)
{
x = x -1f;
@ -16,7 +18,17 @@
{
x = x+ 1f;
}
OpenSimAPI.SetEntityPosition(own, x, 0, 0);
if(y > avy)
{
y= y -1f;
}
else
{
y = y +1f;
}
OpenSimAPI.SetEntityPosition(own, x, y, 0);
}
}</Script>