* More work on MiniRegionModule module.

0.6.4-rc1
Adam Frisby 2009-03-04 02:29:51 +00:00
parent 3538eeafa2
commit 915b0f2448
8 changed files with 254 additions and 3 deletions

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenSim.Region.CoreModules.World.Tests
{
class SOGSpamTest
{
}
}

View File

@ -866,6 +866,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_updateEntitiesThread.ThreadState == ThreadState.Stopped) if (m_updateEntitiesThread.ThreadState == ThreadState.Stopped)
m_updateEntitiesThread.Start(); m_updateEntitiesThread.Start();
*/ */
m_sceneGraph.UpdateEntities(); m_sceneGraph.UpdateEntities();
} }

View File

@ -0,0 +1,34 @@
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
public class Heightmap : IHeightmap
{
private Scene m_scene;
public Heightmap(Scene scene)
{
m_scene = scene;
}
public int Height
{
get { return m_scene.Heightmap.Height; }
}
public int Width
{
get { return m_scene.Heightmap.Width; }
}
public double Get(int x, int y)
{
return m_scene.Heightmap[x, y];
}
public void Set(int x, int y, double val)
{
m_scene.Heightmap[x, y] = val;
}
}
}

View File

@ -4,7 +4,7 @@ using System.Text;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
interface IHeightmap public interface IHeightmap
{ {
int Height { get; } int Height { get; }
int Width { get; } int Width { get; }

View File

@ -4,7 +4,7 @@ using OpenMetaverse;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
interface IObject public interface IObject
{ {
bool Exists { get; } bool Exists { get; }
uint LocalID { get; } uint LocalID { get; }

View File

@ -6,6 +6,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
interface IWorld interface IWorld
{ {
IObject[] Objects { get; }
IHeightmap Terrain { get; }
} }
} }

View File

@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
class SOPObject : IObject
{
private readonly Scene m_rootScene;
private readonly uint m_localID;
public SOPObject(Scene rootScene, uint localID)
{
m_rootScene = rootScene;
m_localID = localID;
}
private SceneObjectPart GetSOP()
{
if (m_rootScene.Entities.ContainsKey(m_localID))
return ((SceneObjectGroup) m_rootScene.Entities[m_localID]).RootPart;
return null;
}
public bool Exists
{
get { return GetSOP() != null; }
}
public uint LocalID
{
get { return m_localID; }
}
public UUID GlobalID
{
get { return GetSOP().UUID; }
}
public IObject[] Children
{
get { throw new System.NotImplementedException(); }
}
public IObject Root
{
get { return new SOPObject(m_rootScene, GetSOP().ParentGroup.RootPart.LocalId); }
}
public IObjectFace[] Faces
{
get { throw new System.NotImplementedException(); }
}
public Vector3 Scale
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public Quaternion Rotation
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public Vector3 SitTarget
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public string SitTargetText
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public string TouchText
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public string Text
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsPhysical
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsPhantom
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsRotationLockedX
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsRotationLockedY
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsRotationLockedZ
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsSandboxed
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsImmotile
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsAlwaysReturned
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsTemporary
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public bool IsFlexible
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public PrimType PrimShape
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
public Material Material
{
get { throw new System.NotImplementedException(); }
set { throw new System.NotImplementedException(); }
}
}
}

View File

@ -0,0 +1,39 @@
using System.Collections.Generic;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{
public class World : IWorld
{
private readonly Scene m_internalScene;
private readonly Heightmap m_heights;
public World(Scene internalScene)
{
m_internalScene = internalScene;
m_heights = new Heightmap(m_internalScene);
}
public IObject[] Objects
{
get
{
List<EntityBase> ents = m_internalScene.Entities.GetAllByType<SceneObjectGroup>();
IObject[] rets = new IObject[ents.Count];
for (int i = 0; i < ents.Count; i++)
{
EntityBase ent = ents[i];
rets[i] = new SOPObject(m_internalScene, ent.LocalId);
}
return rets;
}
}
public IHeightmap Terrain
{
get { return m_heights; }
}
}
}