- Timestamp:
- 04/06/06 20:48:19 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.