From 8205fe79ceaeebd31509a044005bf27d226dbe07 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sun, 22 Apr 2012 19:51:51 +0100
Subject: Fix bug where setting phantom on a prim would result in a server log
message rather than setting phantom.
This was an oversight when removing some race conditions from PhysicsActor setting recently.
Regression tests extended to probe this code path.
Extending regression tests required implementation of a BasicPhysicsPrim (there was none before). However, BasicPhysics plugin is still of no current practical use other than to fill in as a component for other parts of regression testing.
---
.../BasicPhysicsPlugin/BasicPhysicsScene.cs | 41 ++++++++++++----------
1 file changed, 23 insertions(+), 18 deletions(-)
(limited to 'OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs')
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
index 2e14216..f5826ed 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
@@ -34,9 +34,17 @@ using OpenSim.Region.Physics.Manager;
namespace OpenSim.Region.Physics.BasicPhysicsPlugin
{
+ ///
+ /// This is an incomplete extremely basic physics implementation
+ ///
+ ///
+ /// Not useful for anything at the moment apart from some regression testing in other components where some form
+ /// of physics plugin is needed.
+ ///
public class BasicScene : PhysicsScene
{
private List _actors = new List();
+ private List _prims = new List();
private float[] _heightMap;
//protected internal string sceneIdentifier;
@@ -50,10 +58,19 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
{
}
- public override void Dispose()
+ public override void Dispose() {}
+
+ public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
+ Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
{
+ BasicPhysicsPrim prim = new BasicPhysicsPrim(primName, localid, position, size, rotation, pbs);
+ prim.IsPhysical = isPhysical;
+
+ _prims.Add(prim);
+ return prim;
}
+
public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
{
BasicActor act = new BasicActor(size);
@@ -63,30 +80,18 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
return act;
}
- public override void RemovePrim(PhysicsActor prim)
+ public override void RemovePrim(PhysicsActor actor)
{
+ BasicPhysicsPrim prim = (BasicPhysicsPrim)actor;
+ if (_prims.Contains(prim))
+ _prims.Remove(prim);
}
public override void RemoveAvatar(PhysicsActor actor)
{
- BasicActor act = (BasicActor) actor;
+ BasicActor act = (BasicActor)actor;
if (_actors.Contains(act))
- {
_actors.Remove(act);
- }
- }
-
-/*
- public override PhysicsActor AddPrim(Vector3 position, Vector3 size, Quaternion rotation)
- {
- return null;
- }
-*/
-
- public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
- Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
- {
- return null;
}
public override void AddPhysicsActorTaint(PhysicsActor prim)
--
cgit v1.1