added basic ability to set the boid prim - no error checking yet
parent
72db5e2cc8
commit
f0176ce13f
|
@ -89,6 +89,7 @@ namespace Flocking
|
|||
// init module
|
||||
m_model = new FlockingModel ();
|
||||
m_view = new FlockingView (m_scene);
|
||||
m_view.BoidPrim = m_boidPrim;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -266,7 +267,12 @@ namespace Flocking
|
|||
public void HandleSetPrimCmd (string module, string[] args)
|
||||
{
|
||||
if (ShouldHandleCmd ()) {
|
||||
m_log.Info ("set prim not implemented yet");
|
||||
//m_log.Info ("set prim not implemented yet");
|
||||
string primName = args[1];
|
||||
lock(m_sync) {
|
||||
m_view.BoidPrim = primName;
|
||||
m_view.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace Flocking
|
|||
|
||||
private Scene m_scene;
|
||||
private UUID m_owner;
|
||||
private String m_boidPrim;
|
||||
|
||||
private Dictionary<string, SceneObjectGroup> m_sogMap = new Dictionary<string, SceneObjectGroup> ();
|
||||
|
||||
|
@ -51,6 +52,10 @@ namespace Flocking
|
|||
m_owner = owner;
|
||||
}
|
||||
|
||||
public String BoidPrim {
|
||||
set{ m_boidPrim = value;}
|
||||
}
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
//trash everything we have
|
||||
|
@ -75,7 +80,7 @@ namespace Flocking
|
|||
|
||||
SceneObjectGroup sog;
|
||||
if (existing == null) {
|
||||
SceneObjectGroup group = findByName ("boidPrim");
|
||||
SceneObjectGroup group = findByName (m_boidPrim);
|
||||
sog = CopyPrim (group, boid.Id);
|
||||
m_sogMap [boid.Id] = sog;
|
||||
m_scene.AddNewSceneObject (sog, false);
|
||||
|
@ -137,7 +142,7 @@ namespace Flocking
|
|||
private SceneObjectGroup MakeDefaultPrim (string name)
|
||||
{
|
||||
PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere ();
|
||||
shape.Scale = new Vector3 (0.5f, 0.5f, 2.5f);
|
||||
shape.Scale = new Vector3 (0.5f, 0.5f, 0.5f);
|
||||
|
||||
SceneObjectGroup prim = new SceneObjectGroup (m_owner, new Vector3 (128f, 128f, 25f), shape);
|
||||
prim.Name = name;
|
||||
|
|
Loading…
Reference in New Issue