Glue code for a couple of new LSL function implementations

mysql-performance
Melanie 2009-12-22 00:26:12 +00:00
parent 1fe8a1beaf
commit e530180c1e
13 changed files with 237 additions and 5 deletions

View File

@ -1735,6 +1735,45 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void rotLookAt(Quaternion target, float strength, float damping)
{
SceneObjectPart rootpart = m_rootPart;
if (rootpart != null)
{
if (IsAttachment)
{
/*
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
if (avatar != null)
{
Rotate the Av?
} */
}
else
{
if (rootpart.PhysActor != null)
{
rootpart.PhysActor.APIDTarget = new Quaternion(target.X, target.Y, target.Z, target.W);
rootpart.PhysActor.APIDStrength = strength;
rootpart.PhysActor.APIDDamping = damping;
rootpart.PhysActor.APIDActive = true;
}
}
}
}
public void stopLookAt()
{
SceneObjectPart rootpart = m_rootPart;
if (rootpart != null)
{
if (rootpart.PhysActor != null)
{
rootpart.PhysActor.APIDActive = false;
}
}
}
/// <summary>
/// Uses a PID to attempt to clamp the object on the Z axis at the given height over tau seconds.
/// </summary>

View File

@ -2186,6 +2186,11 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleFullUpdate();
}
public void RotLookAt(Quaternion target, float strength, float damping)
{
m_parentGroup.rotLookAt(target, strength, damping);
}
/// <summary>
/// Schedules this prim for a full update
/// </summary>
@ -2669,6 +2674,13 @@ namespace OpenSim.Region.Framework.Scenes
ScheduleFullUpdate();
}
public void StopLookAt()
{
m_parentGroup.stopLookAt();
m_parentGroup.ScheduleGroupForTerseUpdate();
}
/// <summary>
/// Set the text displayed for this part.
/// </summary>

View File

@ -303,6 +303,26 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
set { return; }
}
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{
}

View File

@ -620,6 +620,27 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
set { return; }
}
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
/// <summary>
/// Adds the force supplied to the Target Velocity
/// The PID controller takes this target velocity and tries to make it a reality

View File

@ -565,6 +565,10 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
public override PIDHoverType PIDHoverType { set { m_PIDHoverType = value; } }
public override float PIDHoverTau { set { m_PIDHoverTau = value; } }
public override Quaternion APIDTarget { set { return; } }
public override bool APIDActive { set { return; } }
public override float APIDStrength { set { return; } }
public override float APIDDamping { set { return; } }
public override void AddForce(Vector3 force, bool pushforce)
{

View File

@ -1238,6 +1238,26 @@ namespace OpenSim.Region.Physics.BulletXPlugin
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override OpenMetaverse.Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{

View File

@ -243,6 +243,11 @@ namespace OpenSim.Region.Physics.Manager
public abstract PIDHoverType PIDHoverType { set;}
public abstract float PIDHoverTau { set;}
// For RotLookAt
public abstract Quaternion APIDTarget { set;}
public abstract bool APIDActive { set;}
public abstract float APIDStrength { set;}
public abstract float APIDDamping { set;}
public abstract void AddForce(Vector3 force, bool pushforce);
public abstract void AddAngularForce(Vector3 force, bool pushforce);
@ -477,6 +482,11 @@ namespace OpenSim.Region.Physics.Manager
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override Quaternion APIDTarget { set { return; } }
public override bool APIDActive { set { return; } }
public override float APIDStrength { set { return; } }
public override float APIDDamping { set { return; } }
public override void SetMomentum(Vector3 momentum)
{
}

View File

@ -1197,6 +1197,15 @@ namespace OpenSim.Region.Physics.OdePlugin
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override Quaternion APIDTarget{ set { return; } }
public override bool APIDActive{ set { return; } }
public override float APIDStrength{ set { return; } }
public override float APIDDamping{ set { return; } }
public override void SubscribeEvents(int ms)
{
m_requestedUpdateFrequency = ms;

View File

@ -2828,6 +2828,15 @@ Console.WriteLine(" JointCreateFixed");
public override PIDHoverType PIDHoverType { set { m_PIDHoverType = value; } }
public override float PIDHoverTau { set { m_PIDHoverTau = value; } }
public override Quaternion APIDTarget{ set { return; } }
public override bool APIDActive{ set { return; } }
public override float APIDStrength{ set { return; } }
public override float APIDDamping{ set { return; } }
private void createAMotor(Vector3 axis)
{
if (Body == IntPtr.Zero)

View File

@ -305,6 +305,27 @@ namespace OpenSim.Region.Physics.POSPlugin
set { return; }
}
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{
}

View File

@ -300,6 +300,27 @@ namespace OpenSim.Region.Physics.POSPlugin
set { return; }
}
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{
}

View File

@ -499,6 +499,28 @@ namespace OpenSim.Region.Physics.PhysXPlugin
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{
@ -781,6 +803,28 @@ namespace OpenSim.Region.Physics.PhysXPlugin
public override PIDHoverType PIDHoverType { set { return; } }
public override float PIDHoverTau { set { return; } }
public override Quaternion APIDTarget
{
set { return; }
}
public override bool APIDActive
{
set { return; }
}
public override float APIDStrength
{
set { return; }
}
public override float APIDDamping
{
set { return; }
}
public override void SubscribeEvents(int ms)
{

View File

@ -2724,7 +2724,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llStopLookAt()
{
m_host.AddScriptLPS(1);
NotImplemented("llStopLookAt");
// NotImplemented("llStopLookAt");
m_host.StopLookAt();
}
public void llSetTimerEvent(double sec)
@ -3071,7 +3072,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llRotLookAt(LSL_Rotation target, double strength, double damping)
{
m_host.AddScriptLPS(1);
NotImplemented("llRotLookAt");
// NotImplemented("llRotLookAt");
m_host.RotLookAt(Rot2Quaternion(target), (float)strength, (float)damping);
}
public LSL_Integer llStringLength(string str)