only add a prim to physics in PhysicsShapeType if changing from type none. when viewers change ExtraPhysics parameters, send back the new values.
parent
7c4f2b048f
commit
9480da06b9
|
@ -2920,7 +2920,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
m_log.Error("Unable to send part Physics Proprieties - exception: " + ex.ToString());
|
||||
}
|
||||
part.UpdatePhysRequired = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1660,7 +1660,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (part != null)
|
||||
{
|
||||
part.UpdateExtraPhysics(PhysData);
|
||||
if (part.UpdatePhysRequired && remoteClient != null)
|
||||
if (remoteClient != null)
|
||||
remoteClient.SendPartPhysicsProprieties(part);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1222,7 +1222,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
public UpdateRequired UpdateFlag { get; set; }
|
||||
public bool UpdatePhysRequired { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used for media on a prim.
|
||||
|
@ -1637,7 +1636,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if(ParentGroup != null)
|
||||
ParentGroup.HasGroupChanged = true;
|
||||
ScheduleFullUpdateIfNone();
|
||||
UpdatePhysRequired = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1748,29 +1746,22 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
ParentGroup.Scene.RemovePhysicalPrim(1);
|
||||
RemoveFromPhysics();
|
||||
Stop();
|
||||
// Stop();
|
||||
}
|
||||
}
|
||||
else if (PhysActor == null)
|
||||
{
|
||||
if(oldv == (byte)PhysShapeType.none)
|
||||
{
|
||||
ApplyPhysics((uint)Flags, VolumeDetectActive, false);
|
||||
UpdatePhysicsSubscribedEvents();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PhysActor.PhysicsShapeType = m_physicsShapeType;
|
||||
// if (Shape.SculptEntry)
|
||||
// CheckSculptAndLoad();
|
||||
}
|
||||
|
||||
if (ParentGroup != null)
|
||||
ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
if (m_physicsShapeType != value)
|
||||
{
|
||||
UpdatePhysRequired = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1782,8 +1773,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (value >=1 && value <= 22587.0)
|
||||
{
|
||||
m_density = value;
|
||||
UpdatePhysRequired = true;
|
||||
}
|
||||
|
||||
ScheduleFullUpdateIfNone();
|
||||
|
||||
|
@ -1792,7 +1781,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
PhysicsActor pa = PhysActor;
|
||||
if (pa != null)
|
||||
pa.Density = Density;
|
||||
pa.Density = m_density;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1804,8 +1794,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if( value >= -1 && value <=28.0f)
|
||||
{
|
||||
m_gravitymod = value;
|
||||
UpdatePhysRequired = true;
|
||||
}
|
||||
|
||||
ScheduleFullUpdateIfNone();
|
||||
|
||||
|
@ -1814,7 +1802,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
PhysicsActor pa = PhysActor;
|
||||
if (pa != null)
|
||||
pa.GravModifier = GravityModifier;
|
||||
pa.GravModifier = m_gravitymod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1826,8 +1815,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (value >= 0 && value <= 255.0f)
|
||||
{
|
||||
m_friction = value;
|
||||
UpdatePhysRequired = true;
|
||||
}
|
||||
|
||||
ScheduleFullUpdateIfNone();
|
||||
|
||||
|
@ -1836,7 +1823,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
PhysicsActor pa = PhysActor;
|
||||
if (pa != null)
|
||||
pa.Friction = Friction;
|
||||
pa.Friction = m_friction;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1848,8 +1836,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (value >= 0 && value <= 1.0f)
|
||||
{
|
||||
m_bounce = value;
|
||||
UpdatePhysRequired = true;
|
||||
}
|
||||
|
||||
ScheduleFullUpdateIfNone();
|
||||
|
||||
|
@ -1858,7 +1844,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
PhysicsActor pa = PhysActor;
|
||||
if (pa != null)
|
||||
pa.Restitution = Restitution;
|
||||
pa.Restitution = m_bounce;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4541,24 +4528,24 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public void UpdateExtraPhysics(ExtraPhysicsData physdata)
|
||||
{
|
||||
if (physdata.PhysShapeType == PhysShapeType.invalid || ParentGroup == null)
|
||||
return;
|
||||
|
||||
if (PhysicsShapeType != (byte)physdata.PhysShapeType)
|
||||
{
|
||||
PhysicsShapeType = (byte)physdata.PhysShapeType;
|
||||
|
||||
}
|
||||
byte newtype = (byte)physdata.PhysShapeType;
|
||||
if (PhysicsShapeType != newtype)
|
||||
PhysicsShapeType = newtype;
|
||||
|
||||
if(Density != physdata.Density)
|
||||
Density = physdata.Density;
|
||||
|
||||
if(GravityModifier != physdata.GravitationModifier)
|
||||
GravityModifier = physdata.GravitationModifier;
|
||||
|
||||
if(Friction != physdata.Friction)
|
||||
Friction = physdata.Friction;
|
||||
|
||||
if(Restitution != physdata.Bounce)
|
||||
Restitution = physdata.Bounce;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue