mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +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.
|
||||
@@ -34,11 +35,11 @@ using System.Runtime.InteropServices;
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly : AssemblyTitle("BasicPhysicsPlugin")]
|
||||
[assembly : AssemblyTitle("BasicPhysicsModule")]
|
||||
[assembly : AssemblyDescription("")]
|
||||
[assembly : AssemblyConfiguration("")]
|
||||
[assembly : AssemblyCompany("http://opensimulator.org")]
|
||||
[assembly : AssemblyProduct("BasicPhysicsPlugin")]
|
||||
[assembly : AssemblyProduct("BasicPhysicsModule")]
|
||||
[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers")]
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
@@ -56,3 +57,6 @@ using System.Runtime.InteropServices;
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.8.2.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.Region.PhysicsModule.BasicPhysics", OpenSim.VersionInfo.VersionNumber)]
|
||||
[assembly: AddinDependency("OpenSim.Region.Framework", OpenSim.VersionInfo.VersionNumber)]
|
||||
|
||||
@@ -36,29 +36,29 @@ namespace OpenSim.Region.PhysicsModule.BasicPhysics
|
||||
/// <summary>
|
||||
/// Effectively a physics plugin that simulates no physics at all.
|
||||
/// </summary>
|
||||
public class BasicPhysicsPlugin : IPhysicsPlugin
|
||||
{
|
||||
public BasicPhysicsPlugin()
|
||||
{
|
||||
}
|
||||
//public class BasicPhysicsPlugin : IPhysicsPlugin
|
||||
//{
|
||||
// public BasicPhysicsPlugin()
|
||||
// {
|
||||
// }
|
||||
|
||||
public bool Init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// public bool Init()
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
public PhysicsScene GetScene(string sceneIdentifier)
|
||||
{
|
||||
return new BasicScene(GetName(), sceneIdentifier);
|
||||
}
|
||||
// public PhysicsScene GetScene(string sceneIdentifier)
|
||||
// {
|
||||
// return new BasicScene(GetName(), sceneIdentifier);
|
||||
// }
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return ("basicphysics");
|
||||
}
|
||||
// public string GetName()
|
||||
// {
|
||||
// return ("basicphysics");
|
||||
// }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
// public void Dispose()
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Nini.Config;
|
||||
using Mono.Addins;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.PhysicsModules.SharedBase;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.PhysicsModule.BasicPhysics
|
||||
{
|
||||
@@ -41,32 +44,71 @@ namespace OpenSim.Region.PhysicsModule.BasicPhysics
|
||||
/// Not useful for anything at the moment apart from some regression testing in other components where some form
|
||||
/// of physics plugin is needed.
|
||||
/// </remarks>
|
||||
public class BasicScene : PhysicsScene
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BasicPhysicsScene")]
|
||||
public class BasicScene : PhysicsScene, INonSharedRegionModule
|
||||
{
|
||||
private List<BasicActor> _actors = new List<BasicActor>();
|
||||
private List<BasicPhysicsPrim> _prims = new List<BasicPhysicsPrim>();
|
||||
private float[] _heightMap;
|
||||
private Vector3 m_regionExtent;
|
||||
|
||||
private bool m_Enabled = false;
|
||||
|
||||
//protected internal string sceneIdentifier;
|
||||
|
||||
public BasicScene(string engineType, string _sceneIdentifier)
|
||||
#region INonSharedRegionModule
|
||||
public string Name
|
||||
{
|
||||
EngineType = engineType;
|
||||
Name = EngineType + "/" + _sceneIdentifier;
|
||||
//sceneIdentifier = _sceneIdentifier;
|
||||
get { return "basicphysics"; }
|
||||
}
|
||||
|
||||
public override void Initialise(IMesher meshmerizer, IConfigSource config)
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
throw new Exception("Should not be called.");
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public override void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
m_regionExtent = regionExtent;
|
||||
// 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);
|
||||
m_regionExtent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ);
|
||||
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override void Dispose() {}
|
||||
|
||||
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
|
||||
@@ -206,5 +248,6 @@ namespace OpenSim.Region.PhysicsModule.BasicPhysics
|
||||
Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
|
||||
return returncolliders;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user