Ignore:
Timestamp:
05/13/06 23:04:05 (19 years ago)
Author:
igarcia
Message:
 
Location:
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCColladaMeshSerializer.cpp

    r950 r958  
    103103                        { 
    104104                                Ogre::ColourValue color; 
    105                                 //color.setAsARGB(mEntity->getSubEntity(iSubEntity)->getVertexColour(iVertex) & 0xFF); 
    106                                 color.setAsARGB(mEntity->getSubEntity(iSubEntity)->getVertexColour(iVertex)); 
     105                                Ogre::RGBA rc = mEntity->getSubEntity(iSubEntity)->getVertexColour(iVertex); 
     106         
     107                                color.b = (rc & 0xFF) / 255.0f;         rc >>= 8; 
     108                                color.g = (rc & 0xFF) / 255.0f;         rc >>= 8; 
     109                                color.r = (rc & 0xFF) / 255.0f;         rc >>= 8; 
     110                                color.a = (rc & 0xFF) / 255.0f; 
     111 
     112                                //color.setAsARGB(mEntity->getSubEntity(iSubEntity)->getVertexColour(iVertex)); 
    107113                                mFloatColorList.push_back(color.r); 
    108114                                mFloatColorList.push_back(color.g); 
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCEntity.cpp

    r950 r958  
    350350                                         
    351351                                                Ogre::ColourValue colour; 
    352                                                 //colour.setAsARGB((Ogre::ARGB)(*pSrcARGB) & 0xFF); 
    353                                                 colour.setAsARGB((Ogre::ARGB)(pSrcARGB[0])); 
     352                                                Ogre::ARGB rc = *pSrcARGB++; 
     353                         
     354                                                colour.b = (rc & 0xFF) / 255.0f;                rc >>= 8; 
     355                                                colour.g = (rc & 0xFF) / 255.0f;                rc >>= 8; 
     356                                                colour.r = (rc & 0xFF) / 255.0f;                rc >>= 8; 
     357                                                colour.a = (rc & 0xFF) / 255.0f; 
     358                                                 
     359                                                //colour.setAsARGB(pSrcARGB[0]); 
    354360 
    355361                                                if (!mergeSubMeshes) 
     
    441447                                                } 
    442448                                        } 
     449                                        elems.clear(); 
    443450 
    444451                                        // There is _no_ baseVertexPointerToElement() which takes an Ogre::Real or a double 
     
    493500                                                                this->getSubEntity(0)->addTextureCoordSet(dimBaseTexCoord); 
    494501                                                        } 
    495                                                 } 
     502                                                }                                                
    496503                                        }        
    497504                                }                        
  • GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCManager.cpp

    r950 r958  
    536536                                BBC::UniqueVertex vertex; 
    537537 
    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(); 
    540542                                vertex.position = leaf->getPosition(); 
    541543 
    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                                 else 
    555                                 { 
    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                                 else 
    569                                 { 
    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                                //} 
    572574 
    573575                                //Ogre::LogManager::getSingleton().logMessage("W:" + Ogre::StringConverter::toString(width) + " UW:" + Ogre::StringConverter::toString(wDistance)); 
Note: See TracChangeset for help on using the changeset viewer.