Changeset 484 for trunk/VUT/GtpVisibilityPreprocessor
- Timestamp:
- 12/27/05 20:35:04 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r483 r484 146 146 loadFromFile false 147 147 #type kdTree 148 #type vspKdTree148 type vspKdTree 149 149 #type bspTree 150 type vspBspTree150 #type vspBspTree 151 151 152 152 #type sceneDependent -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellsManager.cpp
r483 r484 286 286 ViewCellContainer viewcells; 287 287 288 /*Vector3 origin = ray.mOrigin; 289 Vector3 termination = ray.mTermination; 290 static Ray hray; 288 Ray hray(ray); 291 289 float tmin = 0, tmax = 1.0; 292 hray.Init(ray.GetOrigin(), ray.GetDir(), Ray::LINE_SEGMENT); 293 GetSceneBbox().ComputeMinMaxT(hray, &tmin, &tmax); 294 if (tmin >= tmax) 290 // matt TODO: remove this!! 291 //hray.Init(ray.GetOrigin(), ray.GetDir(), Ray::LINE_SEGMENT); 292 293 if (!GetSceneBbox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) 295 294 return; 296 295 297 if (tmin > 0.0f) 298 origin = ray.Extrap(tmin); 299 300 if (tmax < 1.0f) 301 termination = ray.Extrap(tmax);*/ 302 303 CastLineSegment(ray.mOrigin, 304 ray.mTermination, 296 Vector3 origin = hray.Extrap(tmin); 297 Vector3 termination = hray.Extrap(tmax); 298 299 CastLineSegment(origin, 300 termination, 305 301 viewcells); 306 302 … … 1699 1695 { 1700 1696 VssRay *vssRay = *it; 1697 1698 Ray hray(*vssRay); 1699 float tmin = 0, tmax = 1.0; 1700 1701 //hray.Init(ray.GetOrigin(), ray.GetDir(), Ray::LINE_SEGMENT); 1702 1703 if (!GetSceneBbox().GetRaySegment(hray, tmin, tmax) || (tmin > tmax)) 1704 continue; 1705 1706 Vector3 origin = hray.Extrap(tmin); 1707 Vector3 termination = hray.Extrap(tmax); 1708 1701 1709 BspRay *ray = new BspRay(vssRay); 1702 1710 … … 1704 1712 1705 1713 // cast line segment and store intersections with the rays 1706 CastLineSegment( vssRay->mTermination, vssRay->mOrigin, viewCells);1714 CastLineSegment(origin, termination, viewCells); 1707 1715 1708 1716 ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); -
trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp
r483 r484 229 229 mBox.Initialize(); // initialise BSP tree bounding box 230 230 231 if (forcedBoundingBox) 232 mBox = *forcedBoundingBox; 233 231 234 PolygonContainer polys; 232 235 RayInfoContainer *rays = new RayInfoContainer(); … … 245 248 VssRay *ray = *rit; 246 249 247 if (ray->mTerminationObject && !ray->mTerminationObject->Mailed()) 250 if ((mBox.IsInside(ray->mTermination) || !forcedBoundingBox) && 251 ray->mTerminationObject && 252 !ray->mTerminationObject->Mailed()) 248 253 { 249 254 ray->mTerminationObject->Mail(); 250 255 MeshInstance *obj = dynamic_cast<MeshInstance *>(ray->mTerminationObject); 251 256 AddMeshToPolygons(obj->GetMesh(), polys, obj); 252 } 253 254 if (ray->mOriginObject && !ray->mOriginObject->Mailed()) 257 //-- compute bounding box 258 if (!forcedBoundingBox) 259 mBox.Include(ray->mTermination); 260 } 261 262 if ((mBox.IsInside(ray->mOrigin) || !forcedBoundingBox) && 263 ray->mOriginObject && 264 !ray->mOriginObject->Mailed()) 255 265 { 256 266 ray->mOriginObject->Mail(); 257 267 MeshInstance *obj = dynamic_cast<MeshInstance *>(ray->mOriginObject); 258 268 AddMeshToPolygons(obj->GetMesh(), polys, obj); 269 //-- compute bounding box 270 if (!forcedBoundingBox) 271 mBox.Include(ray->mOrigin); 259 272 } 260 273 } 261 274 262 275 //-- compute bounding box 263 if (forcedBoundingBox) 264 mBox = *forcedBoundingBox; 265 else 266 Polygon3::IncludeInBox(polys, mBox); 276 //if (!forcedBoundingBox) Polygon3::IncludeInBox(polys, mBox); 267 277 268 278 //-- store rays
Note: See TracChangeset
for help on using the changeset viewer.