diff options
author | Robert Adams | 2015-09-08 04:54:16 -0700 |
---|---|---|
committer | Robert Adams | 2015-09-08 04:54:16 -0700 |
commit | e5367d822be9b05e74c859afe2d2956a3e95aa33 (patch) | |
tree | e904050a30715df587aa527d7f313755177726a7 /OpenSim/Region/PhysicsModules/POS/POSScene.cs | |
parent | add lost admin_reset_land method (diff) | |
parent | Deleted access control spec from [LoginService] section of standalone config.... (diff) | |
download | opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.zip opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.gz opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.bz2 opensim-SC-e5367d822be9b05e74c859afe2d2956a3e95aa33.tar.xz |
Merge of ubitworkvarnew with opensim/master as of 20150905.
This integrates the OpenSim refactoring to make physics, etc into modules.
AVN physics hasn't been moved to new location.
Does not compile yet.
Merge branch 'osmaster' into mbworknew1
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/POS/POSScene.cs (renamed from OpenSim/Region/Physics/POSPlugin/POSScene.cs) | 66 |
1 files changed, 58 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/POSPlugin/POSScene.cs b/OpenSim/Region/PhysicsModules/POS/POSScene.cs index 061304a..e6bcbf2 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSScene.cs +++ b/OpenSim/Region/PhysicsModules/POS/POSScene.cs | |||
@@ -29,31 +29,81 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using Nini.Config; | 30 | using Nini.Config; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using Mono.Addins; | ||
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
33 | using OpenSim.Region.Physics.Manager; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | using OpenSim.Region.Framework.Scenes; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
34 | 37 | ||
35 | namespace OpenSim.Region.Physics.POSPlugin | 38 | namespace OpenSim.Region.PhysicsModule.POS |
36 | { | 39 | { |
37 | public class POSScene : PhysicsScene | 40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "POSPhysicsScene")] |
41 | public class POSScene : PhysicsScene, INonSharedRegionModule | ||
38 | { | 42 | { |
39 | private List<POSCharacter> _characters = new List<POSCharacter>(); | 43 | private List<POSCharacter> _characters = new List<POSCharacter>(); |
40 | private List<POSPrim> _prims = new List<POSPrim>(); | 44 | private List<POSPrim> _prims = new List<POSPrim>(); |
41 | private float[] _heightMap; | 45 | private float[] _heightMap; |
42 | private const float gravity = -9.8f; | 46 | private const float gravity = -9.8f; |
43 | 47 | ||
48 | private bool m_Enabled = false; | ||
44 | //protected internal string sceneIdentifier; | 49 | //protected internal string sceneIdentifier; |
45 | 50 | ||
46 | public POSScene(string engineType, String _sceneIdentifier) | 51 | #region INonSharedRegionModule |
52 | public string Name | ||
47 | { | 53 | { |
48 | EngineType = engineType; | 54 | get { return "POS"; } |
49 | Name = EngineType + "/" + _sceneIdentifier; | ||
50 | //sceneIdentifier = _sceneIdentifier; | ||
51 | } | 55 | } |
52 | 56 | ||
53 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 57 | public Type ReplaceableInterface |
54 | { | 58 | { |
59 | get { return null; } | ||
55 | } | 60 | } |
56 | 61 | ||
62 | public void Initialise(IConfigSource source) | ||
63 | { | ||
64 | // TODO: Move this out of Startup | ||
65 | IConfig config = source.Configs["Startup"]; | ||
66 | if (config != null) | ||
67 | { | ||
68 | string physics = config.GetString("physics", string.Empty); | ||
69 | if (physics == Name) | ||
70 | m_Enabled = true; | ||
71 | } | ||
72 | |||
73 | } | ||
74 | |||
75 | public void Close() | ||
76 | { | ||
77 | } | ||
78 | |||
79 | public void AddRegion(Scene scene) | ||
80 | { | ||
81 | if (!m_Enabled) | ||
82 | return; | ||
83 | |||
84 | EngineType = Name; | ||
85 | PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName; | ||
86 | |||
87 | scene.RegisterModuleInterface<PhysicsScene>(this); | ||
88 | base.Initialise(scene.PhysicsRequestAsset, | ||
89 | (scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[Constants.RegionSize * Constants.RegionSize]), | ||
90 | (float)scene.RegionInfo.RegionSettings.WaterHeight); | ||
91 | |||
92 | } | ||
93 | |||
94 | public void RemoveRegion(Scene scene) | ||
95 | { | ||
96 | if (!m_Enabled) | ||
97 | return; | ||
98 | } | ||
99 | |||
100 | public void RegionLoaded(Scene scene) | ||
101 | { | ||
102 | if (!m_Enabled) | ||
103 | return; | ||
104 | } | ||
105 | #endregion | ||
106 | |||
57 | public override void Dispose() | 107 | public override void Dispose() |
58 | { | 108 | { |
59 | } | 109 | } |