- Timestamp:
- 05/13/06 23:04:05 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCManager.cpp
r950 r958 536 536 BBC::UniqueVertex vertex; 537 537 538 LeafKMeansClusterData *leafKMeansClusterData = (LeafKMeansClusterData*)entityCluster->getEntityClusterData(iLeaf).get(); 539 Leaf *leaf = (Leaf*)leafKMeansClusterData->getEntity().get(); 538 //LeafKMeansClusterData *leafKMeansClusterData = (LeafKMeansClusterData*)entityCluster->getEntityClusterData(iLeaf).get(); 539 //Leaf *leaf = (Leaf*)leafKMeansClusterData->getEntity().get(); 540 BBC::EntityClusterData* entityClusterData = entityCluster->getEntityClusterData(iLeaf).get(); 541 Leaf *leaf = (Leaf*)entityClusterData->getEntity().get(); 540 542 vertex.position = leaf->getPosition(); 541 543 542 hDistance = 0.0;543 wDistance = 0.0;544 545 p1 = billboard->getBillboardClusterData()->getQuadTopRightCorner();546 p2 = billboard->getBillboardClusterData()->getQuadBottomRightCorner();547 p3 = leaf->getPosition();548 p4 = leaf->getPosition() + billboard->getBillboardClusterData()->getAxisY();549 550 if (BBC::Util::lineLineIntersect(p1, p2, p3, p4, &pa, &pb, &mua, &mub))551 {552 hDistance = Ogre::Vector3(pa - p1).length();553 }554 else555 {556 Ogre::LogManager::getSingleton().logMessage("Error with intersection: no solution exists.");557 }558 559 p1 = billboard->getBillboardClusterData()->getQuadTopLeftCorner();560 p2 = billboard->getBillboardClusterData()->getQuadTopRightCorner();561 p3 = leaf->getPosition();562 p4 = leaf->getPosition() + billboard->getBillboardClusterData()->getAxisX();563 564 if (BBC::Util::lineLineIntersect(p1, p2, p3, p4, &pa, &pb, &mua, &mub))565 {566 wDistance = Ogre::Vector3(pa - p2).length();567 }568 else569 {570 Ogre::LogManager::getSingleton().logMessage("Error with intersection: no solution exists.");571 }544 //hDistance = 0.0; 545 //wDistance = 0.0; 546 547 //p1 = billboard->getBillboardClusterData()->getQuadTopRightCorner(); 548 //p2 = billboard->getBillboardClusterData()->getQuadBottomRightCorner(); 549 //p3 = leaf->getPosition(); 550 //p4 = leaf->getPosition() + billboard->getBillboardClusterData()->getAxisY(); 551 552 //if (BBC::Util::lineLineIntersect(p1, p2, p3, p4, &pa, &pb, &mua, &mub)) 553 //{ 554 // hDistance = Ogre::Vector3(pa - p1).length(); 555 //} 556 //else 557 //{ 558 // Ogre::LogManager::getSingleton().logMessage("Error with intersection: no solution exists."); 559 //} 560 561 //p1 = billboard->getBillboardClusterData()->getQuadTopLeftCorner(); 562 //p2 = billboard->getBillboardClusterData()->getQuadTopRightCorner(); 563 //p3 = leaf->getPosition(); 564 //p4 = leaf->getPosition() + billboard->getBillboardClusterData()->getAxisX(); 565 566 //if (BBC::Util::lineLineIntersect(p1, p2, p3, p4, &pa, &pb, &mua, &mub)) 567 //{ 568 // wDistance = Ogre::Vector3(pa - p2).length(); 569 //} 570 //else 571 //{ 572 // Ogre::LogManager::getSingleton().logMessage("Error with intersection: no solution exists."); 573 //} 572 574 573 575 //Ogre::LogManager::getSingleton().logMessage("W:" + Ogre::StringConverter::toString(width) + " UW:" + Ogre::StringConverter::toString(wDistance));
Note: See TracChangeset
for help on using the changeset viewer.