Class BspNode

    • Field Detail

      • m_kModelPlane

        protected Plane3f m_kModelPlane
        ModelPlane
      • m_kWorldPlane

        protected Plane3f m_kWorldPlane
        WorldPlane
    • Constructor Detail

      • BspNode

        public BspNode()
        Construction and destruction. The base class Node has *three* children and is not allowed to grow. The first and last children (indices 0 and 2) are the "positive" and "negative" children of the binary tree. The positive child corresponds to the positive side of the separating plane. The negative child corresponds to the negative side of the separating plane. The middle child slot is where additional geometry may be attached such as the triangles that are coplanar with the separating plane.
      • BspNode

        public BspNode​(Plane3f rkModelPlane)
        Construction and destruction. The base class Node has *three* children and is not allowed to grow. The first and last children (indices 0 and 2) are the "positive" and "negative" children of the binary tree. The positive child corresponds to the positive side of the separating plane. The negative child corresponds to the negative side of the separating plane. The middle child slot is where additional geometry may be attached such as the triangles that are coplanar with the separating plane.
        Parameters:
        rkModelPlane - the space partitioning plane.
    • Method Detail

      • AttachCoplanarChild

        public Spatial AttachCoplanarChild​(Spatial pkChild)
        These methods should be used instead of the attach/detach methods in the Node base class.
        Parameters:
        pkChild - the child to attach on the "coplanar" side.
        Returns:
        The parent tree with the attached child.
      • AttachNegativeChild

        public Spatial AttachNegativeChild​(Spatial pkChild)
        These methods should be used instead of the attach/detach methods in the Node base class.
        Parameters:
        pkChild - the child to attach on the "negative" side.
        Returns:
        The parent tree with the attached child.
      • AttachPositiveChild

        public Spatial AttachPositiveChild​(Spatial pkChild)
        These methods should be used instead of the attach/detach methods in the Node base class.
        Parameters:
        pkChild - the child to attach on the "positive" side.
        Returns:
        The parent tree with the attached child.
      • DetachCoplanarChild

        public Spatial DetachCoplanarChild()
        These methods should be used instead of the attach/detach methods in the Node base class.
        Returns:
        The parent tree with the coplanar child detached.
      • DetachNegativeChild

        public Spatial DetachNegativeChild()
        These methods should be used instead of the attach/detach methods in the Node base class.
        Returns:
        The parent tree with the negative child detached.
      • DetachPositiveChild

        public Spatial DetachPositiveChild()
        These methods should be used instead of the attach/detach methods in the Node base class.
        Returns:
        The parent tree with the positive child detached.
      • dispose

        public void dispose()
        Delete memory
        Overrides:
        dispose in class Node
      • GetContainingNode

        public Spatial GetContainingNode​(Vector3f rkPoint)
        determine the portion of the scene that contains the point
        Parameters:
        rkPoint - the point to locate in the scene
        Returns:
        the subtree containing the point.
      • GetCoplanarChild

        public Spatial GetCoplanarChild()
        Returns the coplanar subtree
        Returns:
        coplanar child.
      • GetDiskUsed

        public int GetDiskUsed​(StreamVersion rkVersion)
        Returns the size of this object and it's children on disk for the current StreamVersion parameter.
        Specified by:
        GetDiskUsed in interface StreamInterface
        Overrides:
        GetDiskUsed in class Node
        Parameters:
        rkVersion - the current version of the Stream file being created.
        Returns:
        the size of this object on disk.
      • GetModelPlane

        public Plane3f GetModelPlane()
        plane access
        Returns:
        the ModelPlane
      • GetNegativeChild

        public Spatial GetNegativeChild()
        Returns the negative subtree
        Returns:
        negative child.
      • GetPositiveChild

        public Spatial GetPositiveChild()
        Returns the positive subtree
        Returns:
        positive child.
      • GetWorldPlane

        public Plane3f GetWorldPlane()
        plane access
        Returns:
        the WorldPlane
      • Link

        public void Link​(Stream rkStream,
                         Stream.Link pkLink)
        Copies this objects children objects from the input Stream's HashTable, based on the LinkID of the child stored in the pkLink parameter.
        Specified by:
        Link in interface StreamInterface
        Overrides:
        Link in class Node
        Parameters:
        rkStream - the Stream where the child objects are stored.
        pkLink - the Link class from which the child object IDs are read.
      • Load

        public void Load​(Stream rkStream,
                         Stream.Link pkLink)
        Loads this object from the input parameter rkStream, using the input Stream.Link to store the IDs of children objects of this object for linking after all objects are loaded from the Stream.
        Specified by:
        Load in interface StreamInterface
        Overrides:
        Load in class Node
        Parameters:
        rkStream - the Stream from which this object is being read.
        pkLink - the Link class for storing the IDs of this object's children objects.
      • ModelPlane

        public Plane3f ModelPlane()
        plane access
        Returns:
        the ModelPlane
      • Register

        public boolean Register​(Stream rkStream)
        Registers this object with the input Stream parameter. All objects streamed to disk are registered with the Stream so that a unique list of objects is maintained.
        Specified by:
        Register in interface StreamInterface
        Overrides:
        Register in class Node
        Parameters:
        rkStream - the Stream where the child objects are stored.
        Returns:
        true if this object is registered, false if the object has already been registered.
      • Save

        public void Save​(Stream rkStream)
        Write this object and all it's children to the Stream.
        Specified by:
        Save in interface StreamInterface
        Overrides:
        Save in class Node
        Parameters:
        rkStream - the Stream where the child objects are stored.
      • SaveStrings

        public StringTree SaveStrings​(java.lang.String acTitle)
        Write this object into a StringTree for the scene-graph visualization.
        Specified by:
        SaveStrings in interface StreamInterface
        Overrides:
        SaveStrings in class Node
        Parameters:
        acTitle - the header for this object in the StringTree.
        Returns:
        StringTree containing a String-based representation of this object and it's children.
      • GetVisibleSet

        protected void GetVisibleSet​(Culler rkCuller,
                                     boolean bNoCull)
        culling
        Overrides:
        GetVisibleSet in class Node
        Parameters:
        rkCuller - the culling object
        bNoCull - culling flag on/off
      • UpdateWorldData

        protected void UpdateWorldData​(double dAppTime)
        geometric updates
        Overrides:
        UpdateWorldData in class Node
        Parameters:
        dAppTime - application time