small improvement to the jvm and test script
parent
a98eb51c55
commit
2f3b6c4b10
|
@ -92,6 +92,7 @@ namespace OpenSim.world
|
||||||
{
|
{
|
||||||
LLVector3 pos = entity.Pos;
|
LLVector3 pos = entity.Pos;
|
||||||
pos.X = x;
|
pos.X = x;
|
||||||
|
pos.Y = y;
|
||||||
Primitive prim = entity as Primitive;
|
Primitive prim = entity as Primitive;
|
||||||
// Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
|
// Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
|
||||||
prim.UpdatePosition(pos);
|
prim.UpdatePosition(pos);
|
||||||
|
|
|
@ -90,6 +90,20 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||||
this._mThread.PC += 2;
|
this._mThread.PC += 2;
|
||||||
result = true;
|
result = true;
|
||||||
break;
|
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:
|
case 26:
|
||||||
if (this._mThread.currentFrame.LocalVariables[0] != null)
|
if (this._mThread.currentFrame.LocalVariables[0] != null)
|
||||||
{
|
{
|
||||||
|
@ -162,6 +176,16 @@ namespace OpenSim.Scripting.EmbeddedJVM
|
||||||
}
|
}
|
||||||
result = true;
|
result = true;
|
||||||
break;
|
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:
|
case 59:
|
||||||
BaseType baset = this._mThread.currentFrame.OpStack.Pop();
|
BaseType baset = this._mThread.currentFrame.OpStack.Pop();
|
||||||
if (baset is Int)
|
if (baset is Int)
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
int avid = OpenSimAPI.GetRandomAvatarID();
|
int avid = OpenSimAPI.GetRandomAvatarID();
|
||||||
float x = OpenSimAPI.GetEntityPositionX(own);
|
float x = OpenSimAPI.GetEntityPositionX(own);
|
||||||
float avx = OpenSimAPI.GetEntityPositionX(avid);
|
float avx = OpenSimAPI.GetEntityPositionX(avid);
|
||||||
|
float y = OpenSimAPI.GetEntityPositionY(own);
|
||||||
|
float avy = OpenSimAPI.GetEntityPositionY(avid);
|
||||||
|
|
||||||
if(x> avx)
|
if(x> avx)
|
||||||
{
|
{
|
||||||
x = x -1f;
|
x = x -1f;
|
||||||
|
@ -16,7 +18,17 @@
|
||||||
{
|
{
|
||||||
x = x+ 1f;
|
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>
|
}</Script>
|
Loading…
Reference in New Issue