* Added proper handling of llSetStatus(STATUS_PHYSICS,BOOL)
parent
abacfba287
commit
ae9a98ceb1
|
@ -590,6 +590,53 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SetPartAsRoot(newPart);
|
SetPartAsRoot(newPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ScriptSetPhysicsStatus(bool UsePhysics)
|
||||||
|
{
|
||||||
|
if (m_scene.m_physicalPrim)
|
||||||
|
{
|
||||||
|
lock (m_parts)
|
||||||
|
{
|
||||||
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
|
{
|
||||||
|
if (UsePhysics)
|
||||||
|
part.AddFlag(LLObject.ObjectFlags.Physics);
|
||||||
|
else
|
||||||
|
part.RemFlag(LLObject.ObjectFlags.Physics);
|
||||||
|
|
||||||
|
part.DoPhysicsPropertyUpdate(UsePhysics, false);
|
||||||
|
IsSelected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ScriptSetPhantomStatus(bool PhantomStatus)
|
||||||
|
{
|
||||||
|
lock (m_parts)
|
||||||
|
{
|
||||||
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
|
{
|
||||||
|
if (PhantomStatus)
|
||||||
|
{
|
||||||
|
part.AddFlag(LLObject.ObjectFlags.Phantom);
|
||||||
|
if (part.PhysActor != null)
|
||||||
|
{
|
||||||
|
m_scene.PhysicsScene.RemovePrim(part.PhysActor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
part.RemFlag(LLObject.ObjectFlags.Phantom);
|
||||||
|
if ((part.ObjectFlags & (int)LLObject.ObjectFlags.Physics) != 0)
|
||||||
|
{
|
||||||
|
part.DoPhysicsPropertyUpdate(true, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void applyImpulse(PhysicsVector impulse)
|
public void applyImpulse(PhysicsVector impulse)
|
||||||
{
|
{
|
||||||
// We check if rootpart is null here because scripts don't delete if you delete the host.
|
// We check if rootpart is null here because scripts don't delete if you delete the host.
|
||||||
|
|
|
@ -1326,7 +1326,20 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
// System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString());
|
// System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString());
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
public void ScriptSetPhysicsStatus(bool UsePhysics)
|
||||||
|
{
|
||||||
|
if (m_parentGroup != null)
|
||||||
|
{
|
||||||
|
m_parentGroup.ScriptSetPhysicsStatus(UsePhysics);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void ScriptSetPhantomStatus(bool Phantom)
|
||||||
|
{
|
||||||
|
if (m_parentGroup != null)
|
||||||
|
{
|
||||||
|
m_parentGroup.ScriptSetPhantomStatus(Phantom);
|
||||||
|
}
|
||||||
|
}
|
||||||
public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
|
public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
|
||||||
{
|
{
|
||||||
if (PhysActor != null)
|
if (PhysActor != null)
|
||||||
|
|
|
@ -609,11 +609,18 @@ namespace OpenSim.Region.ScriptEngine.Common
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
if ((status & BuiltIn_Commands_BaseClass.STATUS_PHYSICS) == BuiltIn_Commands_BaseClass.STATUS_PHYSICS)
|
if ((status & BuiltIn_Commands_BaseClass.STATUS_PHYSICS) == BuiltIn_Commands_BaseClass.STATUS_PHYSICS)
|
||||||
{
|
{
|
||||||
m_host.AddFlag(LLObject.ObjectFlags.Physics);
|
if (value == 1)
|
||||||
|
m_host.ScriptSetPhysicsStatus(true);
|
||||||
|
else
|
||||||
|
m_host.ScriptSetPhysicsStatus(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
if ((status & BuiltIn_Commands_BaseClass.STATUS_PHANTOM) == BuiltIn_Commands_BaseClass.STATUS_PHANTOM)
|
if ((status & BuiltIn_Commands_BaseClass.STATUS_PHANTOM) == BuiltIn_Commands_BaseClass.STATUS_PHANTOM)
|
||||||
{
|
{
|
||||||
m_host.AddFlag(LLObject.ObjectFlags.Phantom);
|
if (value == 1)
|
||||||
|
m_host.ScriptSetPhantomStatus(true);
|
||||||
|
else
|
||||||
|
m_host.ScriptSetPhantomStatus(false);
|
||||||
}
|
}
|
||||||
if ((status & BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) == BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS)
|
if ((status & BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS) == BuiltIn_Commands_BaseClass.STATUS_CAST_SHADOWS)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue