Changeset 731 for GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE
- Timestamp:
- 04/06/06 20:48:19 (19 years ago)
- Location:
- GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE
- Files:
-
- 8 added
- 1 deleted
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCManager.h
r721 r731 7 7 namespace BBC { 8 8 9 class _BBCExport Manager : public CSingleton<Manager> {9 class _BBCExport BBCManager : public CSingleton<BBCManager> { 10 10 public: 11 Manager();11 BBCManager(); 12 12 13 ~ Manager();13 ~BBCManager(); 14 14 15 static Manager& getSingleton(void);15 static BBCManager& getSingleton(void); 16 16 17 static Manager* getSingletonPtr(void);17 static BBCManager* getSingletonPtr(void); 18 18 19 19 Ogre::Mesh* loadMesh(Ogre::String folderName, Ogre::String fileName); … … 24 24 25 25 void saveXMLMesh(Ogre::String name); 26 27 void saveMaterial(Ogre::String materialName); 26 28 27 29 void initialize(void); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IBRBillboardCloudTreeApplication.h
r721 r731 2 2 #define _IBRBILLBOARDCLOUDTREEAPPLICATION_H 3 3 4 #include <IMG.h> 5 #include <LBBC.h> 4 6 #include <OBAOgreApplication.h> 5 #include <LBBC.h>6 7 #include <IBRBillboardCloudTreeFrameListener.h> 7 8 … … 15 16 protected: 16 17 18 LBBC::SampleConfigFile *mSampleConfigFile; 19 17 20 CommandLineOptions mOpts; 18 21 19 LBBC:: Manager* mLBBCManager;22 LBBC::LBBCManager* mLBBCManager; 20 23 21 24 int findCommandLineOpts(int numargs, char** argv, Ogre::UnaryOptionList& unaryOptList, Ogre::BinaryOptionList& binOptList); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMG.h
r721 r731 2 2 #define _IMG_H 3 3 4 #include <IMGTexture.h> 5 #include <IMGTextureAtlas.h> 6 4 7 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGBBox.h
r721 r731 25 25 // this class encaplusalte the ogre::AxisAlignedBox 26 26 //* 27 class BBox: public Ogre::AxisAlignedBox {27 class _IMGExport BBox: public Ogre::AxisAlignedBox { 28 28 public: 29 29 BBox(); … … 31 31 ~BBox(); 32 32 33 void StartBoundingBox();33 void initialize(); 34 34 35 Ogre::Vector3 GetMinimum();35 Ogre::Vector3 getMinimum(); 36 36 37 Ogre::Vector3 GetMaximum();37 Ogre::Vector3 getMaximum(); 38 38 39 void AddBoundingVector3(float x, float y, float z);39 void addBoundingVector3(float x, float y, float z); 40 40 41 void Print();41 void print(); 42 42 43 Ogre::Vector3 GetCorner(int corner) const;43 Ogre::Vector3 getCorner(int corner) const; 44 44 45 45 bool intersects(Ogre::Vector3 v); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGBox2d.h
r721 r731 7 7 8 8 //* this class represents a 2d bound box for a texture 9 class Box2d9 class _IMGExport Box2d 10 10 { 11 11 public: … … 22 22 } 23 23 24 Ogre::Vector2 GetMinimum();24 Ogre::Vector2 getMinimum(); 25 25 26 Ogre::Vector2 GetMaximum();26 Ogre::Vector2 getMaximum(); 27 27 28 void SetBoundBox(float x, float y, float X, float Y);28 void setBoundBox(float x, float y, float X, float Y); 29 29 30 void AddBoundingVector3(float x, float y);30 void addBoundingVector3(float x, float y); 31 31 32 void Print();32 void print(); 33 33 34 Ogre::Vector2 GetCorner(int corner) const;34 Ogre::Vector2 getCorner(int corner) const; 35 35 36 bool In(int w, int h);36 bool in(int w, int h); 37 37 38 bool FitPerfect(int w, int h);38 bool fitPerfect(int w, int h); 39 39 40 40 protected: -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGBsp.h
r721 r731 7 7 namespace IMG { 8 8 9 class Bsp {9 class _IMGExport Bsp { 10 10 public: 11 11 Bsp(); … … 13 13 virtual ~Bsp(); 14 14 15 void SetRoot(NodeBspPtr node);15 void setRoot(NodeBspPtr node); 16 16 17 void Print();17 void print(); 18 18 19 void PrintLeaf();19 void printLeaf(); 20 20 21 NodeBspPtr Insert(int w, int h, int idcluster);21 NodeBspPtr insert(int w, int h, int idcluster); 22 22 23 NodeBspPtr Get(int i);23 NodeBspPtr get(int i); 24 24 25 25 protected: … … 30 30 int counttotal; 31 31 32 void Print(NodeBspPtr node);32 void print(NodeBspPtr node); 33 33 34 void PrintLeaf(NodeBspPtr node);34 void printLeaf(NodeBspPtr node); 35 35 36 36 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGCluster.h
r721 r731 11 11 { 12 12 13 class Cluster13 class _IMGExport Cluster 14 14 { 15 15 public: 16 16 Cluster(); 17 18 virtual ~Cluster(); 17 19 18 20 Cluster & operator =(const Cluster & p); … … 20 22 Cluster(const Cluster & p); 21 23 22 void SetNormal(Ogre::Vector3* n);24 void setNormal(Ogre::Vector3* n); 23 25 24 Ogre::Vector3* GetNormal();26 Ogre::Vector3* getNormal(); 25 27 26 BBox* GetBound();28 BBox* getBound(); 27 29 28 Box2d* GetBspNodeBound();30 Box2d* getBspNodeBound(); 29 31 30 void SetBspNodeBound(Box2d* box);32 void setBspNodeBound(Box2d* box); 31 33 32 void Print();34 void print(); 33 35 34 36 //* return the dominant normal axis, for calculate the 2d projection 35 int AxisProjected();37 int axisProjected(); 36 38 37 int GetId() const;39 int getId() const; 38 40 39 void SetId(int id_);41 void setId(int id_); 40 42 41 std::vector<Ogre::Vector3>* GetVector3sVector();43 std::vector<Ogre::Vector3>* getVector3sVector(); 42 44 43 Ogre::Vector3* GetVector3sTex() const;45 Ogre::Vector3* getVector3sTex() const; 44 46 45 void Finish();47 void finish(); 46 48 47 void SetPlane(Ogre::Vector3* normal, Ogre::Vector3 * point);49 void setPlane(Ogre::Vector3* normal, Ogre::Vector3 * point); 48 50 49 Plane3 * GetPlane();51 Plane3 * getPlane(); 50 52 51 53 //* Return the increment in U (lumel increment in x). For patchs calculation 52 Ogre::Vector3 GetIncU();54 Ogre::Vector3 getIncU(); 53 55 54 56 //* Return the increment in V (lumel increment in x). For patchs calculation 55 Ogre::Vector3 GetIncV();57 Ogre::Vector3 getIncV(); 56 58 57 59 //* Return the origin. For patchs calculation 58 Ogre::Vector3 GetOrigin();60 Ogre::Vector3 getOrigin(); 59 61 60 bool PointIn(Ogre::Vector3 & point);62 bool pointIn(Ogre::Vector3 & point); 61 63 62 64 Ogre::Real *pointeru[4]; … … 93 95 Plane3 plane; 94 96 95 public:96 virtual ~Cluster();97 98 97 }; 99 98 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGCluster2d.h
r721 r731 8 8 class Cluster; 9 9 10 class Cluster2d {10 class _IMGExport Cluster2d { 11 11 public: 12 12 Cluster2d(); … … 17 17 // 18 18 // 19 int Create2d(Cluster * cluster, int type, int type_vertexs);19 int create2d(Cluster * cluster, int type, int type_vertexs); 20 20 21 void Print();21 void print(); 22 22 23 Ogre::Vector2 * GetVector3s();23 Ogre::Vector2 * getVector3s(); 24 24 25 std::vector<Ogre::Vector2> * GetVector3sVector();25 std::vector<Ogre::Vector2> * getVector3sVector(); 26 26 27 Ogre::Vector3 * GetNormal();27 Ogre::Vector3 * getNormal(); 28 28 29 29 protected: -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGClusterList.h
r721 r731 7 7 namespace IMG { 8 8 9 class ClusterList9 class _IMGExport ClusterList 10 10 { 11 11 public: … … 14 14 virtual ~ClusterList(); 15 15 16 std::vector<Cluster> * GetList();16 std::vector<Cluster> * getList(); 17 17 18 18 //return the pointer to the list of voxels 19 unsigned int GetSize() const;19 unsigned int getSize() const; 20 20 21 21 //return the number of elements of list 22 Cluster * Get(unsigned int i);22 Cluster * get(unsigned int i); 23 23 24 bool Insert(Cluster * p);24 bool insert(Cluster * p); 25 25 26 void Print();26 void print(); 27 27 28 28 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGNodeBsp.h
r721 r731 8 8 9 9 // Fordward declaration... 10 class NodeBsp;10 class _IMGExport NodeBsp; 11 11 12 12 typedef ::boost::intrusive_ptr<NodeBsp> NodeBspPtr; … … 25 25 virtual ~NodeBsp(); 26 26 27 Box2d* GetBound();27 Box2d* getBound(); 28 28 29 void SetBound(Box2d *box);29 void setBound(Box2d *box); 30 30 31 NodeBspPtr GetChild(int i);31 NodeBspPtr getChild(int i); 32 32 33 void SetId(int id_);33 void setId(int id_); 34 34 35 unsigned int GetId() const;35 unsigned int getId() const; 36 36 37 void SetChild(NodeBspPtr node, int i);37 void setChild(NodeBspPtr node, int i); 38 38 39 void Print();39 void print(); 40 40 41 NodeBspPtr Insert(int w, int h);41 NodeBspPtr insert(int w, int h); 42 42 43 NodeBspPtr Get(NodeBspPtr node, int i);43 NodeBspPtr get(NodeBspPtr node, int i); 44 44 45 45 protected: -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGPlane3.h
r721 r731 6 6 namespace IMG { 7 7 8 class Plane3: public Ogre::Plane {8 class _IMGExport Plane3: public Ogre::Plane { 9 9 public: 10 10 //a plane's interface … … 15 15 Plane3 & operator =(const Plane3 & p); 16 16 17 Ogre::Vector3 * GetNormal();17 Ogre::Vector3 * getNormal(); 18 18 19 void SetNormal(float x, float y, float z);19 void setNormal(float x, float y, float z); 20 20 21 void SetDistance(float dist);21 void setDistance(float dist); 22 22 23 float GetDistance() const;23 float getDistance() const; 24 24 25 void Print();25 void print(); 26 26 27 27 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGPrerequisites.h
r721 r731 8 8 #include <OgrePlane.h> 9 9 #include <OgreAxisAlignedBox.h> 10 #include <OgreHardwarePixelBuffer.h> 11 #include <OgreImageCodec.h> 12 13 #include <imdebug.h> 10 14 11 15 #include <boost/smart_ptr.hpp> 12 16 17 # if defined( IMG_LIB_BUILD ) 18 # define _IMGExport __declspec( dllexport ) 19 # else 20 # define _IMGExport 21 # endif 22 13 23 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBC.h
r721 r731 9 9 #include <LBBCBillboardViewMode.h> 10 10 #include <LBBCClusterViewMode.h> 11 11 #include <LBBCEntityTextureAtlasViewMode.h> 12 12 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCManager.h
r721 r731 15 15 namespace LBBC { 16 16 17 class _BBCExport Manager : public BBC::Manager {17 class _BBCExport LBBCManager : public BBC::BBCManager { 18 18 public: 19 Manager();19 LBBCManager(); 20 20 21 ~ Manager();21 ~LBBCManager(); 22 22 23 23 void runSampleConfigFile(); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCSampleConfigFile.h
r721 r731 12 12 virtual ~SampleConfigFile(); 13 13 14 Ogre::String getEntitySampleMaterialPrefixName(); 15 14 16 bool getEntityDistributionMerged(); 15 17 … … 20 22 bool getEntityDistributionSplitted(); 21 23 22 Ogre::String getEntitySampleMeshPrefix Filename();24 Ogre::String getEntitySampleMeshPrefixName(); 23 25 24 26 bool getEntityDistributionGeneration(); … … 26 28 Ogre::String getEntityDistributionFolder(); 27 29 28 Ogre::String getEntityDistributionXMLPrefix Filename();30 Ogre::String getEntityDistributionXMLPrefixName(); 29 31 30 32 Ogre::String getEntitiesFolder(); … … 32 34 bool getEntitySampleMeshGeneration(); 33 35 34 Ogre::String getEntitiesMeshPrefix Filename();36 Ogre::String getEntitiesMeshPrefixName(); 35 37 36 38 bool getEntityClustersGeneration(); … … 48 50 bool getEntityClustersSplittedClusters(); 49 51 50 Ogre::String getEntityClustersMeshPrefix Filename();52 Ogre::String getEntityClustersMeshPrefixName(); 51 53 52 Ogre::String getEntityClustersMaterialPrefix Filename();54 Ogre::String getEntityClustersMaterialPrefixName(); 53 55 54 56 bool getBillboardCloudMergedBillboards(); … … 60 62 Ogre::String getBillboardCloudFolder(); 61 63 62 Ogre::String getBillboardCloudMeshPrefix Filename();64 Ogre::String getBillboardCloudMeshPrefixName(); 63 65 64 Ogre::String getBillboardCloud MaterialPrefixFilename();66 Ogre::String getBillboardCloudBillboardMaterialPrefixName(); 65 67 66 Ogre::String getBillboardCloud XMLPrefixFilename();68 Ogre::String getBillboardCloudBillboardGroupMaterialPrefixName(); 67 69 68 bool getBillboardCloudDiffuseColorTextureAtlasGeneration();70 Ogre::String getBillboardCloudBillboardTextureUnit0PrefixName(); 69 71 70 unsigned int getBillboardCloudDiffuseColorTextureSize();72 Ogre::String getBillboardCloudBillboardGroupTextureUnit0PrefixName(); 71 73 72 unsigned int getBillboardCloudDiffuseColorTextureAtlasSize(); 73 74 bool getBillboardCloudIndirectTextureAtlasGeneration(); 75 76 unsigned int getBillboardCloudIndirectTextureSize(); 77 78 unsigned int getBillboardCloudIndirectTextureAtlasSize(); 74 Ogre::String getBillboardCloudXMLPrefixName(); 79 75 80 76 unsigned int getBillboardCloudGroups(); 81 77 82 78 bool getBillboardCloudGroupedBillboards(); 79 80 bool getBillboardCloudDiffuseColorEntityTextureAtlasGeneration(); 81 82 Ogre::String getBillboardCloudDiffuseColorEntityTexturePrefixName(); 83 84 Ogre::String getBillboardCloudDiffuseColorEntityTextureAtlasPrefixName(); 85 86 unsigned int getBillboardCloudDiffuseColorEntityTextureAtlasBitRange(); 87 88 unsigned int getBillboardCloudDiffuseColorEntityTextureAtlasSize(); 89 90 unsigned int getBillboardCloudDiffuseColorBillboardGroupTextureSize(); 91 92 bool getBillboardCloudIndirectBillboardGroupTextureAtlasGeneration(); 93 94 Ogre::String getBillboardCloudIndirectBillboardGroupTextureAtlasPrefixName(); 95 96 unsigned int getBillboardCloudIndirectBillboardGroupTextureAtlasBitRange(); 97 98 unsigned int getBillboardCloudIndirectBillboardGroupTextureAtlasSize(); 99 100 unsigned int getBillboardCloudIndirectBillboardGroupTextureSize(); 101 102 bool getBillboardCloudDiffuseColorBillboardGroupTextureAtlasGeneration(); 103 104 bool getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasGeneration(); 105 106 Ogre::String getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasPrefixName(); 107 108 unsigned int getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasBitRange(); 109 110 unsigned int getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasSize(); 111 112 unsigned int getBillboardCloudDiffuseColorMergedBillboardsTextureSize(); 113 114 unsigned int getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize(); 115 116 unsigned int getBillboardCloudDiffuseColorEntityTextureAtlasNumSamples(); 117 118 bool getBillboardCloudIndirectMergedBillboardsTextureAtlasGeneration(); 119 120 Ogre::String getBillboardCloudIndirectMergedBillboardsTextureAtlasPrefixName(); 121 122 unsigned int getBillboardCloudIndirectMergedBillboardsTextureAtlasBitRange(); 123 124 unsigned int getBillboardCloudIndirectMergedBillboardsTextureAtlasSize(); 125 126 unsigned int getBillboardCloudIndirectMergedBillboardsTextureSize(); 83 127 84 128 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/OBA/OBAOgreBase.h
r721 r731 34 34 protected: 35 35 Ogre::ArchiveManager *mArchiveManager; 36 36 37 Ogre::ResourceGroupManager *mResourceGroupManager; 38 37 39 Ogre::DefaultHardwareBufferManager *mDefaultHardwareBufferManager; 40 38 41 Ogre::MeshSerializer *mMeshSerializer; 42 43 Ogre::MaterialSerializer *mMaterialSerializer; 44 39 45 Ogre::XMLMeshSerializer *mXMLMeshSerializer; 46 40 47 Ogre::MaterialManager *mMaterialManager; 48 41 49 Ogre::LogManager *mLogManager; 50 42 51 Ogre::MeshManager *mMeshManager; 52 43 53 FileSystemArchiveFactory *mFileSystemArchiveFactory; 54 44 55 Ogre::Math *mMath; 45 56 … … 56 67 Ogre::XMLMeshSerializer* getXMLMeshSerializer(); 57 68 69 Ogre::MaterialSerializer* getMaterialSerializer(); 70 58 71 Ogre::MeshSerializer* getMeshSerializer(); 59 60 Ogre::MeshManager* getMeshManager();61 72 62 73 void initialize(); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/OBA/OBAPrerequisites.h
r721 r731 23 23 # endif 24 24 25 26 27 25 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/scripts/IBRBillboardCloudTreeGenerator.vcproj
r721 r731 20 20 <Tool 21 21 Name="VCCLCompilerTool" 22 AdditionalOptions="/D "TIXML_USE_STL" /D "OBA_LIB_BUILD" "22 AdditionalOptions="/D "TIXML_USE_STL" /D "OBA_LIB_BUILD" /D "IMG_LIB_BUILD"" 23 23 Optimization="0" 24 AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Samples/Common/include";"$(OGRE_PATH)/Tools/XMLConverter/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;D:\design_04_11_2005\svn\NonGTP\Boost "24 AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Samples/Common/include";"$(OGRE_PATH)/Tools/XMLConverter/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include" 25 25 PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;_MT" 26 26 MinimalRebuild="TRUE" … … 39 39 Name="VCLinkerTool" 40 40 AdditionalOptions=" /IMPLIB:"..\bin\debug\$(ProjectName)_d.lib" " 41 AdditionalDependencies="Ogremain_d.lib "41 AdditionalDependencies="Ogremain_d.lib imdebug.lib" 42 42 OutputFile="$(OutDir)/$(ProjectName)_d.dll" 43 43 LinkIncremental="2" 44 44 SuppressStartupBanner="TRUE" 45 AdditionalLibraryDirectories=" $(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)"45 AdditionalLibraryDirectories=""$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/Release";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib" 46 46 IgnoreDefaultLibraryNames="LIBCD;LIBCMTD" 47 47 GenerateDebugInformation="TRUE" … … 79 79 <Tool 80 80 Name="VCCLCompilerTool" 81 AdditionalOptions="/D "TIXML_USE_STL" /D "TIXML_USE_STL" /D "OBA_LIB_BUILD" "82 AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";"$(OGRE_PATH)/Samples/Common/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;D:\design_04_11_2005\svn\NonGTP\Boost "81 AdditionalOptions="/D "TIXML_USE_STL" /D "TIXML_USE_STL" /D "OBA_LIB_BUILD" /D "IMG_LIB_BUILD"" 82 AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";"$(OGRE_PATH)/Samples/Common/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include" 83 83 PreprocessorDefinitions="WIN32;NDEBUG;_LIB" 84 84 RuntimeLibrary="2" … … 92 92 Name="VCLinkerTool" 93 93 AdditionalOptions=" /IMPLIB:"..\bin\release\$(ProjectName).lib" " 94 AdditionalDependencies="OgreMain.lib "94 AdditionalDependencies="OgreMain.lib imdebug.lib" 95 95 LinkIncremental="1" 96 96 SuppressStartupBanner="TRUE" 97 AdditionalLibraryDirectories=" $(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)"97 AdditionalLibraryDirectories=""$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib" 98 98 SubSystem="1" 99 99 OptimizeReferences="2" … … 223 223 </File> 224 224 <File 225 RelativePath="..\src\LBBCClusterViewMode.cpp"> 226 </File> 227 <File 228 RelativePath="..\src\LBBCEntityTextureAtlasViewMode.cpp"> 229 </File> 230 <File 225 231 RelativePath="..\src\LBBCKdTreeClusterGenerator.cpp"> 226 232 </File> … … 288 294 <File 289 295 RelativePath="..\src\IMGPlane3.cpp"> 296 </File> 297 <File 298 RelativePath="..\src\IMGTexture.cpp"> 299 </File> 300 <File 301 RelativePath="..\src\IMGTextureAtlas.cpp"> 290 302 </File> 291 303 </Filter> … … 417 429 </File> 418 430 <File 431 RelativePath="..\include\Lbbc\LBBCEntityTextureAtlasViewMode.h"> 432 </File> 433 <File 419 434 RelativePath="..\include\Lbbc\LBBCKdTreeClusterGenerator.h"> 420 435 </File> … … 491 506 <File 492 507 RelativePath="..\include\Img\IMGPrerequisites.h"> 508 </File> 509 <File 510 RelativePath="..\include\Img\IMGTexture.h"> 511 </File> 512 <File 513 RelativePath="..\include\Img\IMGTextureAtlas.h"> 493 514 </File> 494 515 </Filter> -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/scripts/IBRBillboardCloudTreeGeneratorCommandLine.vcproj
r721 r731 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories="../include;../include/BBC;../include/IMG;../include/OBA;../include/LBBC;"$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";D:\design_04_11_2005\svn\NonGTP\Boost "22 AdditionalIncludeDirectories="../include;../include/BBC;../include/IMG;../include/OBA;../include/LBBC;"$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include" 23 23 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" 24 24 MinimalRebuild="TRUE" … … 33 33 <Tool 34 34 Name="VCLinkerTool" 35 AdditionalDependencies="IBRBillboardCloudTreeGenerator_d.lib OgreMain_d.lib "35 AdditionalDependencies="IBRBillboardCloudTreeGenerator_d.lib OgreMain_d.lib imdebug.lib" 36 36 OutputFile="$(OutDir)/IBRBillboardCloudTreeGeneratorCmd_d.exe" 37 37 LinkIncremental="2" 38 AdditionalLibraryDirectories=" ../bin/$(ConfigurationName);$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)"38 AdditionalLibraryDirectories=""../bin/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/Release";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib" 39 39 GenerateDebugInformation="TRUE" 40 40 ProgramDatabaseFile="$(OutDir)/scripts.pdb" … … 70 70 <Tool 71 71 Name="VCCLCompilerTool" 72 AdditionalIncludeDirectories="../include;../include/OBA;../include/BBC;../include/IMG;../include/LBBC;"$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";D:\design_04_11_2005\svn\NonGTP\Boost "72 AdditionalIncludeDirectories="../include;../include/OBA;../include/BBC;../include/IMG;../include/LBBC;"$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include" 73 73 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 74 74 RuntimeLibrary="0" … … 81 81 <Tool 82 82 Name="VCLinkerTool" 83 AdditionalDependencies="IBRBillboardCloudTreeGenerator.lib OgreMain.lib "83 AdditionalDependencies="IBRBillboardCloudTreeGenerator.lib OgreMain.lib imdebug.lib" 84 84 OutputFile="$(OutDir)/IBRBillboardCloudTreeGeneratorCmd.exe" 85 85 LinkIncremental="1" 86 AdditionalLibraryDirectories=" ../bin/$(ConfigurationName);$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)"86 AdditionalLibraryDirectories=""../bin/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib" 87 87 GenerateDebugInformation="TRUE" 88 88 SubSystem="1" -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCBillboardCloudUVMapper.cpp
r721 r731 124 124 Ogre::LogManager::getSingleton().logMessage("iBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds) + "-" + "iBBCG:" + Ogre::StringConverter::toString(iBillboardGroup)); 125 125 126 Ogre::LogManager::getSingleton().logMessage("SizeCLList:" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup)-> GetSize()) + " -- numBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds));127 128 IMG::Cluster *cluster = getClusterList(iBillboardGroup)-> Get(getClusterList(iBillboardGroup)->GetSize()-1);129 IMG::Box2d *box = cluster-> GetBspNodeBound();130 Ogre::Vector2 max = box-> GetMaximum();131 Ogre::Vector2 min = box-> GetMinimum();126 Ogre::LogManager::getSingleton().logMessage("SizeCLList:" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup)->getSize()) + " -- numBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds)); 127 128 IMG::Cluster *cluster = getClusterList(iBillboardGroup)->get(getClusterList(iBillboardGroup)->getSize()-1); 129 IMG::Box2d *box = cluster->getBspNodeBound(); 130 Ogre::Vector2 max = box->getMaximum(); 131 Ogre::Vector2 min = box->getMinimum(); 132 132 Ogre::LogManager::getSingleton().logMessage("Max:" + Ogre::StringConverter::toString(Ogre::Vector3(max[0],max[1],0)) + 133 133 "\tMin:" + Ogre::StringConverter::toString(Ogre::Vector3(min[0],min[1],0)) + … … 282 282 Ogre::LogManager::getSingleton().logMessage("w:" + Ogre::StringConverter::toString(mTextureWidth)); 283 283 Ogre::LogManager::getSingleton().logMessage("h:" + Ogre::StringConverter::toString(mTextureHeight)); 284 nodeDest = getBsp(iBillboardGroup)-> Insert(mTextureWidth,mTextureHeight,iBillboard);284 nodeDest = getBsp(iBillboardGroup)->insert(mTextureWidth,mTextureHeight,iBillboard); 285 285 286 cluster. SetBspNodeBound(nodeDest->GetBound());287 //cluster. Finish();288 getClusterList(iBillboardGroup)-> Insert(&cluster);286 cluster.setBspNodeBound(nodeDest->getBound()); 287 //cluster.finish(); 288 getClusterList(iBillboardGroup)->insert(&cluster); 289 289 } 290 290 … … 353 353 IMG::NodeBspPtr node = IMG::NodeBspPtr(new IMG::NodeBsp); 354 354 355 node-> GetBound()->SetBoundBox(0, 0, mTextureAtlasWidth, mTextureAtlasHeight);356 bsp-> SetRoot(node);355 node->getBound()->setBoundBox(0, 0, mTextureAtlasWidth, mTextureAtlasHeight); 356 bsp->setRoot(node); 357 357 358 358 addBsp(bsp); … … 379 379 { 380 380 Ogre::LogManager::getSingleton().logMessage("\nA"); 381 Ogre::LogManager::getSingleton().logMessage("IG:" + Ogre::StringConverter::toString(iBillboardsInGroup) + " SizeCLList(" + Ogre::StringConverter::toString(iBillboardGroup) + "):" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup)-> GetSize()) + " -- numBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds));381 Ogre::LogManager::getSingleton().logMessage("IG:" + Ogre::StringConverter::toString(iBillboardsInGroup) + " SizeCLList(" + Ogre::StringConverter::toString(iBillboardGroup) + "):" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup)->getSize()) + " -- numBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds)); 382 382 383 383 addTextureInBsp(iBillboardGroup, iBillboard); … … 391 391 { 392 392 Ogre::LogManager::getSingleton().logMessage("\nB"); 393 Ogre::LogManager::getSingleton().logMessage("IG:" + Ogre::StringConverter::toString(iBillboardsInGroup) + " SizeCLList(" + Ogre::StringConverter::toString(iBillboardGroup) + "):" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup)-> GetSize()) + " -- numBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds));393 Ogre::LogManager::getSingleton().logMessage("IG:" + Ogre::StringConverter::toString(iBillboardsInGroup) + " SizeCLList(" + Ogre::StringConverter::toString(iBillboardGroup) + "):" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup)->getSize()) + " -- numBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds)); 394 394 395 395 addTextureInBsp(iBillboardGroup, iBillboard); … … 403 403 iBillboardsInGroup = 0; 404 404 405 Ogre::LogManager::getSingleton().logMessage("\nC IG:" + Ogre::StringConverter::toString(iBillboardsInGroup-1) + " SizeCLList(" + Ogre::StringConverter::toString(iBillboardGroup-1) + "):" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup-1)-> GetSize()));406 Ogre::LogManager::getSingleton().logMessage("IG:" + Ogre::StringConverter::toString(iBillboardsInGroup) + " SizeCLList(" + Ogre::StringConverter::toString(iBillboardGroup) + "):" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup)-> GetSize()) + " -- numBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds));405 Ogre::LogManager::getSingleton().logMessage("\nC IG:" + Ogre::StringConverter::toString(iBillboardsInGroup-1) + " SizeCLList(" + Ogre::StringConverter::toString(iBillboardGroup-1) + "):" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup-1)->getSize())); 406 Ogre::LogManager::getSingleton().logMessage("IG:" + Ogre::StringConverter::toString(iBillboardsInGroup) + " SizeCLList(" + Ogre::StringConverter::toString(iBillboardGroup) + "):" + Ogre::StringConverter::toString(getClusterList(iBillboardGroup)->getSize()) + " -- numBBC:" + Ogre::StringConverter::toString(numGeneratedBillboardClouds)); 407 407 408 408 addTextureInBsp(iBillboardGroup, iBillboard); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCManager.cpp
r721 r731 4 4 namespace BBC { 5 5 6 template <> Manager* CSingleton<Manager>::ms_Singleton = NULL;6 template <> BBCManager* CSingleton<BBCManager>::ms_Singleton = NULL; 7 7 8 Manager*Manager::getSingletonPtr(void)8 BBCManager* BBCManager::getSingletonPtr(void) 9 9 { 10 10 return ms_Singleton; 11 11 } 12 12 13 Manager&Manager::getSingleton(void)13 BBCManager& BBCManager::getSingleton(void) 14 14 { 15 15 assert( ms_Singleton ); return ( *ms_Singleton ); 16 16 } 17 17 18 Manager::Manager()18 BBCManager::BBCManager() 19 19 { 20 20 } 21 21 22 Manager::~Manager()22 BBCManager::~BBCManager() 23 23 { 24 24 } 25 25 26 void Manager::shutdown()26 void BBCManager::shutdown() 27 27 { 28 28 } 29 29 30 void Manager::initialize()30 void BBCManager::initialize() 31 31 { 32 32 } 33 33 34 Ogre::Mesh* Manager::loadMesh(Ogre::String folderName, Ogre::String fileName)34 Ogre::Mesh* BBCManager::loadMesh(Ogre::String folderName, Ogre::String fileName) 35 35 { 36 36 //std::ifstream ifs; … … 42 42 Ogre::ResourceGroupManager::getSingleton().addResourceLocation(folderName, "FileSystem", fileName, false); 43 43 44 Ogre::MeshPtr mesh = O BA::OgreBase::getSingleton().getMeshManager()->load(fileName, fileName);44 Ogre::MeshPtr mesh = Ogre::MeshManager::getSingleton().load(fileName, fileName); 45 45 46 46 return mesh.getPointer(); 47 47 } 48 48 49 Ogre::Mesh* Manager::loadXMLMesh(Ogre::String name)49 Ogre::Mesh* BBCManager::loadXMLMesh(Ogre::String name) 50 50 { 51 51 Ogre::MeshPtr newMesh = Ogre::MeshManager::getSingleton().createManual(name.substr(0,((name.size()-1)-4)),Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); … … 68 68 } 69 69 70 void Manager::saveMesh(Ogre::String name)70 void BBCManager::saveMesh(Ogre::String name) 71 71 { 72 72 Ogre::MeshPtr meshPtr = Ogre::MeshManager::getSingleton().getByName(name); … … 74 74 } 75 75 76 void Manager::saveXMLMesh(Ogre::String name)76 void BBCManager::saveXMLMesh(Ogre::String name) 77 77 { 78 78 Ogre::MeshPtr meshPtr = Ogre::MeshManager::getSingleton().getByName(name); … … 80 80 } 81 81 82 void BBCManager::saveMaterial(Ogre::String materialName) 83 { 84 Ogre::ResourceManager::ResourceMapIterator it = Ogre::MaterialManager::getSingleton().getResourceIterator(); 85 while (it.hasMoreElements()) 86 { 87 Ogre::MaterialPtr m = it.getNext(); 88 89 if (m->getName() == materialName) 90 { 91 OBA::OgreBase::getSingleton().getMaterialSerializer()->queueForExport(m); 92 break; 93 } 94 } 95 //OBA::OgreBase::getSingleton().getMaterialSerializer()->exportQueued(dest); 82 96 } 97 98 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCOgreMeshSerializer.cpp
r721 r731 53 53 BBC::MeshPtr pMesh(new BBC::Mesh(Ogre::MeshManager::getSingleton().createManual(fileName, fileName).getPointer())); 54 54 55 Ogre::MeshPtr mesh = O BA::OgreBase::getSingleton().getMeshManager()->load(fileName, fileName);55 Ogre::MeshPtr mesh = Ogre::MeshManager::getSingleton().load(fileName, fileName); 56 56 57 57 Ogre::LogManager::getSingleton().logMessage("Num.SubEntities:" + Ogre::StringConverter::toString(mEntity->getNumSubEntities())); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IBRBillboardCloudTreeApplication.cpp
r721 r731 19 19 for (unsigned int i = 0; i < 1; i++) 20 20 { 21 mSampleConfigFile = new LBBC::SampleConfigFile(); 22 mSampleConfigFile->load(mOpts.cfg); 23 21 24 this->setup(false); 22 mLBBCManager = new LBBC::Manager(); 23 LBBC::SampleConfigFile *sampleConfigFile = new LBBC::SampleConfigFile(); 24 sampleConfigFile->load(mOpts.cfg); 25 mLBBCManager->setSampleConfigFile(sampleConfigFile); 25 mLBBCManager = new LBBC::LBBCManager(); 26 mLBBCManager->setSampleConfigFile(mSampleConfigFile); 26 27 //mLBBCManager->loadSampleConfigFile(mOpts.cfg); 27 28 mLBBCManager->runSampleConfigFile(); … … 33 34 this->setup(true); 34 35 this->go(); 36 for (unsigned int iFrameListenerMode = 0; iFrameListenerMode < mFrameListener->getNumFrameListenerModes(); iFrameListenerMode++) 37 { 38 mFrameListener->getFrameListenerMode(iFrameListenerMode)->destroyScene(); 39 } 35 40 mRoot->shutdown(); 36 41 mWindow->destroy(); 37 42 delete mRoot; 43 delete mSampleConfigFile; 38 44 } 45 39 46 } 40 47 … … 108 115 109 116 mSceneMgr = mFrameListener->getEnabledFrameListenerMode()->getSceneManager(); 117 110 118 { 111 LBBC::Cluster sViewMode *anotherFrameListenerMode;112 anotherFrameListenerMode = new LBBC::Cluster sViewMode(mWindow,mFrameListener->getNumFrameListenerModes());119 LBBC::ClusterViewMode *anotherFrameListenerMode; 120 anotherFrameListenerMode = new LBBC::ClusterViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 113 121 anotherFrameListenerMode->chooseSceneManager(); 114 122 anotherFrameListenerMode->createCamera(); … … 118 126 } 119 127 128 //{ 129 // LBBC::BillboardViewMode *anotherFrameListenerMode; 130 // anotherFrameListenerMode = new LBBC::BillboardViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 131 // anotherFrameListenerMode->chooseSceneManager(); 132 // anotherFrameListenerMode->createCamera(); 133 // anotherFrameListenerMode->createViewports(); 134 // anotherFrameListenerMode->createScene(); 135 // mFrameListener->addFrameListenerMode(anotherFrameListenerMode); 136 //} 137 120 138 { 121 LBBC::BillboardViewMode *anotherFrameListenerMode; 122 anotherFrameListenerMode = new LBBC::BillboardViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 123 anotherFrameListenerMode->chooseSceneManager(); 124 anotherFrameListenerMode->createCamera(); 125 anotherFrameListenerMode->createViewports(); 126 anotherFrameListenerMode->createScene(); 127 mFrameListener->addFrameListenerMode(anotherFrameListenerMode); 139 LBBC::EntityTextureAtlasViewMode *textureAtlasFrameListenerMode; 140 textureAtlasFrameListenerMode = new LBBC::EntityTextureAtlasViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 141 textureAtlasFrameListenerMode->chooseSceneManager(); 142 textureAtlasFrameListenerMode->createCamera(); 143 textureAtlasFrameListenerMode->createViewports(); 144 textureAtlasFrameListenerMode->setTextureAtlasSize(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasSize()); 145 textureAtlasFrameListenerMode->setTextureAtlasBitRange(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasBitRange()); 146 textureAtlasFrameListenerMode->setTextureAtlasNumSamples(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasNumSamples()); 147 textureAtlasFrameListenerMode->setTextureName(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTexturePrefixName()); 148 textureAtlasFrameListenerMode->setTextureAtlasName(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasPrefixName()); 149 textureAtlasFrameListenerMode->setTextureAtlasFolder(mSampleConfigFile->getBillboardCloudFolder()); 150 151 mFrameListener->addFrameListenerMode(textureAtlasFrameListenerMode); 152 textureAtlasFrameListenerMode->createScene(); 128 153 } 129 154 130 mFrameListener->setEnabledFrameListenerMode(1);131 155 mFrameListener->removeFrameListenerMode(0); 156 mFrameListener->setEnabledFrameListenerMode(0); 132 157 133 158 mRoot->addFrameListener(mFrameListener); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGBBox.cpp
r721 r731 6 6 BBox::BBox() 7 7 { 8 BBox:: StartBoundingBox();8 BBox::initialize(); 9 9 } 10 10 … … 13 13 } 14 14 15 void BBox:: StartBoundingBox()15 void BBox::initialize() 16 16 { 17 17 mMinimum.x = BOUNDINGBOX_MAXVALUE; … … 23 23 } 24 24 25 Ogre::Vector3 BBox:: GetMinimum()25 Ogre::Vector3 BBox::getMinimum() 26 26 { 27 27 return mMinimum; 28 28 } 29 29 30 Ogre::Vector3 BBox:: GetMaximum()30 Ogre::Vector3 BBox::getMaximum() 31 31 { 32 32 return mMaximum; 33 33 } 34 34 35 void BBox:: AddBoundingVector3(float x, float y, float z)35 void BBox::addBoundingVector3(float x, float y, float z) 36 36 { 37 37 if (x < mMinimum.x) … … 66 66 } 67 67 68 void BBox:: Print()68 void BBox::print() 69 69 { 70 70 Ogre::LogManager::getSingleton().logMessage("\nValor de la Caixa: (" + Ogre::StringConverter::toString(mMinimum) + ") - (" + + ") " + Ogre::StringConverter::toString(mMaximum)); 71 71 } 72 72 73 Ogre::Vector3 BBox:: GetCorner(int corner) const73 Ogre::Vector3 BBox::getCorner(int corner) const 74 74 { 75 75 Ogre::Vector3 vector; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGBox2d.cpp
r721 r731 18 18 } 19 19 20 Ogre::Vector2 Box2d:: GetMinimum()20 Ogre::Vector2 Box2d::getMinimum() 21 21 { 22 22 return mMinimum; 23 23 } 24 24 25 Ogre::Vector2 Box2d:: GetMaximum()25 Ogre::Vector2 Box2d::getMaximum() 26 26 { 27 27 return mMaximum; 28 28 } 29 29 30 void Box2d:: SetBoundBox(float x, float y, float X, float Y)30 void Box2d::setBoundBox(float x, float y, float X, float Y) 31 31 { 32 32 mMinimum.x = x; … … 36 36 } 37 37 38 void Box2d:: AddBoundingVector3(float x, float y)38 void Box2d::addBoundingVector3(float x, float y) 39 39 { 40 40 if (x < mMinimum.x) … … 59 59 } 60 60 61 void Box2d:: Print()61 void Box2d::print() 62 62 { 63 63 Ogre::LogManager::getSingleton().logMessage("Valor de la Caixa: (" + Ogre::StringConverter::toString(Ogre::Vector3(mMinimum.x, mMinimum.y, 0)) + ") - (" + Ogre::StringConverter::toString(Ogre::Vector3(mMaximum.x, mMaximum.y, 0)) + ")"); 64 64 } 65 65 66 Ogre::Vector2 Box2d:: GetCorner(int corner) const66 Ogre::Vector2 Box2d::getCorner(int corner) const 67 67 { 68 68 Ogre::Vector2 vector; … … 79 79 } 80 80 81 bool Box2d:: In(int w, int h)81 bool Box2d::in(int w, int h) 82 82 { 83 83 if (w <= (mMaximum.x - mMinimum.x) && h <= (mMaximum.y - mMinimum.y)) … … 89 89 } 90 90 91 bool Box2d:: FitPerfect(int w, int h)91 bool Box2d::fitPerfect(int w, int h) 92 92 { 93 93 if (w == (mMaximum.x - mMinimum.x) && h == (mMaximum.y - mMinimum.y)) -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGBsp.cpp
r721 r731 14 14 } 15 15 16 void Bsp:: SetRoot(NodeBspPtr node)16 void Bsp::setRoot(NodeBspPtr node) 17 17 { 18 18 root = node; … … 20 20 } 21 21 22 void Bsp:: Print()22 void Bsp::print() 23 23 { 24 24 Ogre::LogManager::getSingleton().logMessage("\nImprimint Arbre BSP, num nodes leaf: " + Ogre::StringConverter::toString(countleaf) + ", totals: " + Ogre::StringConverter::toString(counttotal)); 25 Print(root);25 print(root); 26 26 } 27 27 28 void Bsp:: PrintLeaf()28 void Bsp::printLeaf() 29 29 { 30 PrintLeaf(root);30 printLeaf(root); 31 31 } 32 32 33 NodeBspPtr Bsp:: Insert(int w, int h, int idcluster)33 NodeBspPtr Bsp::insert(int w, int h, int idcluster) 34 34 { 35 NodeBspPtr node = root-> Insert(w,h);35 NodeBspPtr node = root->insert(w,h); 36 36 37 37 if (idcluster != -1) 38 38 { 39 node-> SetId(idcluster);39 node->setId(idcluster); 40 40 countleaf++; 41 41 } … … 48 48 } 49 49 50 NodeBspPtr Bsp:: Get(int i)50 NodeBspPtr Bsp::get(int i) 51 51 { 52 return root-> Get(root, i);52 return root->get(root, i); 53 53 } 54 54 55 void Bsp:: Print(NodeBspPtr node)55 void Bsp::print(NodeBspPtr node) 56 56 { 57 node-> Print();58 Print(node->GetChild(0));59 Print(node->GetChild(1));57 node->print(); 58 this->print(node->getChild(0)); 59 this->print(node->getChild(1)); 60 60 } 61 61 62 void Bsp:: PrintLeaf(NodeBspPtr node)62 void Bsp::printLeaf(NodeBspPtr node) 63 63 { 64 if (node-> GetChild(0) == NULL && node->GetChild(1) == NULL)64 if (node->getChild(0) == NULL && node->getChild(1) == NULL) 65 65 { 66 node-> Print();66 node->print(); 67 67 } 68 68 69 PrintLeaf (node->GetChild(0));70 PrintLeaf (node->GetChild(1));69 printLeaf(node->getChild(0)); 70 printLeaf(node->getChild(1)); 71 71 } 72 72 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGCluster.cpp
r721 r731 13 13 } 14 14 15 void Cluster:: SetNormal(Ogre::Vector3* n)15 void Cluster::setNormal(Ogre::Vector3* n) 16 16 { 17 17 normal = *n; 18 18 } 19 19 20 Ogre::Vector3* Cluster:: GetNormal()20 Ogre::Vector3* Cluster::getNormal() 21 21 { 22 22 return &normal; 23 23 } 24 24 25 BBox* Cluster:: GetBound()25 BBox* Cluster::getBound() 26 26 { 27 27 return &bound; 28 28 } 29 29 30 Box2d* Cluster:: GetBspNodeBound()30 Box2d* Cluster::getBspNodeBound() 31 31 { 32 32 return &bspnodebound; 33 33 } 34 34 35 void Cluster:: SetBspNodeBound(Box2d* box)35 void Cluster::setBspNodeBound(Box2d* box) 36 36 { 37 37 bspnodebound = (*box); 38 38 } 39 39 40 int Cluster:: GetId() const40 int Cluster::getId() const 41 41 { 42 42 return id; 43 43 } 44 44 45 void Cluster:: SetId(int id_)45 void Cluster::setId(int id_) 46 46 { 47 47 id = id; 48 48 } 49 49 50 std::vector<Ogre::Vector3>* Cluster::GetVector3sVector()50 std::vector<Ogre::Vector3>* Cluster::getVector3sVector() 51 51 { 52 52 return &Vector3s_vector; 53 53 } 54 54 55 Ogre::Vector3* Cluster:: GetVector3sTex() const55 Ogre::Vector3* Cluster::getVector3sTex() const 56 56 { 57 57 return Vector3s_triangle_text; 58 58 } 59 59 60 void Cluster:: SetPlane(Ogre::Vector3* normal, Ogre::Vector3 * point)60 void Cluster::setPlane(Ogre::Vector3* normal, Ogre::Vector3 * point) 61 61 { 62 62 plane.normal = *normal; … … 65 65 } 66 66 67 Plane3 * Cluster:: GetPlane()67 Plane3 * Cluster::getPlane() 68 68 { 69 69 return &plane; … … 108 108 } 109 109 110 void Cluster:: Print()110 void Cluster::print() 111 111 { 112 112 Ogre::LogManager::getSingleton().logMessage("\n\nCluster: " + Ogre::StringConverter::toString(id) + ", axisproj: " + Ogre::StringConverter::toString(axisproj) + ", order: " + Ogre::StringConverter::toString(order)); 113 113 114 plane. Print();114 plane.print(); 115 115 Ogre::LogManager::getSingleton().logMessage("\nOrigin (" + Ogre::StringConverter::toString(lumel_origin) + ")"); 116 116 Ogre::LogManager::getSingleton().logMessage("Inc U (" + Ogre::StringConverter::toString(lumel_x_axis) + ")"); 117 117 Ogre::LogManager::getSingleton().logMessage("Inc V (" + Ogre::StringConverter::toString(lumel_y_axis.z) + ")"); 118 118 119 bound. Print();120 121 bspnodebound. Print();119 bound.print(); 120 121 bspnodebound.print(); 122 122 123 123 Ogre::LogManager::getSingleton().logMessage("Printant els vertexs: "); … … 125 125 126 126 //* return the dominant normal axis, for calculate the 2d projection 127 int Cluster:: AxisProjected() {128 129 Ogre::Vector3 *normal = plane. GetNormal();127 int Cluster::axisProjected() 128 { 129 Ogre::Vector3 *normal = plane.getNormal(); 130 130 131 131 if (Ogre::Math::Abs(normal->x) >= Ogre::Math::Abs(normal->y) && Ogre::Math::Abs(normal->x) >= Ogre::Math::Abs(normal->z)) … … 143 143 } 144 144 145 void Cluster:: Finish()145 void Cluster::finish() 146 146 { 147 147 Ogre::LogManager::getSingleton().logMessage("\nCluster::Finish()"); 148 Plane3 *plane = GetPlane();149 Ogre::Vector3 normal = *plane-> GetNormal();150 float distance = plane-> GetDistance();148 Plane3 *plane = getPlane(); 149 Ogre::Vector3 normal = *plane->getNormal(); 150 float distance = plane->getDistance(); 151 151 Ogre::Vector3 corner; 152 152 Cluster2d cluster2d; 153 153 Ogre::Vector3 vertexfinal[3]; 154 Ogre::Vector2 *vertexs2d;155 154 int num_vertexs = 4; 156 //Box box;157 155 Ogre::Vector3 min; 158 156 Ogre::Vector3 max; 159 float num, den;160 157 bool type = true; 161 158 162 159 Ogre::LogManager::getSingleton().logMessage("\tCreant cluster 2d"); 163 axisproj = cluster2d. Create2d (this, 0, true);160 axisproj = cluster2d.create2d (this, 0, true); 164 161 Ogre::LogManager::getSingleton().logMessage("\t Imprimint el que hi al del cluster"); 165 162 166 163 std::vector<Ogre::Vector2> vector2; 167 vector2 =*cluster2d. GetVector3sVector();164 vector2 =*cluster2d.getVector3sVector(); 168 165 169 166 for (unsigned int i = 0; i < vector2.size(); i++) 170 167 { 171 bound. AddBoundingVector3 (vector2[i].x, vector2[i].y, 0);172 } 173 174 min = bound. GetMinimum();175 max = bound. GetMaximum();168 bound.addBoundingVector3 (vector2[i].x, vector2[i].y, 0); 169 } 170 171 min = bound.getMinimum(); 172 max = bound.getMaximum(); 176 173 177 174 Ogre::LogManager::getSingleton().logMessage("Caixa Englobant del cluster 2d"); 178 bound. Print();175 bound.print(); 179 176 180 177 Ogre::Vector3 aux (-9999,-9999,-9999); … … 184 181 185 182 //* Return the increment in U (lumel increment in x). For patchs calculation 186 Ogre::Vector3 Cluster:: GetIncU()183 Ogre::Vector3 Cluster::getIncU() 187 184 { 188 185 return lumel_x_axis; … … 190 187 191 188 //* Return the increment in V (lumel increment in x). For patchs calculation 192 Ogre::Vector3 Cluster:: GetIncV()189 Ogre::Vector3 Cluster::getIncV() 193 190 { 194 191 return lumel_y_axis; 195 192 } 196 193 197 Ogre::Vector3 Cluster:: GetOrigin()194 Ogre::Vector3 Cluster::getOrigin() 198 195 { 199 196 return lumel_origin; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGCluster2d.cpp
r721 r731 13 13 } 14 14 15 Ogre::Vector2 * Cluster2d:: GetVector3s()15 Ogre::Vector2 * Cluster2d::getVector3s() 16 16 { 17 17 return Vector3s; 18 18 } 19 19 20 std::vector<Ogre::Vector2> * Cluster2d:: GetVector3sVector()20 std::vector<Ogre::Vector2> * Cluster2d::getVector3sVector() 21 21 { 22 22 return &Vector3s2_vector; 23 23 } 24 24 25 Ogre::Vector3 * Cluster2d:: GetNormal()25 Ogre::Vector3 * Cluster2d::getNormal() 26 26 { 27 27 return normal; … … 31 31 // 32 32 // 33 int Cluster2d:: Create2d(Cluster * cluster, int type, int type_vertexs)33 int Cluster2d::create2d(Cluster * cluster, int type, int type_vertexs) 34 34 { 35 35 if (!cluster) … … 38 38 } 39 39 40 int axis = cluster-> AxisProjected();40 int axis = cluster->axisProjected(); 41 41 42 42 this->cluster = cluster; … … 45 45 } 46 46 47 void Cluster2d:: Print()47 void Cluster2d::print() 48 48 { 49 printf("\nPrintant cluster2d: %d", id);49 Ogre::LogManager::getSingleton().logMessage("Printant cluster2d: " + Ogre::StringConverter::toString(id)); 50 50 } 51 51 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGClusterList.cpp
r721 r731 9 9 } 10 10 11 bool ClusterList:: Insert(Cluster * p)11 bool ClusterList::insert(Cluster * p) 12 12 { 13 13 if (!p) … … 21 21 } 22 22 23 void ClusterList:: Print()23 void ClusterList::print() 24 24 { 25 25 Ogre::LogManager::getSingleton().logMessage("nNombre de cluster a la llista: " + Ogre::StringConverter::toString(list.size())); 26 26 27 for (register int i = 0; i < list.size(); i ++) 27 28 { 28 Get(i)->Print();29 this->get(i)->print(); 29 30 } 30 31 } … … 35 36 } 36 37 37 std::vector<Cluster> * ClusterList:: GetList()38 std::vector<Cluster> * ClusterList::getList() 38 39 { 39 40 return &list; 40 41 } 41 42 42 unsigned int ClusterList:: GetSize() const43 unsigned int ClusterList::getSize() const 43 44 { 44 45 return list.size(); 45 46 } 46 47 47 Cluster * ClusterList:: Get(unsigned int i)48 Cluster * ClusterList::get(unsigned int i) 48 49 { 49 50 if (i <= list.size()) -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGNodeBsp.cpp
r721 r731 15 15 } 16 16 17 void NodeBsp:: SetBound(Box2d * box)17 void NodeBsp::setBound(Box2d * box) 18 18 { 19 19 bound = (*box); 20 20 } 21 21 22 NodeBspPtr NodeBsp:: GetChild(int i)22 NodeBspPtr NodeBsp::getChild(int i) 23 23 { 24 24 return child[i]; 25 25 } 26 26 27 void NodeBsp:: SetId(int id_)27 void NodeBsp::setId(int id_) 28 28 { 29 29 id = id_; 30 30 } 31 31 32 unsigned int NodeBsp:: GetId() const32 unsigned int NodeBsp::getId() const 33 33 { 34 34 return id; 35 35 } 36 36 37 void NodeBsp:: SetChild(NodeBspPtr node, int i)37 void NodeBsp::setChild(NodeBspPtr node, int i) 38 38 { 39 39 child[i] = node; 40 40 } 41 41 42 NodeBspPtr NodeBsp:: Get(NodeBspPtr node, int i)42 NodeBspPtr NodeBsp::get(NodeBspPtr node, int i) 43 43 { 44 44 if (!node) … … 47 47 } 48 48 49 if (node-> GetId() == i )49 if (node->getId() == i ) 50 50 { 51 51 return node; … … 53 53 54 54 NodeBspPtr nod; 55 if (nod = node-> GetChild(0)->Get(node->GetChild(0), i))55 if (nod = node->getChild(0)->get(node->getChild(0), i)) 56 56 { 57 57 return nod; 58 58 } 59 59 60 return node-> GetChild(0)->Get(node->GetChild(1), i);60 return node->getChild(0)->get(node->getChild(1), i); 61 61 } 62 62 63 63 64 Box2d * NodeBsp:: GetBound()64 Box2d * NodeBsp::getBound() 65 65 { 66 66 return &bound; 67 67 } 68 68 69 void NodeBsp:: Print()69 void NodeBsp::print() 70 70 { 71 71 Ogre::LogManager::getSingleton().logMessage("Node : " + Ogre::StringConverter::toString(id) + ", fit: " + Ogre::StringConverter::toString(fit)); 72 72 73 bound. Print();73 bound.print(); 74 74 } 75 75 76 NodeBspPtr NodeBsp:: Insert(int w, int h)76 NodeBspPtr NodeBsp::insert(int w, int h) 77 77 { 78 78 //Ogre::LogManager::getSingleton().logMessage("\nInsert del node: :" + Ogre::StringConverter::toString(id) + " (" + Ogre::StringConverter::toString(w) + ", " + Ogre::StringConverter::toString(h)); … … 85 85 if (this->child[0] != NULL && this->child[1] != NULL) 86 86 { 87 NodeBspPtr new_node = child[0]-> Insert(w, h);87 NodeBspPtr new_node = child[0]->insert(w, h); 88 88 89 89 if (new_node) return new_node; 90 90 91 return child[1]-> Insert(w,h);91 return child[1]->insert(w,h); 92 92 } 93 93 94 if (!bound. In(w,h))94 if (!bound.in(w,h)) 95 95 { 96 96 return NULL; 97 97 } 98 98 99 if (bound. FitPerfect(w,h))99 if (bound.fitPerfect(w,h)) 100 100 { 101 101 fit = true; return this; … … 109 109 float width, height; 110 110 111 bound. Print();112 min = bound. GetMinimum();113 max = bound. GetMaximum();111 bound.print(); 112 min = bound.getMinimum(); 113 max = bound.getMaximum(); 114 114 115 115 width = max.x - min.x; … … 121 121 if (dw > dh) 122 122 { 123 child[0]->bound. SetBoundBox(min.x, min.y, min.x + w, max.y);124 child[1]->bound. SetBoundBox(min.x + w, min.y, max.x, max.y);123 child[0]->bound.setBoundBox(min.x, min.y, min.x + w, max.y); 124 child[1]->bound.setBoundBox(min.x + w, min.y, max.x, max.y); 125 125 } 126 126 else 127 127 { 128 child[0]->bound. SetBoundBox(min.x, max.y - h, max.x, max.y);129 child[1]->bound. SetBoundBox(min.x, min.y, max.x, max.y - h);128 child[0]->bound.setBoundBox(min.x, max.y - h, max.x, max.y); 129 child[1]->bound.setBoundBox(min.x, min.y, max.x, max.y - h); 130 130 } 131 131 132 return child[0]-> Insert(w, h);132 return child[0]->insert(w, h); 133 133 } 134 134 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGPlane3.cpp
r721 r731 21 21 } 22 22 23 Ogre::Vector3 * Plane3:: GetNormal()23 Ogre::Vector3 * Plane3::getNormal() 24 24 { 25 25 Ogre::Vector3 *v = new Ogre::Vector3; … … 30 30 } 31 31 32 void Plane3:: SetNormal(float x, float y, float z)32 void Plane3::setNormal(float x, float y, float z) 33 33 { 34 34 normal.x = x; … … 37 37 } 38 38 39 void Plane3:: SetDistance(float dist)39 void Plane3::setDistance(float dist) 40 40 { 41 41 d = dist; 42 42 } 43 43 44 float Plane3:: GetDistance() const44 float Plane3::getDistance() const 45 45 { 46 46 return d; 47 47 } 48 48 49 void Plane3:: Print()49 void Plane3::print() 50 50 { 51 51 Ogre::LogManager::getSingleton().logMessage("Printant pla: (" + Ogre::StringConverter::toString(normal) + Ogre::StringConverter::toString(d) + ")"); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGTexture.cpp
r721 r731 2 2 #include "IMGTexture.h" 3 3 4 namespace IMG { 4 namespace IMG 5 { 5 6 6 Texture::Texture() 7 Texture::Texture(): references(0) // initialize references to 0 8 { 9 mTexture = 0; 10 mWidth = 0; 11 mHeight = 0; 12 mMaterial = 0; 13 mCalculatedAvgColour = false; 14 mRectangle2D = new Ogre::Rectangle2D(true); 15 mRectangle2D->setBoundingBox(Ogre::AxisAlignedBox(-100000.0 * Ogre::Vector3::UNIT_SCALE, 100000.0 * Ogre::Vector3::UNIT_SCALE)); 16 mRectangle2D->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY); 17 } 18 19 Texture::~Texture() 20 { 21 // Gametools -- BUG: 06/04/2006 22 //if (mRectangle2D) 23 //{ 24 // delete mRectangle2D; 25 //} 26 27 //if (mMaterial) 28 //{ 29 // delete mMaterial; 30 //} 31 } 32 33 Ogre::Rectangle2D* Texture::getRectangle2D() 34 { 35 return mRectangle2D; 36 } 37 38 void Texture::setCorners(Ogre::Real left, Ogre::Real top, Ogre::Real right, Ogre::Real bottom) 39 { 40 mRectangle2D->setCorners(left, top, right, bottom); 41 } 42 43 void Texture::bind(Ogre::String textureName) 44 { 45 if (!Ogre::TextureManager::getSingleton().getByName(textureName).isNull()) 7 46 { 47 mTexture = (Ogre::Texture*) Ogre::TextureManager::getSingleton().getByName(textureName).getPointer(); 48 mWidth = mTexture->getSrcWidth(); 49 mHeight = mTexture->getSrcHeight(); 50 } 51 else 52 { 53 Ogre::TexturePtr tPtr = Ogre::TextureManager::getSingleton().load(textureName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 54 55 mTexture = (Ogre::Texture*) tPtr.getPointer(); 56 mWidth = mTexture->getSrcWidth(); 57 mHeight = mTexture->getSrcHeight(); 58 } 59 } 60 61 void Texture::setBackgroundColour(Ogre::ColourValue colour) 62 { 63 mBackgroundColour = colour; 64 } 65 66 Ogre::ColourValue Texture::getBackgroundColour() 67 { 68 return mBackgroundColour; 69 } 70 71 Ogre::ColourValue Texture::getAvgColour() 72 { 73 if (mCalculatedAvgColour) 74 { 75 return mAvgColour; 76 } 77 else 78 { 79 calculateAvgColour(); 80 return mAvgColour; 81 } 82 } 83 84 void Texture::calculateAvgColour() 85 { 86 unsigned int cR = 0; 87 unsigned int cG = 0; 88 unsigned int cB = 0; 89 unsigned int cA = 0; 90 91 Ogre::Image img; 92 img.load(mTexture->getName(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 93 unsigned char* data = static_cast<unsigned char*>(img.getData()); 94 95 unsigned int nColorpixels = 1; 96 97 for (unsigned int i = 0; i < mTexture->getWidth() * mTexture->getHeight() * 4; i=i+4) 98 { 99 cA = (unsigned short int)data[i+3]; 100 if (cA != 0) 101 { 102 cB = cB + data[i+2]; 103 cG = cG + data[i+1]; 104 cR = cR + data[i]; 105 106 nColorpixels++; 107 //Ogre::LogManager::getSingleton().logMessage("(" + Ogre::StringConverter::toString(data[i]) + "," + Ogre::StringConverter::toString(data[i+1]) + "," + Ogre::StringConverter::toString(data[i+2]) + "," + Ogre::StringConverter::toString(data[i+3]) + ")"); 108 } 8 109 } 9 110 10 virtual Texture::~Texture() 11 {12 }111 cR = cR / nColorpixels; 112 cG = cG / nColorpixels; 113 cB = cB / nColorpixels; 13 114 14 void Texture::setTextureHandle(unsigned int textureHandle) 15 { 16 mTextureHandle = textureHandle; 17 } 115 mAvgColour = Ogre::ColourValue(cR/255.0, cG/255.0, cB/255.0, 0.0); 116 mCalculatedAvgColour = true; 117 } 18 118 19 unsigned int Texture::getTextureHandle() 20 { 21 return mTextureHandle; 22 } 119 void Texture::load(Ogre::String folderName, Ogre::String fileName) 120 { 121 Ogre::TextureManager::getSingleton().load(fileName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 122 mTexture = (Ogre::Texture*)Ogre::TextureManager::getSingleton().getByName(fileName).getPointer(); 123 mWidth = mTexture->getSrcWidth(); 124 mHeight = mTexture->getSrcHeight(); 125 } 23 126 24 Ogre::String Texture::getMaterialName() 25 { 26 return mMaterialName; 27 } 127 void Texture::save(Ogre::String folderName, Ogre::String filename) 128 { 129 Ogre::HardwarePixelBufferSharedPtr readbuffer; 130 readbuffer = mTexture->getBuffer(0, 0); 131 unsigned char *tex = new unsigned char[readbuffer->getSizeInBytes()]; 132 Ogre::PixelBox *pBox = new Ogre::PixelBox(mTexture->getWidth(), mTexture->getHeight(), mTexture->getDepth(), mTexture->getFormat(), tex); 133 readbuffer->blitToMemory((*pBox)); 134 135 Ogre::Image img; 136 img = img.loadDynamicImage(tex, mTexture->getWidth(), mTexture->getHeight(), mTexture->getDepth(), mTexture->getFormat(), true, 1, 0); 137 img.resize(mWidth, mHeight); 138 img.save(folderName + filename); 139 delete pBox; 140 } 28 141 29 void Texture::setMaterialName(Ogre::String materialName)30 31 mMaterialName = materialName;32 142 void Texture::rotate(Ogre::Real rRotation) 143 { 144 //mTexture->setTextureRotate( Degree( -rRotation ) ); 145 } 33 146 34 35 36 37 147 void Texture::setWidth(unsigned int width) 148 { 149 mWidth = width; 150 } 38 151 39 40 41 42 152 unsigned int Texture::getWidth() 153 { 154 return mWidth; 155 } 43 156 44 45 46 47 157 void Texture::setHeight(unsigned int height) 158 { 159 mHeight = height; 160 } 48 161 49 50 51 52 162 unsigned int Texture::getHeight() 163 { 164 return mHeight; 165 } 53 166 54 void Texture::setRenderTargetName(Ogre::String renderTargetName)55 56 mRenderTargetName = renderTargetName;57 167 void Texture::setTextureName(Ogre::String textureName) 168 { 169 mTextureName = textureName; 170 } 58 171 59 Ogre::String Texture::getRenderTarget()60 61 return mRenderTargetName;62 172 Ogre::String Texture::getTextureName() 173 { 174 return mTextureName; 175 } 63 176 64 void Texture::setTextureName(Ogre::String textureName) 65 { 66 mTextureName = textureName; 67 } 177 void Texture::setMaterial(Ogre::Material *material) 178 { 179 mMaterial = material; 180 mRectangle2D->setMaterial(mMaterial->getName()); 181 } 68 182 69 Ogre::String Texture::getTextureName()70 71 return mTextureName;72 183 Ogre::Material* Texture::getMaterial() 184 { 185 return mMaterial; 186 } 73 187 74 188 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGTextureAtlas.cpp
r721 r731 4 4 namespace IMG { 5 5 6 TextureAtlas::TextureAtlas() 6 TextureAtlas::TextureAtlas(): references(0) // initialize references to 0 7 { 8 mRectangle2D->setBoundingBox(Ogre::AxisAlignedBox(-100000.0 * Ogre::Vector3::UNIT_SCALE, 100000.0 * Ogre::Vector3::UNIT_SCALE)); 9 mRectangle2D->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND); 10 } 11 12 TextureAtlas::~TextureAtlas() 13 { 14 mTextureList.clear(); 15 } 16 17 unsigned int TextureAtlas::getReference() 18 { 19 return references; 20 } 21 22 void TextureAtlas::setTextureAtlasName(Ogre::String textureAtlasName) 23 { 24 mTextureAtlasName = textureAtlasName; 25 } 26 27 Ogre::String TextureAtlas::getTextureAtlasName() 28 { 29 return mTextureAtlasName; 30 } 31 32 void TextureAtlas::addTexture(TexturePtr texture) 33 { 34 mTextureList.push_back(texture); 35 mTextureAtlasSceneNode->attachObject(texture->getRectangle2D()); 36 } 37 38 TexturePtr TextureAtlas::getTexture(unsigned int iTexture) 39 { 40 return mTextureList[iTexture]; 41 } 42 43 void TextureAtlas::removeTexture(unsigned int iTexture) 44 { 45 mTextureList.erase(mTextureList.begin()+iTexture); 46 } 47 48 unsigned int TextureAtlas::getNumTextures() 49 { 50 return mTextureList.size(); 51 } 52 53 void TextureAtlas::setTextureAtlasSceneNode(Ogre::SceneNode *textureAtlasSceneNode) 54 { 55 mTextureAtlasSceneNode = textureAtlasSceneNode; 56 mTextureAtlasSceneNode->attachObject(mRectangle2D); 57 } 58 59 Ogre::SceneNode* TextureAtlas::getTextureAtlasSceneNode() 60 { 61 return mTextureAtlasSceneNode; 62 } 63 64 void TextureAtlas::setCamera(Ogre::Camera *camera) 65 { 66 mCamera = camera; 67 } 68 69 void TextureAtlas::update() 70 { 71 mTexture->getBuffer(0, 0)->getRenderTarget()->update(); 72 } 73 74 void TextureAtlas::save(Ogre::String folderName, Ogre::String fileName, Ogre::PixelFormat pixelFormat) 75 { 76 unsigned char* pBufferBox = new unsigned char[mTexture->getBuffer(0, 0)->getSizeInBytes()]; 77 unsigned char* pBufferDest = new unsigned char[mTexture->getBuffer(0, 0)->getSizeInBytes()]; 78 79 // Read pixels 80 Ogre::PixelBox pBox(mWidth, mHeight, 1, mPixelFormat, pBufferBox); 81 Ogre::PixelBox pDest(mWidth, mHeight, 1, pixelFormat, pBufferDest); 82 mTexture->getBuffer(0, 0)->blitToMemory(pBox); 83 Ogre::PixelUtil::bulkPixelConversion(pBox.data,mPixelFormat,pDest.data,pixelFormat,pBox.getWidth()*pBox.getHeight()); 84 85 //if (pixelFormat == Ogre::PF_FLOAT32_RGBA) 86 //{ 87 // imdebug("rgba w=%d h=%d %p b=32f",pDest.getWidth(),pDest.getHeight(),pDest.data); 88 //} 89 90 // copyToMemory 91 Ogre::ImageCodec::ImageData *imgData = new Ogre::ImageCodec::ImageData(); 92 93 imgData->width = mWidth; 94 imgData->height = mHeight; 95 imgData->depth = 1; 96 imgData->format = pixelFormat; 97 98 // Wrap buffer in a chunk 99 Ogre::MemoryDataStreamPtr stream(new Ogre::MemoryDataStream(pBufferDest, mTexture->getBuffer(0, 0)->getSizeInBytes(), false)); 100 101 // Get codec 102 size_t pos = fileName.find_last_of("."); 103 Ogre::String extension; 104 if( pos == Ogre::String::npos ) 7 105 { 106 OGRE_EXCEPT(Ogre::Exception::ERR_INVALIDPARAMS, "Unable to determine image type for '" + fileName + "' - invalid extension.", "GLRenderTexture::writeContentsToFile" ); 8 107 } 9 108 10 virtual TextureAtlas::~TextureAtlas()109 while( pos != fileName.length() - 1 ) 11 110 { 111 extension += fileName[++pos]; 12 112 } 13 113 14 void TextureAtlas::setRenderSourceName(Ogre::String renderSourceName) 15 { 16 mRenderSourceName = renderSourceName; 17 } 114 // Get the codec 115 Ogre::Codec * pCodec = Ogre::Codec::getCodec(extension); 18 116 19 Ogre::String TextureAtlas::getRenderSourceName() 20 { 21 return mRenderSourceName; 22 } 117 // Write out 118 Ogre::Codec::CodecDataPtr codecDataPtr(imgData); 23 119 24 void TextureAtlas::setRenderSourceName(Ogre::String renderSourceName) 25 { 26 mRenderSourceName = renderSourceName; 27 } 120 pCodec->codeToFile(stream,folderName + fileName, codecDataPtr); 28 121 29 void TextureAtlas::addTexture(Texture *texture) 30 { 31 mTextureList.push_back(texture); 32 } 122 delete [] pBufferDest; 123 delete [] pBufferBox; 124 } 33 125 34 void TextureAtlas::getTexture(unsigned int iTexture)35 36 return mTextureList[iTexture];37 126 void TextureAtlas::setFormat(Ogre::PixelFormat pixelFormat) 127 { 128 mPixelFormat = pixelFormat; 129 } 38 130 39 void TextureAtlas::removeTexture(unsigned int iTexture) 40 { 41 Texture *texture = mTextureList[iTexture]; 42 mTextureList.erase(mTextureList.begin()+iTexture); 43 delete texture; 44 } 131 void TextureAtlas::create(Ogre::String fileName, unsigned int width, unsigned int height, Ogre::PixelFormat pixelFormat, Ogre::Camera *camera) 132 { 133 mCamera = camera; 134 mWidth = width; 135 mHeight = height; 136 mPixelFormat = pixelFormat; 137 mTexture = Ogre::TextureManager::getSingleton().createManual(fileName, "General", Ogre::TEX_TYPE_2D, mWidth, mHeight, 0, mPixelFormat, Ogre::TU_RENDERTARGET).getPointer(); 138 mTexture->getBuffer(0, 0)->getRenderTarget(); 139 Ogre::RenderTexture *rt = mTexture->getBuffer()->getRenderTarget(); 140 rt->setAutoUpdated(false); 141 Ogre::Viewport *v = rt->addViewport(mCamera); 142 v->setClearEveryFrame(true); 143 v->setBackgroundColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f, 0.0f)); 144 v->setOverlaysEnabled(false); 145 v->setDimensions(0,0,1.0,1.0); 146 Ogre::Root::getSingleton().getRenderSystem()->clearFrameBuffer(Ogre::FBT_COLOUR, Ogre::ColourValue(1.0f,1.0f,1.0f,0.0f) ); 147 } 45 148 46 unsigned int TextureAtlas::getNumTextures()47 {48 return mTextureList.size();49 }50 149 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCBillboardKMeansClusterData.cpp
r721 r731 36 36 TiXmlNode *quadBottomRightCornerNode; 37 37 TiXmlNode *quadBottomLeftCornerNode; 38 TiXmlNode *axisXNode;39 38 TiXmlNode *axisYNode; 40 39 TiXmlNode *axisZNode; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCClusterViewMode.cpp
r721 r731 1 1 2 #include "LBBCCluster sViewMode.h"2 #include "LBBCClusterViewMode.h" 3 3 4 4 namespace LBBC { -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCManager.cpp
r721 r731 4 4 namespace LBBC { 5 5 6 Manager::Manager()7 : BBC:: Manager()6 LBBCManager::LBBCManager() 7 : BBC::BBCManager() 8 8 { 9 9 mBillboardCloudSerializer = new KMeansClusterSerializer(); … … 15 15 } 16 16 17 Manager::~Manager()17 LBBCManager::~LBBCManager() 18 18 { 19 19 if (mOgreMeshSerializer) … … 21 21 delete mOgreMeshSerializer; 22 22 } 23 if (mSampleConfigFile) 24 { 25 delete mSampleConfigFile; 26 } 23 // Gametools -- BUG: 06/04/2006 24 //if (mSampleConfigFile) 25 //{ 26 // delete mSampleConfigFile; 27 //} 27 28 if (mLeafDistributionSerializer) 28 29 { … … 52 53 } 53 54 54 SampleConfigFile* Manager::getSampleConfigFile()55 SampleConfigFile* LBBCManager::getSampleConfigFile() 55 56 { 56 57 return mSampleConfigFile; 57 58 } 58 59 59 void Manager::setSampleConfigFile(SampleConfigFile *sampleConfigFile)60 void LBBCManager::setSampleConfigFile(SampleConfigFile *sampleConfigFile) 60 61 { 61 62 mSampleConfigFile = sampleConfigFile; 62 63 } 63 64 64 void Manager::loadSampleConfigFile(Ogre::String sampleConfigFile)65 void LBBCManager::loadSampleConfigFile(Ogre::String sampleConfigFile) 65 66 { 66 67 mSampleConfigFile = new SampleConfigFile(); … … 68 69 } 69 70 70 void Manager::runSampleConfigFile()71 void LBBCManager::runSampleConfigFile() 71 72 { 72 73 mLeaves = new Leaves(); 73 74 74 75 BBC::EntityPtr entityLeaves(new BBC::Entity); 75 BBC::MeshPtr meshLeaves(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefix Filename() + ".mesh")) );76 BBC::MeshPtr meshLeaves(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefixName() + ".mesh")) ); 76 77 entityLeaves->setMesh(meshLeaves); 77 78 mLeaves->setEntity(entityLeaves); … … 87 88 } 88 89 90 if (mSampleConfigFile->getEntitySampleMeshGeneration()) 91 { 92 saveSingleEntity(); 93 } 94 89 95 if (mSampleConfigFile->getEntityClustersGeneration()) 90 96 { … … 96 102 generateBillboardCloud(); 97 103 } 98 } 99 100 void Manager::createEntityDistribution() 104 105 } 106 107 void LBBCManager::createEntityDistribution() 101 108 { 102 109 mLeafDistributionGenerator->setDistribution(mLeaves->getDistribution()); … … 105 112 } 106 113 107 void Manager::saveEntityDistributionSplitted()114 void LBBCManager::saveEntityDistributionSplitted() 108 115 { 109 116 BBC::EntityPtr entity; … … 143 150 mOgreMeshSerializer->setEntity(entity); 144 151 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityClustersFolder() + 145 mSampleConfigFile->getEntityClustersMeshPrefix Filename() + "Splitted.mesh", false, false);152 mSampleConfigFile->getEntityClustersMeshPrefixName() + "Splitted.mesh", false, false); 146 153 147 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entity->getMesh()->get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitiesMeshPrefix Filename() + "Splitted.mesh");148 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh().get(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntitiesMeshPrefix Filename() + "Splitted.mesh" + ".xml");154 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entity->getMesh()->get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitiesMeshPrefixName() + "Splitted.mesh"); 155 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh().get(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntitiesMeshPrefixName() + "Splitted.mesh" + ".xml"); 149 156 } 150 157 } … … 157 164 mOgreMeshSerializer->setEntity(entity); 158 165 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityClustersFolder() + 159 mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh", false, false); 160 161 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh((Ogre::Mesh*)entity->getMesh().get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Merged.mesh"); 162 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Merged.mesh" + ".xml"); 163 164 //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getEntitiesMeshPrefixFilename() + "Merged.mesh"); 165 } 166 } 167 168 void Manager::saveEntityDistributionXML() 166 mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh", false, false); 167 168 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh((Ogre::Mesh*)entity->getMesh().get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitiesMeshPrefixName() + "Merged.mesh"); 169 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntitiesMeshPrefixName() + "Merged.mesh" + ".xml"); 170 } 171 } 172 173 void LBBCManager::saveEntityDistributionXML() 169 174 { 170 175 TiXmlDocument *document = mLeafDistributionSerializer->create( 171 176 mSampleConfigFile->getEntityDistributionFolder() + 172 mSampleConfigFile->getEntityDistributionXMLPrefix Filename() + ".xml");177 mSampleConfigFile->getEntityDistributionXMLPrefixName() + ".xml"); 173 178 mLeafDistributionSerializer->setLeafDistribution(mLeaves->getDistribution()); 174 179 mLeafDistributionSerializer->writeLeafDistribution(document); … … 176 181 } 177 182 178 void Manager::loadEntityDistribution()183 void LBBCManager::loadEntityDistribution() 179 184 { 180 185 TiXmlDocument *document = mLeafDistributionSerializer->load( 181 186 mSampleConfigFile->getEntityDistributionFolder() + 182 mSampleConfigFile->getEntityDistributionXMLPrefix Filename() + ".xml");187 mSampleConfigFile->getEntityDistributionXMLPrefixName() + ".xml"); 183 188 mLeafDistributionSerializer->setLeafDistribution(mLeaves->getDistribution()); 184 189 mLeafDistributionSerializer->getEntity()->setMesh(mLeaves->getEntity()->getMesh()); … … 188 193 BBC::EntityDistribution *entityDistribution; 189 194 190 BBC::MeshPtr pMeshLeavesSplitted(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefix Filename() + "Splitted.mesh")));195 BBC::MeshPtr pMeshLeavesSplitted(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefixName() + "Splitted.mesh"))); 191 196 entity = BBC::EntityPtr(new BBC::Entity()); 192 197 entity->setMesh(pMeshLeavesSplitted); … … 211 216 } 212 217 213 void Manager::generateEntityDistribution()218 void LBBCManager::generateEntityDistribution() 214 219 { 215 220 if (mSampleConfigFile->getEntityDistributionGeneration()) … … 221 226 } 222 227 223 void Manager::saveBillboardCloudGrouped()228 void LBBCManager::saveBillboardCloudGrouped() 224 229 { 225 230 for (unsigned int iSubEntity = 0; iSubEntity < mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities(); iSubEntity++) 226 231 { 227 232 BBC::SubEntityPtr subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 228 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloud MaterialPrefixFilename());233 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudBillboardGroupMaterialPrefixName()); 229 234 } 230 235 mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); … … 232 237 Ogre::LogManager::getSingleton().logMessage("Num.SubEntities:" + Ogre::StringConverter::toString(mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities())); 233 238 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() + 234 mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Grouped.mesh",false, false); 235 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Grouped.mesh"); 236 OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Grouped.mesh.xml"); 237 238 //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Grouped.mesh"); 239 } 240 241 242 void Manager::saveBillboardCloudSplitted() 239 mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Grouped.mesh",false, false); 240 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Grouped.mesh"); 241 OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Grouped.mesh.xml"); 242 } 243 244 245 void LBBCManager::saveBillboardCloudSplitted() 243 246 { 244 247 for (unsigned int iSubEntity = 0; iSubEntity < mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities(); iSubEntity++) 245 248 { 246 249 BBC::SubEntityPtr subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 247 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloud MaterialPrefixFilename());250 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudBillboardMaterialPrefixName()); 248 251 } 249 252 … … 253 256 254 257 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() + 255 mSampleConfigFile->getBillboardCloudMeshPrefix Filename() + "Splitted.mesh",false, false);256 257 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefix Filename() + "Splitted.mesh");258 259 OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefix Filename() + "Splitted.mesh.xml");260 } 261 262 void Manager::saveBillboardCloudMerged()258 mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Splitted.mesh",false, false); 259 260 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Splitted.mesh"); 261 262 OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Splitted.mesh.xml"); 263 } 264 265 void LBBCManager::saveBillboardCloudMerged() 263 266 { 264 //mLeaves->getBillboardCloud()->getEntity()->getSubEntity(0)->setMaterialName(mSampleConfigFile->getBillboardCloudMaterialPrefix Filename());267 //mLeaves->getBillboardCloud()->getEntity()->getSubEntity(0)->setMaterialName(mSampleConfigFile->getBillboardCloudMaterialPrefixName()); 265 268 //mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); 266 269 //mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() + 267 // mSampleConfigFile->getBillboardCloudMeshPrefix Filename() + "Merged.mesh", mSampleConfigFile->getBillboardCloudMergedBillboards(), false);270 // mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh", mSampleConfigFile->getBillboardCloudMergedBillboards(), false); 268 271 //OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), 269 // mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefix Filename() + "Merged.mesh");270 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefix Filename() + "Merged.mesh.xml");272 // mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh"); 273 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh.xml"); 271 274 272 275 … … 274 277 { 275 278 BBC::SubEntityPtr subEntity = mLeaves->getBillboardCloud()->getEntity()->getSubEntity(iSubEntity); 276 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloud MaterialPrefixFilename());279 subEntity->setMaterialName(mSampleConfigFile->getBillboardCloudBillboardGroupMaterialPrefixName()); 277 280 } 278 281 mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity()); … … 280 283 Ogre::LogManager::getSingleton().logMessage("Num.SubEntities:" + Ogre::StringConverter::toString(mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities())); 281 284 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() + 282 mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh",false, false); 283 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh"); 284 OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh.xml"); 285 286 //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getBillboardCloudMeshPrefixFilename() + "Merged.mesh"); 287 } 288 289 void Manager::saveBillboardCloudXML() 285 mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh",false, false); 286 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh"); 287 OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh()->get(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh.xml"); 288 } 289 290 void LBBCManager::saveBillboardCloudXML() 290 291 { 291 292 //saveBillboardCloud() 292 293 TiXmlDocument *document2 = mBillboardCloudSerializer->create( 293 294 mSampleConfigFile->getBillboardCloudFolder() + 294 mSampleConfigFile->getBillboardCloudXMLPrefix Filename() + ".xml");295 mSampleConfigFile->getBillboardCloudXMLPrefixName() + ".xml"); 295 296 mBillboardCloudSerializer->setBillboardCloud(mLeaves->getBillboardCloud()); 296 297 mBillboardCloudSerializer->writeBillboardCloud(document2); … … 298 299 } 299 300 300 void Manager::saveEntityClusters()301 void LBBCManager::saveEntityClusters() 301 302 { 302 303 BBC::BillboardClusterDataPtr billboardClusterData; … … 315 316 { 316 317 BBC::EntityPtr entityClusterized = entityCluster->getEntity(); 317 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefix Filename());318 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefixName()); 318 319 mOgreMeshSerializer->setEntity(entityClusterized); 319 320 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityDistributionFolder() + 320 mSampleConfigFile->getEntityClustersMeshPrefix Filename() +321 mSampleConfigFile->getEntityClustersMeshPrefixName() + 321 322 Ogre::StringConverter::toString(numSerializedBillboards) + ".mesh", !(mSampleConfigFile->getEntityClustersSplittedClusters()), false); 322 323 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entityClusterized->getMesh()->get(), 323 324 mSampleConfigFile->getEntityClustersFolder() + 324 mSampleConfigFile->getEntityClustersMeshPrefix Filename() +325 mSampleConfigFile->getEntityClustersMeshPrefixName() + 325 326 Ogre::StringConverter::toString(numSerializedBillboards) + ".mesh"); 326 327 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entityClusterized->getMesh(), entityClusterized->getMesh()->getName() + ".xml"); 327 328 //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getEntityClustersMeshPrefixFilename() + Ogre::StringConverter::toString(numSerializedBillboards) + ".mesh");329 328 330 329 numSerializedBillboards++; … … 347 346 { 348 347 BBC::EntityPtr entityClusterized = entityCluster->getEntity(); 349 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefix Filename());348 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefixName()); 350 349 BBC::SubEntityPtr subEntity = entityClusterized->getSubEntity(0); 351 350 … … 371 370 mOgreMeshSerializer->setEntity(entity); 372 371 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityClustersFolder() + 373 mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh", false, false); 374 375 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entity->getMesh()->get(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh"); 376 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh" + ".xml"); 377 378 //Ogre::MeshManager::getSingleton().unload(mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh"); 379 380 Ogre::LogManager::getSingleton().logMessage("Before deleting:" + mSampleConfigFile->getEntityClustersMeshPrefixFilename() + "Merged.mesh"); 381 } 382 } 383 384 void Manager::createEntityClusters() 372 mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh", false, false); 373 374 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entity->getMesh()->get(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh"); 375 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entity->getMesh(), mSampleConfigFile->getEntityClustersFolder() + mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh" + ".xml"); 376 377 Ogre::LogManager::getSingleton().logMessage("Before deleting:" + mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh"); 378 } 379 } 380 381 void LBBCManager::createEntityClusters() 385 382 { 386 383 mBillboardCloudGenerator->setDistribution(mLeaves->getDistribution()); … … 392 389 } 393 390 394 void Manager::saveSingleEntity() 395 { 396 if (mSampleConfigFile->getEntitySampleMeshGeneration()) 397 { 398 BBC::EntityPtr entityLeaf = mLeaves->getDistribution()->getEntity(2); 399 entityLeaf->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMaterialPrefixFilename()); 400 mOgreMeshSerializer->setEntity(entityLeaf); 401 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityDistributionFolder() + 402 mSampleConfigFile->getEntitySampleMeshPrefixFilename(), mSampleConfigFile->getEntityClustersMergedClusters(), false); 403 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entityLeaf->getMesh(), entityLeaf->getMesh()->getName() + ".xml"); 404 405 } 406 } 407 408 void Manager::generateEntityClusters() 409 { 410 Ogre::LogManager::getSingleton().logMessage("EntityClustersMeshPrefixName:" + mSampleConfigFile->getEntityClustersMeshPrefixFilename()); 391 void LBBCManager::saveSingleEntity() 392 { 393 BBC::EntityPtr entityLeaf = mLeaves->getDistribution()->getEntity(2); 394 entityLeaf->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntitySampleMaterialPrefixName()); 395 mOgreMeshSerializer->setEntity(entityLeaf); 396 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityDistributionFolder() + 397 mSampleConfigFile->getEntitySampleMeshPrefixName(), false, false); 398 OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(entityLeaf->getMesh()->get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitySampleMeshPrefixName() + ".mesh"); 399 OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(entityLeaf->getMesh()->get(), mSampleConfigFile->getEntityDistributionFolder() + mSampleConfigFile->getEntitySampleMeshPrefixName() + ".mesh.xml"); 400 } 401 402 void LBBCManager::generateEntityClusters() 403 { 404 Ogre::LogManager::getSingleton().logMessage("EntityClustersMeshPrefixName:" + mSampleConfigFile->getEntityClustersMeshPrefixName()); 411 405 createEntityClusters(); 412 saveEntityClusters(); 413 saveSingleEntity(); 414 } 415 416 void Manager::generateBillboardCloud() 406 saveEntityClusters(); 407 } 408 409 void LBBCManager::generateBillboardCloud() 417 410 { 418 411 if (mSampleConfigFile->getBillboardCloudMergedBillboards()) … … 422 415 mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(1); 423 416 424 if (mSampleConfigFile->getBillboardCloudDiffuseColor TextureAtlasGeneration())417 if (mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasGeneration()) 425 418 { 426 419 mBillboardCloudUVMapper->shutdown(); 427 420 mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 428 mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColor TextureSize());429 mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColor TextureSize());430 mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColor TextureAtlasSize());431 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColor TextureAtlasSize());421 mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureSize()); 422 mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureSize()); 423 mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasSize()); 424 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasSize()); 432 425 mBillboardCloudUVMapper->initialize(); 433 426 … … 446 439 mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(mSampleConfigFile->getBillboardCloudGroups()); 447 440 448 if (mSampleConfigFile->getBillboardCloudDiffuseColor TextureAtlasGeneration())441 if (mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasGeneration()) 449 442 { 450 443 mBillboardCloudUVMapper->shutdown(); 451 444 mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 452 mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColor TextureSize());453 mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColor TextureSize());454 mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColor TextureAtlasSize());455 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColor TextureAtlasSize());445 mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureSize()); 446 mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureSize()); 447 mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize()); 448 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize()); 456 449 mBillboardCloudUVMapper->initialize(); 457 450 mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleConfigFile->getBillboardCloudGroupedBillboards(), mSampleConfigFile->getBillboardCloudGroups()); … … 466 459 { 467 460 mLeaves->getBillboardCloud()->generateBillboardCloud(false); 468 if (mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasGeneration())469 {470 mBillboardCloudUVMapper->shutdown();471 mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud());472 mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize());473 mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize());474 mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize());475 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize());476 mBillboardCloudUVMapper->initialize();477 mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(!mSampleConfigFile->getBillboardCloudSplittedBillboards(),false);478 }461 //if (mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasGeneration()) 462 //{ 463 // mBillboardCloudUVMapper->shutdown(); 464 // mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 465 // mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 466 // mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureSize()); 467 // mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 468 // mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorTextureAtlasSize()); 469 // mBillboardCloudUVMapper->initialize(); 470 // mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(!mSampleConfigFile->getBillboardCloudSplittedBillboards(),false); 471 //} 479 472 saveBillboardCloudSplitted(); 480 473 } … … 483 476 } 484 477 485 Leaves* Manager::getLeaves()478 Leaves* LBBCManager::getLeaves() 486 479 { 487 480 return mLeaves; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCSampleConfigFile.cpp
r721 r731 11 11 } 12 12 13 Ogre::String SampleConfigFile::getEntitySampleMeshPrefixFilename() 14 { 15 return getSetting("Entity Sample Mesh Prefix Filename"); 13 Ogre::String SampleConfigFile::getEntitySampleMaterialPrefixName() 14 { 15 return getSetting("Entity Sample Material Prefix Name"); 16 } 17 18 Ogre::String SampleConfigFile::getEntitySampleMeshPrefixName() 19 { 20 return getSetting("Entity Sample Mesh Prefix Name"); 16 21 } 17 22 … … 41 46 } 42 47 43 Ogre::String SampleConfigFile::getEntityDistributionXMLPrefix Filename()44 { 45 return getSetting("Entity Distribution XML Prefix Filename");48 Ogre::String SampleConfigFile::getEntityDistributionXMLPrefixName() 49 { 50 return getSetting("Entity Distribution XML Prefix Name"); 46 51 } 47 52 … … 52 57 53 58 54 Ogre::String SampleConfigFile::getEntitiesMeshPrefix Filename()55 { 56 return getSetting("Entities Mesh Prefix Filename");57 } 58 59 Ogre::String SampleConfigFile::getBillboardCloudXMLPrefix Filename()60 { 61 return getSetting("Billboard Cloud XML Prefix Filename");59 Ogre::String SampleConfigFile::getEntitiesMeshPrefixName() 60 { 61 return getSetting("Entities Mesh Prefix Name"); 62 } 63 64 Ogre::String SampleConfigFile::getBillboardCloudXMLPrefixName() 65 { 66 return getSetting("Billboard Cloud XML Prefix Name"); 62 67 } 63 68 … … 122 127 } 123 128 124 Ogre::String SampleConfigFile::getEntityClustersMeshPrefix Filename()125 { 126 return getSetting("Entity Clusters Mesh Prefix Filename");127 } 128 129 Ogre::String SampleConfigFile::getEntityClustersMaterialPrefix Filename()130 { 131 return getSetting("Entity Clusters Material Prefix Filename");129 Ogre::String SampleConfigFile::getEntityClustersMeshPrefixName() 130 { 131 return getSetting("Entity Clusters Mesh Prefix Name"); 132 } 133 134 Ogre::String SampleConfigFile::getEntityClustersMaterialPrefixName() 135 { 136 return getSetting("Entity Clusters Material Prefix Name"); 132 137 } 133 138 … … 137 142 } 138 143 139 Ogre::String SampleConfigFile::getBillboardCloudMeshPrefix Filename()140 { 141 return getSetting("Billboard Cloud Mesh Prefix Filename");142 } 143 144 Ogre::String SampleConfigFile::getBillboardCloud MaterialPrefixFilename()145 { 146 return getSetting("Billboard Cloud Material Prefix Filename");147 } 148 149 bool SampleConfigFile::getBillboardCloudDiffuseColorTextureAtlasGeneration()150 { 151 return Ogre::StringConverter::parseBool(getSetting("Billboard Cloud Diffuse Color Texture Atlas Generation"));152 } 153 154 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorTextureSize()155 { 156 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Texture Size"));157 } 158 159 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorTextureAtlasSize()160 { 161 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Texture Atlas Size"));162 } 163 164 bool SampleConfigFile::getBillboardCloudIndirectTextureAtlasGeneration()165 { 166 return Ogre::StringConverter::parseBool(getSetting("Billboard Cloud Diffuse Color Texture Atlas Generation"));167 } 168 169 unsigned int SampleConfigFile::getBillboardCloud IndirectTextureSize()170 { 171 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Indirect Texture Size"));172 } 173 174 unsigned int SampleConfigFile::getBillboardCloud IndirectTextureAtlasSize()175 { 176 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Indirect Texture AtlasSize"));144 Ogre::String SampleConfigFile::getBillboardCloudMeshPrefixName() 145 { 146 return getSetting("Billboard Cloud Mesh Prefix Name"); 147 } 148 149 Ogre::String SampleConfigFile::getBillboardCloudBillboardMaterialPrefixName() 150 { 151 return getSetting("Billboard Cloud Billboard Material Prefix Name"); 152 } 153 154 Ogre::String SampleConfigFile::getBillboardCloudBillboardGroupMaterialPrefixName() 155 { 156 return getSetting("Billboard Cloud Billboard Group Material Prefix Name"); 157 } 158 159 Ogre::String SampleConfigFile::getBillboardCloudBillboardTextureUnit0PrefixName() 160 { 161 return getSetting("Billboard Cloud Billboard Texture Unit 0 Prefix Name"); 162 } 163 164 Ogre::String SampleConfigFile::getBillboardCloudBillboardGroupTextureUnit0PrefixName() 165 { 166 return getSetting("Billboard Cloud Billboard Group Texture Unit 0 Prefix Name"); 167 } 168 169 Ogre::String SampleConfigFile::getBillboardCloudIndirectBillboardGroupTextureAtlasPrefixName() 170 { 171 return getSetting("Billboard Cloud Indirect Billboard Group Texture Atlas Prefix Name"); 172 } 173 174 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorEntityTextureAtlasBitRange() 175 { 176 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Entity Texture Atlas Bit Range")); 177 } 178 179 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorBillboardGroupTextureSize() 180 { 181 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Billboard Group Texture Size")); 177 182 } 178 183 … … 182 187 } 183 188 189 unsigned int SampleConfigFile::getBillboardCloudIndirectBillboardGroupTextureAtlasBitRange() 190 { 191 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Indirect Billboard Group Texture Atlas Bit Range")); 192 } 193 194 unsigned int SampleConfigFile::getBillboardCloudIndirectBillboardGroupTextureAtlasSize() 195 { 196 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Indirect Billboard Group Texture Atlas Size")); 197 } 198 199 unsigned int SampleConfigFile::getBillboardCloudIndirectBillboardGroupTextureSize() 200 { 201 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Indirect Billboard Group Texture Size")); 202 } 203 204 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize() 205 { 206 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Billboard Group Texture Atlas Size")); 207 } 208 209 bool SampleConfigFile::getBillboardCloudDiffuseColorBillboardGroupTextureAtlasGeneration() 210 { 211 return Ogre::StringConverter::parseBool(getSetting("Billboard Cloud Diffuse Color Billboard Group Texture Atlas Generation")); 212 } 213 214 bool SampleConfigFile::getBillboardCloudIndirectBillboardGroupTextureAtlasGeneration() 215 { 216 return Ogre::StringConverter::parseBool(getSetting("Billboard Cloud Indirect Billboard Group Texture Atlas Generation")); 217 } 218 184 219 bool SampleConfigFile::getBillboardCloudGroupedBillboards() 185 220 { … … 187 222 } 188 223 189 } 224 bool SampleConfigFile::getBillboardCloudDiffuseColorEntityTextureAtlasGeneration() 225 { 226 return Ogre::StringConverter::parseBool(getSetting("Billboard Cloud Diffuse Color Entity Texture Atlas Generation")); 227 } 228 229 Ogre::String SampleConfigFile::getBillboardCloudDiffuseColorEntityTexturePrefixName() 230 { 231 return getSetting("Billboard Cloud Diffuse Color Entity Texture Prefix Name"); 232 } 233 234 Ogre::String SampleConfigFile::getBillboardCloudDiffuseColorEntityTextureAtlasPrefixName() 235 { 236 return getSetting("Billboard Cloud Diffuse Color Entity Texture Atlas Prefix Name"); 237 } 238 239 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorEntityTextureAtlasSize() 240 { 241 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Entity Texture Atlas Size")); 242 } 243 244 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorEntityTextureAtlasNumSamples() 245 { 246 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Entity Texture Atlas NumSamples")); 247 } 248 249 bool SampleConfigFile::getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasGeneration() 250 { 251 return Ogre::StringConverter::parseBool(getSetting("Billboard Cloud Diffuse Color Merged Billboards Texture Atlas Generation")); 252 } 253 254 Ogre::String SampleConfigFile::getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasPrefixName() 255 { 256 return getSetting("Billboard Cloud Diffuse Color Merged Billboards Texture Atlas Prefix Name"); 257 } 258 259 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasBitRange() 260 { 261 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Merged Billboards Texture Atlas Bit Range")); 262 } 263 264 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasSize() 265 { 266 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Merged Billboards Texture Atlas Size")); 267 } 268 269 unsigned int SampleConfigFile::getBillboardCloudDiffuseColorMergedBillboardsTextureSize() 270 { 271 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Diffuse Color Merged Billboards Texture Size")); 272 } 273 274 bool SampleConfigFile::getBillboardCloudIndirectMergedBillboardsTextureAtlasGeneration() 275 { 276 return Ogre::StringConverter::parseBool(getSetting("Billboard Cloud Indirect Merged Billboards Texture Atlas Generation")); 277 } 278 279 Ogre::String SampleConfigFile::getBillboardCloudIndirectMergedBillboardsTextureAtlasPrefixName() 280 { 281 return getSetting("Billboard Cloud Indirect Merged Billboards Texture Atlas Prefix Name"); 282 } 283 284 unsigned int SampleConfigFile::getBillboardCloudIndirectMergedBillboardsTextureAtlasBitRange() 285 { 286 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Indirect Merged Billboards Texture Atlas Bit Range")); 287 } 288 289 unsigned int SampleConfigFile::getBillboardCloudIndirectMergedBillboardsTextureAtlasSize() 290 { 291 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Indirect Merged Billboards Texture Atlas Size")); 292 } 293 294 unsigned int SampleConfigFile::getBillboardCloudIndirectMergedBillboardsTextureSize() 295 { 296 return Ogre::StringConverter::parseInt(getSetting("Billboard Cloud Indirect Merged Billboards Texture Size")); 297 } 298 299 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/OBAOgreApplication.cpp
r721 r731 14 14 { 15 15 // Gametools -- BUG: 31/03/2006 16 //if (mFrameListener)17 //{18 //delete mFrameListener;19 //}16 if (mFrameListener) 17 { 18 delete mFrameListener; 19 } 20 20 21 21 //if (mOgreBase) … … 76 76 // You can skip this and use root.restoreConfig() to load configuration 77 77 // settings if you were sure there are valid ones saved in ogre.cfg 78 //if(mRoot->showConfigDialog())79 if (mRoot->restoreConfig())78 if(mRoot->showConfigDialog()) 79 //if (mRoot->restoreConfig()) 80 80 { 81 81 // If returned true, user clicked OK so initialise -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/OBAOgreBase.cpp
r721 r731 29 29 return mXMLMeshSerializer; 30 30 } 31 31 32 Ogre::MaterialSerializer* OgreBase::getMaterialSerializer() 33 { 34 return mMaterialSerializer; 35 } 36 32 37 Ogre::MeshSerializer* OgreBase::getMeshSerializer() 33 38 { 34 39 return mMeshSerializer; 35 }36 37 Ogre::MeshManager* OgreBase::getMeshManager()38 {39 return mMeshManager;40 40 } 41 41 … … 48 48 mMath = new Ogre::Math(); 49 49 mMeshManager = new Ogre::MeshManager(); 50 //mMaterialManager = new Ogre::MaterialManager(); 50 mMaterialManager = new Ogre::MaterialManager(); 51 mMaterialManager->initialise(); 52 mMaterialSerializer = new Ogre::MaterialSerializer(); 51 53 mMeshSerializer = new Ogre::MeshSerializer(); 52 54 mXMLMeshSerializer = new Ogre::XMLMeshSerializer(); … … 79 81 } 80 82 83 if (mMaterialSerializer) 84 { 85 delete mMaterialSerializer; 86 } 87 81 88 if (mMath) 82 89 { … … 89 96 } 90 97 91 //if (mMaterialManager)92 //{93 //mMaterialManager->removeAll();94 //delete mMaterialManager;95 //}98 if (mMaterialManager) 99 { 100 mMaterialManager->removeAll(); 101 delete mMaterialManager; 102 } 96 103 97 104 if (mResourceGroupManager) -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/OBAOgreFrameListener.cpp
r721 r731 39 39 OgreFrameListener::~OgreFrameListener() 40 40 { 41 for (unsigned int iOgreFrameListenerMode = 0; iOgreFrameListenerMode < this->getNumFrameListenerModes(); iOgreFrameListenerMode++) 42 { 43 this->removeFrameListenerMode(iOgreFrameListenerMode); 44 } 41 45 if (mInputTypeSwitchingOn) 42 46 { … … 48 52 else 49 53 { 50 if (mInputDevice) 51 { 52 Ogre::PlatformManager::getSingleton().destroyInputReader( mInputDevice ); 53 } 54 // Gametools -- BUG: 06/04/2006 55 //if (mInputDevice) 56 //{ 57 // Ogre::PlatformManager::getSingleton().destroyInputReader( mInputDevice ); 58 //} 59 //delete mInputDevice; 54 60 } 55 56 for (unsigned int iOgreFrameListenerMode = 0; iOgreFrameListenerMode < this->getNumFrameListenerModes(); iOgreFrameListenerMode++)57 {58 OBA::OgreFrameListenerMode *ogreFrameListenerMode = this->getFrameListenerMode(iOgreFrameListenerMode);59 this->removeFrameListenerMode(iOgreFrameListenerMode);60 delete ogreFrameListenerMode;61 }62 61 } 63 62 … … 91 90 } 92 91 92 mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName() + " -- " + Ogre::StringConverter::toString(mTimeUntilNextToggle)); 93 93 94 return mDefaultOgreFrameListenerMode->frameStarted(evt,mInputDevice); 94 95 } … … 107 108 mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 108 109 109 mTimeUntilNextToggle = 1;110 mTimeUntilNextToggle = 0.25; 110 111 } 111 112
Note: See TracChangeset
for help on using the changeset viewer.