From 800081270020e60c612cee9521d18bb4388afdd5 Mon Sep 17 00:00:00 2001 From: "Teravus Ovares (Dan Olivares)" Date: Sat, 15 Aug 2009 13:10:10 -0400 Subject: [PATCH] * part one of adding physics combining --- .../CoreModules/Resources/CoreModulePlugin.addin.xml | 1 + OpenSim/Region/Physics/Manager/PhysicsScene.cs | 10 ++++++++++ OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index 8e8555944b..e38c755fcf 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml @@ -10,6 +10,7 @@ + diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 6937a25845..139f89869b 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs @@ -162,6 +162,16 @@ namespace OpenSim.Region.Physics.Manager return false; } + public virtual bool SupportsCombining() + { + return false; + } + + public virtual void Combine(PhysicsScene pScene, Vector3 offset) + { + return; + } + /// /// Queue a raycast against the physics scene. /// The provided callback method will be called when the raycast is complete diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index e435ac1e8b..81f200afdb 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -313,6 +313,9 @@ namespace OpenSim.Region.Physics.OdePlugin private volatile int m_global_contactcount = 0; + private Vector3 m_worldOffset = Vector3.Zero; + private Vector2 m_worldExtents = new Vector2((int)Constants.RegionSize, (int)Constants.RegionSize); + private ODERayCastRequestManager m_rayCastManager; /// @@ -1653,6 +1656,7 @@ namespace OpenSim.Region.Physics.OdePlugin private PhysicsActor AddPrim(String name, PhysicsVector position, PhysicsVector size, Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool isphysical) { + PhysicsVector pos = new PhysicsVector(position.X, position.Y, position.Z); //pos.X = position.X; //pos.Y = position.Y; @@ -2555,6 +2559,9 @@ namespace OpenSim.Region.Physics.OdePlugin if (framecount >= int.MaxValue) framecount = 0; + if (m_worldOffset != Vector3.Zero) + return 0; + framecount++; float fps = 0; @@ -3377,6 +3384,8 @@ namespace OpenSim.Region.Physics.OdePlugin return waterlevel; } + + public override void SetWaterLevel(float baseheight) { waterlevel = baseheight;