Esempio n. 1
0
        /// <summary>
        ///    Removes the specifed object from this scene node.
        /// </summary>
        /// <remarks>
        ///    Bounds for this SceneNode are also updated.
        /// </remarks>
        /// <param name="obj">Reference to the object to remove.</param>
        public virtual void DetachObject(MovableObject obj)
        {
            Debug.Assert(obj != null, "obj != null");

            objectList.Remove(obj.Name);

            // notify the object that it was removed (sending in null sets its parent scene node to null)
            obj.NotifyAttached(null);

            // Make sure bounds get updated (must go right to the top)
            NeedUpdate();
        }
Esempio n. 2
0
        /// <summary>
        ///    Attaches a SceneObject to this scene node.
        /// </summary>
        /// <remarks>
        ///    A SceneObject will not show up in the scene until it is attached to a SceneNode.
        /// </remarks>
        /// <param name="obj"></param>
        public virtual void AttachObject(MovableObject obj)
        {
            Debug.Assert(obj != null, "obj != null");

            objectList[obj.Name] = obj;

            // notify the object that it was attached to us
            obj.NotifyAttached(this);

            // make sure bounds get updated
            NeedUpdate();
        }
Esempio n. 3
0
		/// <summary>
		///		Internal implementation of detaching a 'child' object from this entity and
		///		clearing the assignment of the parent node to the child entity.
		/// </summary>
		/// <param name="pObject">Object to detach.</param>
		protected void DetachObjectImpl( MovableObject pObject )
		{
			var tagPoint = (TagPoint)pObject.ParentNode;

			// free the TagPoint so we can reuse it later
			//TODO: NO idea what this does!
			this.skeletonInstance.FreeTagPoint( tagPoint );

			pObject.NotifyAttached( null, true );
		}
Esempio n. 4
0
		/// <summary>
		///		Internal implementation of attaching a 'child' object to this entity and assign
		///		the parent node to the child entity.
		/// </summary>
		/// <param name="sceneObject">Object to attach.</param>
		/// <param name="tagPoint">TagPoint to attach the object to.</param>
		protected void AttachObjectImpl( MovableObject sceneObject, TagPoint tagPoint )
		{
			this.childObjectList.Add( sceneObject.Name, sceneObject );
			sceneObject.NotifyAttached( tagPoint, true );
		}
Esempio n. 5
0
		/// <summary>
		///    Removes the specifed object from this scene node.
		/// </summary>
		/// <remarks>
		///    Bounds for this SceneNode are also updated.
		/// </remarks>
		/// <param name="obj">Reference to the object to remove.</param>
		public virtual void DetachObject( MovableObject obj )
		{
			Debug.Assert( obj != null, "obj != null" );

			objectList.Remove( obj.Name );

			// notify the object that it was removed (sending in null sets its parent scene node to null)
			obj.NotifyAttached( null );

			// Make sure bounds get updated (must go right to the top)
			NeedUpdate();
		}
Esempio n. 6
0
		/// <summary>
		///    Attaches a MovableObject to this scene node.
		/// </summary>
		/// <remarks>
		///    A MovableObject will not show up in the scene until it is attached to a SceneNode.
		/// </remarks>
		/// <param name="obj"></param>
		public virtual void AttachObject( MovableObject obj )
		{
			Debug.Assert( obj != null, "obj != null" );

			objectList.Add( obj );

			// notify the object that it was attached to us
			obj.NotifyAttached( this );

			// make sure bounds get updated
			NeedUpdate();
		}
Esempio n. 7
0
 /// <summary>
 ///		Internal implementation of detaching a 'child' object from this entity and 
 ///		clearing the assignment of the parent node to the child entity.
 /// </summary>
 /// <param name="sceneObject">Object to detach.</param>
 protected void DetachObjectImpl(MovableObject sceneObject)
 {
     sceneObject.NotifyAttached(null, false);
     childObjectList.Remove(sceneObject);
 }
Esempio n. 8
0
 /// <summary>
 ///		Internal implementation of attaching a 'child' object to this entity and assign 
 ///		the parent node to the child entity.
 /// </summary>
 /// <param name="sceneObject">Object to attach.</param>
 /// <param name="tagPoint">TagPoint to attach the object to.</param>
 protected void AttachObjectImpl(MovableObject sceneObject, TagPoint tagPoint)
 {
     childObjectList[sceneObject.Name] = sceneObject;
     sceneObject.NotifyAttached(tagPoint, true);
 }