add high level code suport for SetHoverHeight() called from a attachment, so in future physics engines can also suport it
parent
d281ec5342
commit
4a2e6db344
|
@ -2579,7 +2579,15 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <param name="tau">Number of seconds over which to reach target</param>
|
||||
public void SetHoverHeight(float height, PIDHoverType hoverType, float tau)
|
||||
{
|
||||
PhysicsActor pa = RootPart.PhysActor;
|
||||
PhysicsActor pa = null;
|
||||
if(IsAttachment)
|
||||
{
|
||||
ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
|
||||
if (avatar != null)
|
||||
pa = avatar.PhysicsActor;
|
||||
}
|
||||
else
|
||||
pa = RootPart.PhysActor;
|
||||
|
||||
if (pa != null)
|
||||
{
|
||||
|
|
|
@ -3942,25 +3942,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
if (m_host.PhysActor != null)
|
||||
PIDHoverType hoverType = PIDHoverType.Ground;
|
||||
if (water != 0)
|
||||
{
|
||||
PIDHoverType hoverType = PIDHoverType.Ground;
|
||||
if (water != 0)
|
||||
{
|
||||
hoverType = PIDHoverType.GroundAndWater;
|
||||
}
|
||||
|
||||
m_host.SetHoverHeight((float)height, hoverType, (float)tau);
|
||||
hoverType = PIDHoverType.GroundAndWater;
|
||||
}
|
||||
m_host.SetHoverHeight((float)height, hoverType, (float)tau);
|
||||
}
|
||||
|
||||
public void llStopHover()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
if (m_host.PhysActor != null)
|
||||
{
|
||||
m_host.SetHoverHeight(0f, PIDHoverType.Ground, 0f);
|
||||
}
|
||||
m_host.SetHoverHeight(0f, PIDHoverType.Ground, 0f);
|
||||
}
|
||||
|
||||
public void llMinEventDelay(double delay)
|
||||
|
|
Loading…
Reference in New Issue