Changeset 3064 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.h
- Timestamp:
- 10/23/08 23:10:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.h
r3059 r3064 478 478 */ 479 479 BvhNode *GetRoot() { return mRoot; } 480 /** Sets the scene camera 481 */ 482 //void SetCamera(Camera * camera) { mCamera = camera; } 483 480 484 481 /////////////// 485 482 //-- functions collecting nodes based on some criteria 486 483 484 /** Collect all nodes higher or equal to a given depth. 485 */ 487 486 void CollectNodes(BvhNode *node, BvhNodeContainer &nodes, int depth); 488 487 void CollectNodes(BvhNode *node, BvhNodeContainer &nodes); 488 /** Collect the "physical" leaves of the hierarchy 489 */ 489 490 void CollectLeaves(BvhNode *node, BvhLeafContainer &leaves); 490 /** Collect only the virtual leaves .491 /** Collect only the virtual leaves (can be anywhere in the Žhierarchy). 491 492 */ 492 493 void CollectVirtualLeaves(BvhNode *node, BvhNodeContainer &leaves); … … 543 544 */ 544 545 void ResetNodeClassifications(); 545 /** Helper function that renders the bounding boxes of the leaves as546 wireframes for visualization purpose.547 */548 //void RenderBoundingBoxesForViz(int mode);549 546 /** Count triangles the node contains. 550 547 */ … … 557 554 void ComputeIds(); 558 555 /** Assign virtual leaves based on specified number of triangles per leaf. 556 That means that we try to set the leaves at a point where we 557 have less than numTriangles triangles within this leaf and beyond. 558 559 Virtual leaves are nodes that are determined to be the leaves 560 of the hierarchy during render traversal. These nodes are not necessarily 561 the same as the real leaves of the hierarchy and can be anywhere 562 in the hierarchy. 563 Please refer to the article for more info about virtual leaves 559 564 */ 560 565 void SetVirtualLeaves(int numTriangles); 561 566 562 567 563 //////// 564 //-- functions influencing t ighter bounds568 //////////// 569 //-- functions influencing the tightness of the bounds that are used for testing 565 570 566 571 567 572 /** Sets maximal depth for taking the bounding boxes to test the 568 573 visibility of a node. 569 Deeper => the bounds adapt more to the geometry. 574 Deeper level means that the bounds adapt more to the geometry but 575 also that more boxes are rendered 570 576 */ 571 577 void SetMaxDepthForTestingChildren(int maxDepth); 572 578 /** The ratio of area between node and subnodes where 579 testing the subnodes as proxy is still considered feasable 580 */ 573 581 void SetAreaRatioThresholdForTestingChildren(float ratio); 574 582 … … 583 591 void RenderBoundsForViz(BvhNode *node, RenderState *state, bool useTightBounds); 584 592 593 void AddDynamicObject(SceneEntity *ent); 594 585 595 586 596 protected: … … 608 618 609 619 void PrepareVertices(); 610 620 /** Prepare nodes for vbo rendering. 621 */ 611 622 int PrepareBoundsWithDrawArrays(const BvhNodeContainer &nodes); 623 /** Render the nodes from the vbo prepared previously. 624 */ 612 625 void RenderBoundsWithDrawArrays(int numNodes, RenderState *state); 613 626 … … 643 656 644 657 ///////////////////////////// 645 658 // functions that are required to build the dynamic part of the hierarchy 646 659 int SortTriangles(BvhLeaf *leaf, 647 660 int axis, … … 656 669 int parentAxis, 657 670 SceneEntityContainer &entities); 658 659 671 /** Recompute the dynamic branch of the hierarchy. 660 672 */ … … 663 675 inline bool TerminationCriteriaMet(BvhLeaf *leaf) const; 664 676 677 /** Returns number of bvh nodes. 678 */ 679 inline int GetNumStaticNodes() const { return mNumNodes; } 665 680 666 681 //////////////////////// … … 670 685 /// the root of the hierarchy 671 686 BvhNode *mRoot; 687 /// the root of static part of the the hierarchy 688 BvhNode *mStaticRoot; 689 /// the root of dynamic part of the the hierarchy 690 BvhNode *mDynamicRoot; 672 691 /// pointers to the geometry associated with this node 673 692 SceneEntity **mGeometry;
Note: See TracChangeset
for help on using the changeset viewer.