コード例 #1
0
ファイル: PCZSceneQuery.cs プロジェクト: axiom3d/axiom
        public override void Execute(IIntersectionSceneQueryListener listener)
        {
            var set = new Dictionary <MovableObject, MovableObject>();

            // Iterate over all movable types
            foreach (Core.MovableObjectFactory factory in Root.Instance.MovableObjectFactories.Values)
            {
                MovableObjectCollection col = creator.GetMovableObjectCollection(factory.Type);
                foreach (MovableObject e in col.Values)
                {
                    PCZone zone = ((PCZSceneNode)(e.ParentSceneNode)).HomeZone;
                    var    list = new List <PCZSceneNode>();
                    //find the nodes that intersect the AAB
                    ((PCZSceneManager)creator).FindNodesIn(e.GetWorldBoundingBox(), ref list, zone, null);
                    //grab all moveables from the node that intersect...
                    foreach (PCZSceneNode node in list)
                    {
                        foreach (MovableObject m in node.Objects)
                        {
                            // MovableObject m =
                            if (m != e && !set.ContainsKey(m) && !set.ContainsKey(e) && (m.QueryFlags & queryMask) != 0 &&
                                (m.TypeFlags & this.queryTypeMask) != 0 && m.IsAttached &&
                                e.GetWorldBoundingBox().Intersects(m.GetWorldBoundingBox()))
                            {
                                listener.OnQueryResult(e, m);
                                // deal with attached objects, since they are not directly attached to nodes
                                if (m.MovableType == "Entity")
                                {
                                    var e2 = (Entity)m;
                                    foreach (MovableObject c in e2.SubEntities)
                                    {
                                        if ((c.QueryFlags & queryMask) != 0 && e.GetWorldBoundingBox().Intersects(c.GetWorldBoundingBox()))
                                        {
                                            listener.OnQueryResult(e, c);
                                        }
                                    }
                                }
                            }
                            set.Add(e, m);
                        }
                    }
                }
            }
        }
コード例 #2
0
 public ReadOnlyMovableObjectCollection(MovableObjectCollection collection)
     : base(collection)
 {
 }
コード例 #3
0
 public TileAreaView()
 {
     m_objects    = new MovableObjectCollection();
     this.Objects = new ReadOnlyMovableObjectCollection(m_objects);
 }
コード例 #4
0
ファイル: TileAreaView.cs プロジェクト: Fulborg/dwarrowdelf
 public TileAreaView()
 {
     m_objects = new MovableObjectCollection();
     this.Objects = new ReadOnlyMovableObjectCollection(m_objects);
 }
コード例 #5
0
ファイル: ContainerObject.cs プロジェクト: tomba/dwarrowdelf
 public ContainerObject(World world, ObjectID objectID)
     : base(world, objectID)
 {
     m_contents = new MovableObjectCollection();
     this.Contents = new ReadOnlyMovableObjectCollection(m_contents);
 }
コード例 #6
0
 public ContainerObject(World world, ObjectID objectID)
     : base(world, objectID)
 {
     m_contents    = new MovableObjectCollection();
     this.Contents = new ReadOnlyMovableObjectCollection(m_contents);
 }
コード例 #7
0
 public ContainerObject(World world, ObjectID objectID)
     : base(world, objectID)
 {
     m_inventory = new MovableObjectCollection();
     this.Inventory = new ReadOnlyMovableObjectCollection(m_inventory);
 }