Merge branch 'master' into careminster

avinationmerge
Melanie 2011-12-22 19:52:59 +00:00
commit eef6f92029
5 changed files with 23 additions and 8 deletions

View File

@ -77,7 +77,15 @@ namespace OpenSim.Region.Framework.Scenes
/// Controls whether physics can be applied to prims. Even if false, prims still have entries in a
/// PhysicsScene in order to perform collision detection
/// </summary>
public bool m_physicalPrim;
public bool PhysicalPrims { get; private set; }
/// <summary>
/// Controls whether prims can be collided with.
/// </summary>
/// <remarks>
/// If this is set to false then prims cannot be subject to physics either.
/// </summary>
public bool CollidablePrims { get; private set; }
public float m_maxNonphys = 256;
public float m_maxPhys = 10;
@ -673,7 +681,8 @@ namespace OpenSim.Region.Framework.Scenes
//Animation states
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);

View File

@ -374,7 +374,6 @@ namespace OpenSim.Region.Framework.Scenes
if (rot != null)
sceneObject.UpdateGroupRotationR((Quaternion)rot);
//group.ApplyPhysics(m_physicalPrim);
if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero)
{
sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false);

View File

@ -769,7 +769,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
}
ApplyPhysics(m_scene.m_physicalPrim);
ApplyPhysics();
if (RootPart.PhysActor != null)
RootPart.Buoyancy = RootPart.Buoyancy;
@ -1564,8 +1564,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Apply physics to this group
/// </summary>
/// <param name="m_physicalPrim"></param>
public void ApplyPhysics(bool m_physicalPrim)
public void ApplyPhysics()
{
// Apply physics to the root prim
m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive);

View File

@ -1521,6 +1521,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="VolumeDetectActive"></param>
public void ApplyPhysics(uint rootObjectFlags, bool VolumeDetectActive)
{
if (!ParentGroup.Scene.CollidablePrims)
return;
// m_log.DebugFormat(
// "[SCENE OBJECT PART]: Applying physics to {0} {1}, m_physicalPrim {2}",
// Name, LocalId, UUID, m_physicalPrim);
@ -1790,7 +1793,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="isNew"></param>
public void DoPhysicsPropertyUpdate(bool UsePhysics, bool isNew)
{
if (!ParentGroup.Scene.m_physicalPrim && UsePhysics)
if (!ParentGroup.Scene.PhysicalPrims && UsePhysics)
return;
if (IsJoint())
@ -4375,7 +4378,7 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup.Scene == null)
return;
if (PhysActor == null)
if (ParentGroup.Scene.CollidablePrims && PhysActor == null)
{
// It's not phantom anymore. So make sure the physics engine get's knowledge of it
PhysActor = ParentGroup.Scene.PhysicsScene.AddPrimShape(

View File

@ -181,6 +181,11 @@
; ## PHYSICS
; ##
; If true then prims can be collided with by avatars, other prims, etc.
; If false then all prims are phantom, no matter whether their phantom flag is checked or unchecked.
; Also, no prims are subject to physics.
collidable_prim = true
; If true then prims can be made subject to physics (gravity, pushing, etc.).
; If false then physics flag can be set but it is not honoured. However, prims are still solid for the purposes of collision direction
physical_prim = true