Add implementations for llSetVelocity and llSetAngularVelocity.

cpu-performance
Robert Adams 2013-07-06 09:53:30 -07:00
parent a65cec3986
commit d838f15d97
3 changed files with 38 additions and 0 deletions

View File

@ -2382,6 +2382,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return force;
}
public void llSetVelocity(LSL_Vector velocity, int local)
{
m_host.AddScriptLPS(1);
if (!m_host.ParentGroup.IsDeleted)
{
if (local != 0)
velocity *= llGetRot();
m_host.ParentGroup.RootPart.Velocity = velocity;
}
}
public void llSetAngularVelocity(LSL_Vector angularVelocity, int local)
{
m_host.AddScriptLPS(1);
if (!m_host.ParentGroup.IsDeleted)
{
if (local != 0)
angularVelocity *= llGetRot();
m_host.ParentGroup.RootPart.AngularVelocity = angularVelocity;
}
}
public LSL_Integer llTarget(LSL_Vector position, double range)
{
m_host.AddScriptLPS(1);

View File

@ -342,6 +342,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llSetDamage(double damage);
void llSetForce(LSL_Vector force, int local);
void llSetForceAndTorque(LSL_Vector force, LSL_Vector torque, int local);
void llSetVelocity(LSL_Vector velocity, int local);
void llSetAngularVelocity(LSL_Vector angularVelocity, int local);
void llSetHoverHeight(double height, int water, double tau);
void llSetInventoryPermMask(string item, int mask, int value);
void llSetLinkAlpha(int linknumber, double alpha, int face);

View File

@ -1548,6 +1548,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llSetForceAndTorque(force, torque, local);
}
public void llSetVelocity(LSL_Vector force, int local)
{
m_LSL_Functions.llSetVelocity(force, local);
}
public void llSetAngularVelocity(LSL_Vector force, int local)
{
m_LSL_Functions.llSetAngularVelocity(force, local);
}
public void llSetHoverHeight(double height, int water, double tau)
{
m_LSL_Functions.llSetHoverHeight(height, water, tau);