mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
All physics plugins are now region modules. Compiles but doesn't run.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using Mono.Addins;
|
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
@@ -56,3 +57,6 @@ using System.Runtime.InteropServices;
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.8.2.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.Region.PhysicsModule.POS", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
||||
@@ -36,29 +36,29 @@ namespace OpenSim.Region.PhysicsModule.POS
|
||||
/// <summary>
|
||||
/// for now will be a very POS physics engine
|
||||
/// </summary>
|
||||
public class POSPlugin : IPhysicsPlugin
|
||||
{
|
||||
public POSPlugin()
|
||||
{
|
||||
}
|
||||
//public class POSPlugin : IPhysicsPlugin
|
||||
//{
|
||||
// public POSPlugin()
|
||||
// {
|
||||
// }
|
||||
|
||||
public bool Init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// public bool Init()
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
public PhysicsScene GetScene(string sceneIdentifier)
|
||||
{
|
||||
return new POSScene(GetName(), sceneIdentifier);
|
||||
}
|
||||
// public PhysicsScene GetScene(string sceneIdentifier)
|
||||
// {
|
||||
// return new POSScene(GetName(), sceneIdentifier);
|
||||
// }
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return ("POS");
|
||||
}
|
||||
// public string GetName()
|
||||
// {
|
||||
// return ("POS");
|
||||
// }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
// public void Dispose()
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -29,11 +29,15 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using Mono.Addins;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.PhysicsModule.POS
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "POSPhysicsScene")]
|
||||
public class POSScene : PhysicsScene
|
||||
{
|
||||
private List<POSCharacter> _characters = new List<POSCharacter>();
|
||||
@@ -41,19 +45,61 @@ namespace OpenSim.Region.PhysicsModule.POS
|
||||
private float[] _heightMap;
|
||||
private const float gravity = -9.8f;
|
||||
|
||||
private bool m_Enabled = false;
|
||||
//protected internal string sceneIdentifier;
|
||||
|
||||
public POSScene(string engineType, String _sceneIdentifier)
|
||||
#region INonSharedRegionModule
|
||||
public string Name
|
||||
{
|
||||
EngineType = engineType;
|
||||
Name = EngineType + "/" + _sceneIdentifier;
|
||||
//sceneIdentifier = _sceneIdentifier;
|
||||
get { return "POS"; }
|
||||
}
|
||||
|
||||
public override void Initialise(IMesher meshmerizer, IConfigSource config)
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
// TODO: Move this out of Startup
|
||||
IConfig config = source.Configs["Startup"];
|
||||
if (config != null)
|
||||
{
|
||||
string physics = config.GetString("physics", string.Empty);
|
||||
if (physics == Name)
|
||||
m_Enabled = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
EngineType = Name;
|
||||
PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName;
|
||||
|
||||
scene.RegisterModuleInterface<PhysicsScene>(this);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user