From 184fa20e2c82747c0acb976df8cc5c58fab0b3b6 Mon Sep 17 00:00:00 2001 From: Jak Daniels Date: Thu, 17 Jul 2014 17:43:21 +0100 Subject: [PATCH] Major refactor and added support for varregions (first cut) --- Flocking.dll | Bin 18432 -> 0 bytes Flocking.dll.mdb | Bin 6265 -> 0 bytes Flocking/Flocking.csproj.user | 12 -- Flocking/Flocking.dll.build | 61 ---------- Flocking/resources/Flocking.addin.xml | 13 -- {Flocking => Modules/BoidsModule}/Boid.cs | 19 ++- .../BoidsModule}/FlockingModel.cs | 8 +- .../BoidsModule}/FlockingModule.cs | 115 ++++++++++-------- .../BoidsModule}/FlockingView.cs | 6 +- {Flocking => Modules/BoidsModule}/FlowMap.cs | 64 ++++++---- {Flocking => Modules/BoidsModule}/Util.cs | 0 prebuild.xml | 63 +++++----- 12 files changed, 157 insertions(+), 204 deletions(-) delete mode 100755 Flocking.dll delete mode 100644 Flocking.dll.mdb delete mode 100644 Flocking/Flocking.csproj.user delete mode 100644 Flocking/Flocking.dll.build delete mode 100644 Flocking/resources/Flocking.addin.xml rename {Flocking => Modules/BoidsModule}/Boid.cs (95%) rename {Flocking => Modules/BoidsModule}/FlockingModel.cs (96%) rename {Flocking => Modules/BoidsModule}/FlockingModule.cs (74%) rename {Flocking => Modules/BoidsModule}/FlockingView.cs (96%) rename {Flocking => Modules/BoidsModule}/FlowMap.cs (76%) rename {Flocking => Modules/BoidsModule}/Util.cs (100%) diff --git a/Flocking.dll b/Flocking.dll deleted file mode 100755 index ff146ba7132a486e8110d0ba7ebaa34e80dced63..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18432 zcmeHvdzc*6b?2!^S9e$Uv{czRk&rY`JqGK=%t#0U9<^p_W*T*O z4b?r8hGAexfQ>#I+bni$$a=xA{qO?^C*%u|I3Iq*28TG{kIxG+#5n79NS3V0;*Fj4 z2KIN(t$vI~@p?D=?LSG0I(5&v=bm%!x#ymH>sAj3j(?a8A~JEm`!3Owc=FXP@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Yfsx=TCiw*T>%or(e-$ta zd^_kpKoR%@puIpb_%oo#fYIQq5fs+~H-Nt%vCEyEy@!*?4?*hue9|L_Bm;n9~sJQOk2!0%bZZJ>| z-UB)nr~v;ksCoA@Kl~%-qyvEXwm%BVh+LDpK#@8UM - - Debug - AnyCPU - /Users/jon/osim/opensim/bin/ - 9.0.21022 - ProjectFiles - 0 - - - - diff --git a/Flocking/Flocking.dll.build b/Flocking/Flocking.dll.build deleted file mode 100644 index 8a170df..0000000 --- a/Flocking/Flocking.dll.build +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Flocking/resources/Flocking.addin.xml b/Flocking/resources/Flocking.addin.xml deleted file mode 100644 index 5e1cfcd..0000000 --- a/Flocking/resources/Flocking.addin.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/Flocking/Boid.cs b/Modules/BoidsModule/Boid.cs similarity index 95% rename from Flocking/Boid.cs rename to Modules/BoidsModule/Boid.cs index f8af296..afa26ea 100644 --- a/Flocking/Boid.cs +++ b/Modules/BoidsModule/Boid.cs @@ -43,7 +43,10 @@ namespace Flocking private FlockingModel m_model; private FlowMap m_flowMap; - + private int m_regionX; + private int m_regionY; + private int m_regionZ; + private float m_regionBorder; /// /// Initializes a new instance of the class. @@ -63,7 +66,11 @@ namespace Flocking m_acc = Vector3.Zero; m_vel = new Vector3 (m_rndnums.Next (-1, 1), m_rndnums.Next (-1, 1), m_rndnums.Next (-1, 1)); m_model = model; - m_flowMap = flowMap; + m_flowMap = flowMap; + m_regionX = m_flowMap.LengthX; + m_regionY = m_flowMap.LengthY; + m_regionZ = m_flowMap.LengthZ; + m_regionBorder = m_flowMap.Border; } public Vector3 Location { @@ -249,11 +256,11 @@ namespace Flocking // try increaing our acceleration // or try decreasing our acceleration // or turn around - coz where we came from was OK - if (m_loc.X < 5 || m_loc.X > 250) - m_vel.X = -m_vel.X; - if (m_loc.Y < 5 || m_loc.Y > 250) + if (m_loc.X < m_regionBorder || m_loc.X > m_regionX - m_regionBorder) + m_vel.X = -m_vel.X; + if (m_loc.Y < m_regionBorder || m_loc.Y > m_regionY - m_regionBorder) m_vel.Y = -m_vel.Y; - if (m_loc.Z < 21 || m_loc.Z > 271 ) + if (m_loc.Z < 21 || m_loc.Z > m_regionZ ) m_vel.Z = -m_vel.Z; } diff --git a/Flocking/FlockingModel.cs b/Modules/BoidsModule/FlockingModel.cs similarity index 96% rename from Flocking/FlockingModel.cs rename to Modules/BoidsModule/FlockingModel.cs index beb0bb0..93fae10 100644 --- a/Flocking/FlockingModel.cs +++ b/Modules/BoidsModule/FlockingModel.cs @@ -38,7 +38,8 @@ namespace Flocking private float m_maxForce; private float m_neighbourDistance; private float m_desiredSeparation; - private float m_tolerance; + private float m_tolerance; + private float m_border; private Random m_rnd = new Random(Environment.TickCount); @@ -53,12 +54,13 @@ namespace Flocking } } - public FlockingModel( float maxSpeed, float maxForce, float neighbourDistance, float desiredSeparation, float tolerance ) { + public FlockingModel( float maxSpeed, float maxForce, float neighbourDistance, float desiredSeparation, float tolerance, float border) { m_maxSpeed = maxSpeed; m_maxForce = maxForce; m_neighbourDistance = neighbourDistance; m_desiredSeparation = desiredSeparation; - m_tolerance = tolerance; + m_tolerance = tolerance; + m_border = border; } void AddBoid (string name) diff --git a/Flocking/FlockingModule.cs b/Modules/BoidsModule/FlockingModule.cs similarity index 74% rename from Flocking/FlockingModule.cs rename to Modules/BoidsModule/FlockingModule.cs index 92c4de2..8e77297 100644 --- a/Flocking/FlockingModule.cs +++ b/Modules/BoidsModule/FlockingModule.cs @@ -36,16 +36,22 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Framework; using OpenSim.Framework.Console; +using Mono.Addins; + +[assembly: Addin("BoidsModule", "0.1")] +[assembly: AddinDependency("OpenSim", "0.5")] namespace Flocking { - public class FlockingModule : INonSharedRegionModule - { - - private static readonly ILog m_log = LogManager.GetLogger (System.Reflection.MethodBase.GetCurrentMethod ().DeclaringType); + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class FlockingModule : INonSharedRegionModule + { + #region Fields + private static readonly ILog m_log = LogManager.GetLogger (System.Reflection.MethodBase.GetCurrentMethod ().DeclaringType); static object m_sync = new object(); - private Scene m_scene; + public string m_name = "BoidsModule"; + private Scene m_scene; private FlockingModel m_model; private FlockingView m_view; private bool m_enabled = false; @@ -60,14 +66,15 @@ namespace Flocking private float m_neighbourDistance; private float m_desiredSeparation; private float m_tolerance; + private float m_borderSize; + private int m_maxHeight; private UUID m_owner; + #endregion - #region IRegionModule Members + #region IRegionModuleBase implementation - - - public void Initialise (IConfigSource source) + public void Initialise (IConfigSource source) { //check if we are in the ini files //if so get some physical constants out of them and pass into the model @@ -81,30 +88,41 @@ namespace Flocking m_neighbourDistance = config.GetFloat("neighbour-dist", 25f); m_desiredSeparation = config.GetFloat("desired-separation", 20f); m_tolerance = config.GetFloat("tolerance", 5f); - - - // we're in the config - so turn on this module - m_enabled = true; + m_borderSize = config.GetFloat("border-size", 5f); + m_maxHeight = config.GetInt("max-height", 256); + m_enabled = config.GetBoolean("enabled", false); } + + if (m_enabled) + { + m_log.InfoFormat("[BOIDS] Enabled on channel {0} with Flock Size {1}", m_chatChannel, m_flockSize); + //m_ready = true; + return; + } } + public void PostInitialise() + { + } + public void AddRegion (Scene scene) { - m_log.Info ("ADDING FLOCKING"); - m_scene = scene; - if (m_enabled) { - //register commands - RegisterCommands (); - - //register handlers - m_scene.EventManager.OnFrame += FlockUpdate; - m_scene.EventManager.OnChatFromClient += SimChatSent; //listen for commands sent from the client + m_scene = scene; + m_log.InfoFormat ("[BOIDS]: Adding {0}", scene.RegionInfo.RegionName); + if (m_enabled) + { + //register commands + RegisterCommands(); - // init module - m_model = new FlockingModel (m_maxSpeed, m_maxForce, m_neighbourDistance, m_desiredSeparation, m_tolerance); - m_view = new FlockingView (m_scene); - m_view.BoidPrim = m_boidPrim; - } + //register handlers + scene.EventManager.OnFrame += FlockUpdate; + scene.EventManager.OnChatFromClient += SimChatSent; //listen for commands sent from the client + + // init module + m_model = new FlockingModel(m_maxSpeed, m_maxForce, m_neighbourDistance, m_desiredSeparation, m_tolerance, m_borderSize); + m_view = new FlockingView(scene); + m_view.BoidPrim = m_boidPrim; + } } public void RegionLoaded (Scene scene) @@ -112,14 +130,14 @@ namespace Flocking if (m_enabled) { //make a flow map for this scene - FlowMap flowMap = new FlowMap(scene ); + FlowMap flowMap = new FlowMap(scene, m_maxHeight, m_borderSize); flowMap.Initialise(); // Generate initial flock values m_model.Initialise (m_flockSize, flowMap); // who is the owner for the flock in this region - m_owner = m_scene.RegionInfo.EstateSettings.EstateOwner; + m_owner = scene.RegionInfo.EstateSettings.EstateOwner; m_view.PostInitialize (m_owner); // Mark Module Ready for duty @@ -130,19 +148,35 @@ namespace Flocking public void RemoveRegion (Scene scene) { if (m_enabled) { - m_scene.EventManager.OnFrame -= FlockUpdate; - m_scene.EventManager.OnChatFromClient -= SimChatSent; + m_ready = false; + scene.EventManager.OnFrame -= FlockUpdate; + scene.EventManager.OnChatFromClient -= SimChatSent; } } + public void Close() + { + if (m_enabled) + { + m_ready = false; + m_scene.EventManager.OnFrame -= FlockUpdate; + m_scene.EventManager.OnChatFromClient -= SimChatSent; + } + } + public string Name { - get { return "FlockingModule"; } + get { return m_name; } } public bool IsSharedModule { get { return false; } } + public Type ReplaceableInterface + { + get { return null; } + } + #endregion #region EventHandlers @@ -234,7 +268,7 @@ namespace Flocking if (inWorld) { IClientAPI ownerAPI = null; if (m_scene.TryGetClient (m_owner, out ownerAPI)) { - ownerAPI.SendBlueBoxMessage (m_owner, "osboids", response); + ownerAPI.SendBlueBoxMessage (m_owner, "Boids", response); } } else { MainConsole.Instance.Output (response); @@ -299,21 +333,6 @@ namespace Flocking #endregion - - - #region IRegionModuleBase Members - - - - public void Close () - { - } - - public Type ReplaceableInterface { - get { return null; } - } - - #endregion } } diff --git a/Flocking/FlockingView.cs b/Modules/BoidsModule/FlockingView.cs similarity index 96% rename from Flocking/FlockingView.cs rename to Modules/BoidsModule/FlockingView.cs index 5db8f33..69efe82 100644 --- a/Flocking/FlockingView.cs +++ b/Modules/BoidsModule/FlockingView.cs @@ -132,9 +132,9 @@ namespace Flocking private SceneObjectGroup MakeDefaultPrim (string name) { PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere (); - shape.Scale = new Vector3 (0.5f, 0.5f, 0.5f); - - SceneObjectGroup prim = new SceneObjectGroup (m_owner, new Vector3 (128f, 128f, 25f), shape); + shape.Scale = new Vector3 (0.5f, 0.5f, 0.5f); + + SceneObjectGroup prim = new SceneObjectGroup(m_owner, new Vector3((float)m_scene.RegionInfo.RegionSizeX / 2, (float)m_scene.RegionInfo.RegionSizeY / 2, 25f), shape); prim.Name = name; prim.DetachFromBackup (); m_scene.AddNewSceneObject (prim, false); diff --git a/Flocking/FlowMap.cs b/Modules/BoidsModule/FlowMap.cs similarity index 76% rename from Flocking/FlowMap.cs rename to Modules/BoidsModule/FlowMap.cs index b4df130..e08b2c1 100644 --- a/Flocking/FlowMap.cs +++ b/Modules/BoidsModule/FlowMap.cs @@ -33,48 +33,60 @@ namespace Flocking { public class FlowMap { - private Scene m_scene; - private float[,,] m_flowMap = new float[256,256,256]; + private Scene m_scene; + private float[, ,] m_flowMap; + private uint regionX; + private uint regionY; + private uint regionZ; + private float regionBorder; - public FlowMap (Scene scene) + public FlowMap (Scene scene, int maxHeight, float borderSize) { - m_scene = scene; + m_scene = scene; + regionX = m_scene.RegionInfo.RegionSizeX; + regionY = m_scene.RegionInfo.RegionSizeY; + regionZ = (uint)maxHeight; + regionBorder = borderSize; + m_flowMap = new float[regionX, regionY, regionZ]; } public int LengthX { - get {return 256;} + get {return (int)regionX;} } public int LengthY { - get {return 256;} + get {return (int)regionY;} } public int LengthZ { - get {return 256;} - } + get {return (int)regionZ;} + } + public int Border { + get {return (int)regionBorder;} + } public void Initialise() { //fill in the boundaries - for( int x = 0; x < 256; x++ ) { - for( int y = 0; y < 256; y++ ) { + for( int x = 0; x < regionX; x++ ) { + for( int y = 0; y < regionY; y++ ) { m_flowMap[x,y,0] = 100f; - m_flowMap[x,y,255] = 100f; + m_flowMap[x,y, regionZ-1] = 100f; } } - for( int x = 0; x < 256; x++ ) { - for( int z = 0; z < 256; z++ ) { + for( int x = 0; x < regionX; x++ ) { + for( int z = 0; z < regionZ; z++ ) { m_flowMap[x,0,z] = 100f; - m_flowMap[x,255,z] = 100f; + m_flowMap[x,regionY-1,z] = 100f; } } - for( int y = 0; y < 256; y++ ) { - for( int z = 0; z < 256; z++ ) { + for( int y = 0; y < regionY; y++ ) { + for( int z = 0; z < regionZ; z++ ) { m_flowMap[0,y,z] = 100f; - m_flowMap[255,y,z] = 100f; + m_flowMap[regionX-1,y,z] = 100f; } } //fill in the terrain - for( int x = 0; x < 256; x++ ) { - for( int y = 0; y < 256; y++ ) { + for( int x = 0; x < regionX; x++ ) { + for( int y = 0; y < regionY; y++ ) { int zMax = Convert.ToInt32(m_scene.GetGroundHeight( x, y )); for( int z = 1; z < zMax; z++ ) { m_flowMap[x,y,z] = 100f; @@ -127,12 +139,12 @@ namespace Flocking public bool IsOutOfBounds(Vector3 targetPos) { bool retVal = false; - if( targetPos.X < 5f || - targetPos.X > 250f || - targetPos.Y < 5f || - targetPos.Y > 250f || - targetPos.Z < 5f || - targetPos.Z > 250f ) { + if( targetPos.X < regionBorder || + targetPos.X > regionX - regionBorder || + targetPos.Y < regionBorder || + targetPos.Y > regionY - regionBorder || + targetPos.Z < regionBorder || + targetPos.Z > regionZ - regionBorder ) { retVal = true; } @@ -169,7 +181,7 @@ namespace Flocking public bool IsWithinObstacle( int x, int y, int z ) { bool retVal = false; - if( x > LengthX || y > LengthY || z > LengthZ ) { + if( x >= LengthX || y >= LengthY || z >= LengthZ ) { retVal = true; } else if( x < 0 || y < 0 || z < 0 ) { retVal = true; diff --git a/Flocking/Util.cs b/Modules/BoidsModule/Util.cs similarity index 100% rename from Flocking/Util.cs rename to Modules/BoidsModule/Util.cs diff --git a/prebuild.xml b/prebuild.xml index 36e4a8e..3309edb 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1,34 +1,33 @@ - - + + + + + ../../../bin/ + + + + + ../../../bin/ + + - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - + ../../../bin/ + + + + + + + + + + + + + + + + + +