Changeset 359
- Timestamp:
- 10/28/05 16:58:55 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/AxisAlignedBox3.cpp
r333 r359 1707 1707 { 1708 1708 Vector3 centerOfMass(0); 1709 1709 int i; 1710 1710 // compute center of mass 1711 for (i nt i= 0; i < (int)planePoly->mVertices.size(); ++ i)1711 for (i = 0; i < (int)planePoly->mVertices.size(); ++ i) 1712 1712 centerOfMass += planePoly->mVertices[i]; 1713 1713 … … 1720 1720 // compute angle to reference point 1721 1721 for (i = 1; i < (int)planePoly->mVertices.size(); ++ i) 1722 {1723 1724 1725 1726 1727 }1722 { 1723 float angle = 1724 Angle(refVec, centerOfMass - planePoly->mVertices[i], plane.mNormal); 1725 1726 vertexData.push_back(VertexData(planePoly->mVertices[i], angle)); 1727 } 1728 1728 1729 1729 std::stable_sort(vertexData.begin(), vertexData.end()); -
trunk/VUT/GtpVisibilityPreprocessor/src/Makefile
r354 r359 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (1.07a) (Qt 3.3. 2) on: Wed Oct 26 17:55:3020053 # Generated by qmake (1.07a) (Qt 3.3.3) on: Fri Oct 28 16:08:05 2005 4 4 # Project: preprocessor.pro 5 5 # Template: app … … 9 9 ####### Compiler, tools and options 10 10 11 CC = cl 12 CXX = cl 13 LEX = flex 14 YACC = byacc 15 CFLAGS = -nologo -Zm200 -W0 -MD -O2 -G7 -GX -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 16 CXXFLAGS = -nologo -Zm200 -W0 -MD -O2 -G7 -GX -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 17 LEXFLAGS = 18 YACCFLAGS =-d 19 INCPATH = -I"..\src" -I"..\support\xerces\include" -I"..\support\zlib\include" -I"..\support\boost" -I"..\support\devil\include" -I"$(QTDIR)\include" -I"d:\gametools\svn\trunk\VUT\GtpVisibilityPreprocessor\src" -I"C:\Qt\3.3.2\mkspecs\win32-msvc.net" 20 LINK = "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe" 21 LFLAGS = /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIBPATH:"../support/xerces/lib" /LIBPATH:"../support/devil/lib" /LIBPATH:"$(QTDIR)\lib" 22 LIBS = "qt-mt332.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "delayimp.lib" "xerces-c_2.lib" "devil.lib" "ilu.lib" "ilut.lib" "opengl32.lib" "glu32.lib" 23 MOC = $(QTDIR)\bin\moc.exe 24 UIC = $(QTDIR)\bin\uic.exe 25 QMAKE = qmake 26 IDC = $(QTDIR)\bin\idc.exe 27 IDL = midl 28 ZIP = zip -r -9 29 COPY_FILE = copy 30 COPY_DIR = copy 31 DEL_FILE = del 32 DEL_DIR = rmdir 33 MOVE = move 34 CHK_DIR_EXISTS = if not exist 35 MKDIR = mkdir 11 CC = gcc 12 CXX = g++ 13 LEX = flex 14 YACC = yacc 15 CFLAGS = -pipe -O2 -fmessage-length=0 -Wall -w -O2 -fmessage-length=0 -Wall -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT 16 CXXFLAGS = -pipe -O2 -fmessage-length=0 -Wall -w -O2 -fmessage-length=0 -Wall -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT 17 LEXFLAGS = 18 YACCFLAGS= -d 19 INCPATH = -I/usr/lib/qt3/mkspecs/default -I. -I../src -I../support/xerces/include -I../support/zlib/include -I../support/boost -I../support/devil/include -I/usr/include -I$(QTDIR)/include 20 LINK = g++ 21 LFLAGS = 22 LIBS = $(SUBLIBS) -L/usr/lib64/ -L$(QTDIR)/lib64/ -L/usr/X11R6/lib64/ -lqt-mt -lXext -lX11 -lm -lpthread 23 AR = ar cqs 24 RANLIB = 25 MOC = $(QTDIR)/bin/moc 26 UIC = $(QTDIR)/bin/uic 27 QMAKE = qmake 28 TAR = tar -cf 29 GZIP = gzip -9f 30 COPY = cp -f 31 COPY_FILE= $(COPY) 32 COPY_DIR = $(COPY) -r 36 33 INSTALL_FILE= $(COPY_FILE) 37 34 INSTALL_DIR = $(COPY_DIR) 35 DEL_FILE = rm -f 36 SYMLINK = ln -sf 37 DEL_DIR = rmdir 38 MOVE = mv -f 39 CHK_DIR_EXISTS= test -d 40 MKDIR = mkdir -p 41 42 ####### Output directory 43 44 OBJECTS_DIR = ./ 38 45 39 46 ####### Files 40 47 41 HEADERS = 42 SOURCES = 48 HEADERS = Halton.h 49 SOURCES = Preprocessor.cpp \ 43 50 SamplingPreprocessor.cpp \ 44 51 ExactPreprocessor.cpp \ … … 70 77 ViewCellBsp.cpp \ 71 78 Halton.cpp 72 OBJECTS = Preprocessor.obj \ 73 SamplingPreprocessor.obj \ 74 ExactPreprocessor.obj \ 75 KdTree.obj \ 76 Environment.obj \ 77 gzstream.obj \ 78 common.obj \ 79 UnigraphicsParser.obj \ 80 X3dExporter.obj \ 81 SceneGraph.obj \ 82 Material.obj \ 83 Matrix4x4.obj \ 84 Vector3.obj \ 85 AxisAlignedBox3.obj \ 86 Ray.obj \ 87 main.obj \ 88 Mesh.obj \ 89 Exporter.obj \ 90 Camera.obj \ 91 X3dParser.obj \ 92 MeshKdTree.obj \ 93 Pvs.obj \ 94 MutualVisibility.obj \ 95 Triangle3.obj \ 96 Rectangle3.obj \ 97 Plane3.obj \ 98 Polygon3.obj \ 99 ViewCell.obj \ 100 ViewCellBsp.obj \ 101 Halton.obj 102 FORMS = 103 UICDECLS = 104 UICIMPLS = 105 SRCMOC = 106 OBJMOC = 107 DIST = 108 TARGET = preprocessor.exe 109 79 OBJECTS = Preprocessor.o \ 80 SamplingPreprocessor.o \ 81 ExactPreprocessor.o \ 82 KdTree.o \ 83 Environment.o \ 84 gzstream.o \ 85 common.o \ 86 UnigraphicsParser.o \ 87 X3dExporter.o \ 88 SceneGraph.o \ 89 Material.o \ 90 Matrix4x4.o \ 91 Vector3.o \ 92 AxisAlignedBox3.o \ 93 Ray.o \ 94 main.o \ 95 Mesh.o \ 96 Exporter.o \ 97 Camera.o \ 98 X3dParser.o \ 99 MeshKdTree.o \ 100 Pvs.o \ 101 MutualVisibility.o \ 102 Triangle3.o \ 103 Rectangle3.o \ 104 Plane3.o \ 105 Polygon3.o \ 106 ViewCell.o \ 107 ViewCellBsp.o \ 108 Halton.o 109 FORMS = 110 UICDECLS = 111 UICIMPLS = 112 SRCMOC = 113 OBJMOC = 114 DIST = preprocessor.pro 115 QMAKE_TARGET = preprocessor 116 DESTDIR = 117 TARGET = preprocessor 118 119 first: all 110 120 ####### Implicit rules 111 121 112 .SUFFIXES: .c .cpp .cc .cxx .C 113 114 {.}.cpp{}.obj:: 115 $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<< 116 $< 117 << 118 119 {.}.cc{}.obj:: 120 $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<< 121 $< 122 << 123 124 {.}.cxx{}.obj:: 125 $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<< 126 $< 127 << 128 129 {.}.C{}.obj:: 130 $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<< 131 $< 132 << 133 134 {.}.c{}.obj:: 135 $(CC) -c $(CFLAGS) $(INCPATH) -Fo @<< 136 $< 137 << 122 .SUFFIXES: .c .o .cpp .cc .cxx .C 123 124 .cpp.o: 125 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 126 127 .cc.o: 128 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 129 130 .cxx.o: 131 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 132 133 .C.o: 134 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 135 136 .c.o: 137 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< 138 138 139 139 ####### Build rules … … 141 141 all: Makefile $(TARGET) 142 142 143 $(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) 144 $(LINK) $(LFLAGS) /OUT:$(TARGET) @<< 145 $(OBJECTS) $(OBJMOC) $(LIBS) 146 << 147 143 $(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) 144 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS) 148 145 149 146 mocables: $(SRCMOC) 150 uicables: $(UICIMPLS) $(UICDECLS) 151 152 Makefile: preprocessor.pro C:\Qt\3.3.2\mkspecs\win32-msvc.net\qmake.conf C:\Qt\3.3.2\lib\qtmain.prl 147 uicables: $(UICDECLS) $(UICIMPLS) 148 149 $(MOC): 150 ( cd $(QTDIR)/src/moc && $(MAKE) ) 151 152 Makefile: preprocessor.pro /usr/lib/qt3/mkspecs/default/qmake.conf 153 153 $(QMAKE) -o Makefile preprocessor.pro 154 154 qmake: 155 155 @$(QMAKE) -o Makefile preprocessor.pro 156 156 157 dist: 158 $(ZIP) preprocessor.zip $(SOURCES) $(HEADERS) $(DIST) $(FORMS) d:/gametools/svn/trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro C:\Qt\3.3.2\lib\qtmain.prl 157 dist: 158 @mkdir -p .tmp/preprocessor && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/preprocessor/ && ( cd `dirname .tmp/preprocessor` && $(TAR) preprocessor.tar preprocessor && $(GZIP) preprocessor.tar ) && $(MOVE) `dirname .tmp/preprocessor`/preprocessor.tar.gz . && $(DEL_FILE) -r .tmp/preprocessor 159 160 mocclean: 159 161 160 162 uiclean: 161 mocclean: 162 clean: uiclean mocclean 163 -$(DEL_FILE) Preprocessor.obj 164 -$(DEL_FILE) SamplingPreprocessor.obj 165 -$(DEL_FILE) ExactPreprocessor.obj 166 -$(DEL_FILE) KdTree.obj 167 -$(DEL_FILE) Environment.obj 168 -$(DEL_FILE) gzstream.obj 169 -$(DEL_FILE) common.obj 170 -$(DEL_FILE) UnigraphicsParser.obj 171 -$(DEL_FILE) X3dExporter.obj 172 -$(DEL_FILE) SceneGraph.obj 173 -$(DEL_FILE) Material.obj 174 -$(DEL_FILE) Matrix4x4.obj 175 -$(DEL_FILE) Vector3.obj 176 -$(DEL_FILE) AxisAlignedBox3.obj 177 -$(DEL_FILE) Ray.obj 178 -$(DEL_FILE) main.obj 179 -$(DEL_FILE) Mesh.obj 180 -$(DEL_FILE) Exporter.obj 181 -$(DEL_FILE) Camera.obj 182 -$(DEL_FILE) X3dParser.obj 183 -$(DEL_FILE) MeshKdTree.obj 184 -$(DEL_FILE) Pvs.obj 185 -$(DEL_FILE) MutualVisibility.obj 186 -$(DEL_FILE) Triangle3.obj 187 -$(DEL_FILE) Rectangle3.obj 188 -$(DEL_FILE) Plane3.obj 189 -$(DEL_FILE) Polygon3.obj 190 -$(DEL_FILE) ViewCell.obj 191 -$(DEL_FILE) ViewCellBsp.obj 192 -$(DEL_FILE) Halton.obj 193 163 164 yaccclean: 165 lexclean: 166 clean: 167 -$(DEL_FILE) $(OBJECTS) 168 -$(DEL_FILE) *~ core *.core 169 170 171 ####### Sub-libraries 172 173 distclean: clean 174 -$(DEL_FILE) $(TARGET) $(TARGET) 194 175 195 176 196 177 FORCE: 197 178 198 distclean: clean199 -$(DEL_FILE) $(TARGET)200 201 179 ####### Compile 202 180 203 Preprocessor.obj: Preprocessor.cpp \ 204 SceneGraph.h \ 181 Preprocessor.o: Preprocessor.cpp SceneGraph.h \ 205 182 Exporter.h \ 206 183 UnigraphicsParser.h \ … … 223 200 Intersectable.h \ 224 201 Pvs.h \ 225 Ray.h \ 226 227 228 SamplingPreprocessor.obj: SamplingPreprocessor.cpp \ 229 SceneGraph.h \ 202 Ray.h 203 204 SamplingPreprocessor.o: SamplingPreprocessor.cpp SceneGraph.h \ 230 205 KdTree.h \ 231 206 SamplingPreprocessor.h \ … … 249 224 Intersectable.h \ 250 225 Material.h \ 251 Exporter.h \ 252 253 254 ExactPreprocessor.obj: ExactPreprocessor.cpp \ 255 ExactPreprocessor.h \ 226 Exporter.h 227 228 ExactPreprocessor.o: ExactPreprocessor.cpp ExactPreprocessor.h \ 256 229 Preprocessor.h \ 257 230 Containers.h \ … … 269 242 Vector3.h \ 270 243 common.h \ 271 Ray.h \ 272 273 274 KdTree.obj: KdTree.cpp \ 244 Ray.h 245 246 KdTree.o: KdTree.cpp Environment.h \ 247 Mesh.h \ 248 KdTree.h \ 249 common.h \ 250 Intersectable.h \ 251 Plane3.h \ 252 Matrix4x4.h \ 253 AxisAlignedBox3.h \ 254 Material.h \ 255 Pvs.h \ 256 Rectangle3.h \ 257 Vector3.h \ 258 Containers.h \ 259 Ray.h 260 261 Environment.o: Environment.cpp gzstream.h \ 262 common.h \ 275 263 Environment.h \ 276 Mesh.h \ 277 KdTree.h \ 278 common.h \ 279 Intersectable.h \ 280 Plane3.h \ 281 Matrix4x4.h \ 282 AxisAlignedBox3.h \ 283 Material.h \ 284 Pvs.h \ 285 Rectangle3.h \ 286 Vector3.h \ 287 Containers.h \ 288 Ray.h \ 289 290 291 Environment.obj: Environment.cpp \ 292 gzstream.h \ 293 common.h \ 294 Environment.h \ 295 Vector3.h \ 296 297 298 gzstream.obj: gzstream.cpp \ 299 gzstream.h \ 300 301 302 common.obj: common.cpp \ 303 common.h \ 304 305 306 UnigraphicsParser.obj: UnigraphicsParser.cpp \ 307 Vector3.h \ 264 Vector3.h 265 266 gzstream.o: gzstream.cpp gzstream.h 267 268 common.o: common.cpp common.h 269 270 UnigraphicsParser.o: UnigraphicsParser.cpp Vector3.h \ 308 271 Mesh.h \ 309 272 SceneGraph.h \ … … 319 282 Rectangle3.h \ 320 283 Containers.h \ 321 Parser.h \ 322 323 324 X3dExporter.obj: X3dExporter.cpp \ 325 common.h \ 284 Parser.h 285 286 X3dExporter.o: X3dExporter.cpp common.h \ 326 287 SceneGraph.h \ 327 288 X3dExporter.h \ … … 341 302 Intersectable.h \ 342 303 Pvs.h \ 343 Ray.h \ 344 345 346 SceneGraph.obj: SceneGraph.cpp \ 347 SceneGraph.h \ 304 Ray.h 305 306 SceneGraph.o: SceneGraph.cpp SceneGraph.h \ 348 307 X3dExporter.h \ 349 308 Intersectable.h \ … … 357 316 Exporter.h \ 358 317 Material.h \ 359 Pvs.h \ 360 361 362 Material.obj: Material.cpp \ 363 common.h \ 364 Material.h \ 365 366 367 Matrix4x4.obj: Matrix4x4.cpp \ 368 Matrix4x4.h \ 369 Vector3.h \ 370 common.h \ 371 372 373 Vector3.obj: Vector3.cpp \ 374 Matrix4x4.h \ 318 Pvs.h 319 320 Material.o: Material.cpp common.h \ 321 Material.h 322 323 Matrix4x4.o: Matrix4x4.cpp Matrix4x4.h \ 324 Vector3.h \ 325 common.h 326 327 Vector3.o: Vector3.cpp Matrix4x4.h \ 375 328 Vector3.h \ 376 329 Halton.h \ 377 common.h \ 378 379 380 AxisAlignedBox3.obj: AxisAlignedBox3.cpp \ 381 AxisAlignedBox3.h \ 330 common.h 331 332 AxisAlignedBox3.o: AxisAlignedBox3.cpp AxisAlignedBox3.h \ 382 333 Ray.h \ 383 334 Polygon3.h \ … … 391 342 Intersectable.h \ 392 343 Material.h \ 393 Pvs.h \ 394 395 396 Ray.obj: Ray.cpp \ 397 Ray.h \ 398 Plane3.h \ 399 Matrix4x4.h \ 400 Vector3.h \ 401 common.h \ 402 403 404 main.obj: main.cpp \ 405 SamplingPreprocessor.h \ 344 Pvs.h 345 346 Ray.o: Ray.cpp Ray.h \ 347 Plane3.h \ 348 Matrix4x4.h \ 349 Vector3.h \ 350 common.h 351 352 main.o: main.cpp SamplingPreprocessor.h \ 406 353 ExactPreprocessor.h \ 407 354 Parser.h \ … … 429 376 Vector3.h \ 430 377 common.h \ 431 Ray.h \ 432 433 434 Mesh.obj: Mesh.cpp \ 435 Ray.h \ 378 Ray.h 379 380 Mesh.o: Mesh.cpp Ray.h \ 436 381 Mesh.h \ 437 382 MeshKdTree.h \ … … 446 391 Pvs.h \ 447 392 Rectangle3.h \ 448 Containers.h \ 449 450 451 Exporter.obj: Exporter.cpp \ 452 X3dExporter.h \ 453 Exporter.h \ 454 Containers.h \ 455 Material.h \ 456 457 458 Camera.obj: Camera.cpp \ 459 Camera.h \ 460 Ray.h \ 461 KdTree.h \ 462 Mesh.h \ 463 Exporter.h \ 464 Vector3.h \ 465 AxisAlignedBox3.h \ 466 common.h \ 467 Rectangle3.h \ 468 Matrix4x4.h \ 469 Plane3.h \ 470 Containers.h \ 471 Pvs.h \ 472 Intersectable.h \ 473 Material.h \ 474 475 476 X3dParser.obj: X3dParser.cpp \ 477 X3dParser.h \ 393 Containers.h 394 395 Exporter.o: Exporter.cpp X3dExporter.h \ 396 Exporter.h \ 397 Containers.h \ 398 Material.h 399 400 Camera.o: Camera.cpp Camera.h \ 401 Ray.h \ 402 KdTree.h \ 403 Mesh.h \ 404 Exporter.h \ 405 Vector3.h \ 406 AxisAlignedBox3.h \ 407 common.h \ 408 Rectangle3.h \ 409 Matrix4x4.h \ 410 Plane3.h \ 411 Containers.h \ 412 Pvs.h \ 413 Intersectable.h \ 414 Material.h 415 416 X3dParser.o: X3dParser.cpp X3dParser.h \ 478 417 X3dParserXerces.h \ 479 418 Mesh.h \ … … 492 431 Vector3.h \ 493 432 common.h \ 494 Ray.h \ 495 496 497 MeshKdTree.obj: MeshKdTree.cpp \ 498 Environment.h \ 433 Ray.h 434 435 MeshKdTree.o: MeshKdTree.cpp Environment.h \ 499 436 Mesh.h \ 500 437 MeshKdTree.h \ … … 509 446 Vector3.h \ 510 447 Containers.h \ 511 Ray.h \ 512 513 514 Pvs.obj: Pvs.cpp \ 515 Pvs.h \ 516 517 518 MutualVisibility.obj: MutualVisibility.cpp \ 519 KdTree.h \ 448 Ray.h 449 450 Pvs.o: Pvs.cpp Pvs.h 451 452 MutualVisibility.o: MutualVisibility.cpp KdTree.h \ 520 453 AxisAlignedBox3.h \ 521 454 Ray.h \ … … 533 466 common.h \ 534 467 Material.h \ 535 Intersectable.h \ 536 537 538 Triangle3.obj: Triangle3.cpp \ 539 Triangle3.h \ 540 Vector3.h \ 541 common.h \ 542 543 544 Rectangle3.obj: Rectangle3.cpp \ 545 Rectangle3.h \ 546 Vector3.h \ 547 common.h \ 548 549 550 Plane3.obj: Plane3.cpp \ 551 Plane3.h \ 552 Matrix4x4.h \ 553 Vector3.h \ 554 common.h \ 555 556 557 Polygon3.obj: Polygon3.cpp \ 558 Polygon3.h \ 559 Mesh.h \ 560 ViewCellBsp.h \ 561 AxisAlignedBox3.h \ 562 Ray.h \ 563 Containers.h \ 564 Intersectable.h \ 565 Plane3.h \ 566 Matrix4x4.h \ 567 Material.h \ 568 Pvs.h \ 569 Rectangle3.h \ 570 Vector3.h \ 571 common.h \ 572 573 574 ViewCell.obj: ViewCell.cpp \ 575 ViewCell.h \ 468 Intersectable.h 469 470 Triangle3.o: Triangle3.cpp Triangle3.h \ 471 Vector3.h \ 472 common.h 473 474 Rectangle3.o: Rectangle3.cpp Rectangle3.h \ 475 Vector3.h \ 476 common.h 477 478 Plane3.o: Plane3.cpp Plane3.h \ 479 Matrix4x4.h \ 480 Vector3.h \ 481 common.h 482 483 Polygon3.o: Polygon3.cpp Polygon3.h \ 484 Mesh.h \ 485 ViewCellBsp.h \ 486 AxisAlignedBox3.h \ 487 Ray.h \ 488 Containers.h \ 489 Intersectable.h \ 490 Plane3.h \ 491 Matrix4x4.h \ 492 Material.h \ 493 Pvs.h \ 494 Rectangle3.h \ 495 Vector3.h \ 496 common.h 497 498 ViewCell.o: ViewCell.cpp ViewCell.h \ 576 499 Mesh.h \ 577 500 Intersectable.h \ … … 587 510 Rectangle3.h \ 588 511 Vector3.h \ 589 common.h \ 590 591 592 ViewCellBsp.obj: ViewCellBsp.cpp \ 593 Plane3.h \ 512 common.h 513 514 ViewCellBsp.o: ViewCellBsp.cpp Plane3.h \ 594 515 ViewCellBsp.h \ 595 516 Mesh.h \ … … 607 528 Material.h \ 608 529 Pvs.h \ 609 Rectangle3.h \ 610 611 612 Halton.obj: Halton.cpp \ 613 Halton.h \ 614 530 Rectangle3.h 531 532 Halton.o: Halton.cpp Halton.h 615 533 616 534 ####### Install -
trunk/VUT/GtpVisibilityPreprocessor/src/Mesh.cpp
r354 r359 295 295 ) 296 296 { 297 Plane3 plane; 298 int faceIndex = RandomValue(0, mFaces.size()-1); 299 for (int tries = 0; tries < maxTries; tries++) { 300 Face *face = mFaces[faceIndex]; 301 plane = GetFacePlane(faceIndex); 302 303 if (plane.Side(viewpoint) > 0) { 304 point = Vector3(0,0,0); 305 float sum = 0.0f; 306 // pickup a point inside this triangle 307 for (int i = 0; i < face->mVertexIndices.size(); i++) { 297 Plane3 plane; 298 int faceIndex = RandomValue(0, mFaces.size()-1); 299 int tries; 300 for (tries = 0; tries < maxTries; tries++) { 301 Face *face = mFaces[faceIndex]; 302 plane = GetFacePlane(faceIndex); 303 304 if (plane.Side(viewpoint) > 0) { 305 point = Vector3(0,0,0); 306 float sum = 0.0f; 307 // pickup a point inside this triangle 308 for (int i = 0; i < face->mVertexIndices.size(); i++) { 308 309 float r = RandomValue(0,1); 309 310 sum += r; 310 311 point += mVertices[face->mVertexIndices[i]]*r; 311 312 313 314 315 316 317 318 312 } 313 point *= 1.0f/sum; 314 break; 315 } 316 } 317 318 normal = plane.mNormal; 319 return (tries < maxTries) ? faceIndex + 1 : 0; 319 320 } 320 321 -
trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.cpp
r245 r359 603 603 vector<RayShaft *> shafts; 604 604 ConstructInitialSamples3(mSource, mTarget, shafts); 605 605 606 606 if (1) 607 607 ExportShafts(shafts, false); 608 608 609 609 stack<RayShaft *> shaftStack; 610 611 for (i nt i=0; i < shafts.size(); i++)610 int i; 611 for (i=0; i < shafts.size(); i++) 612 612 shaftStack.push(shafts[i]); 613 613 … … 627 627 break; 628 628 } 629 629 630 630 // compute error .... 631 631 ComputeError(*shaft); … … 635 635 636 636 if (shaft->mDepth < 10 && 637 shaft->mError > mSolidAngleThreshold) {637 shaft->mError > mSolidAngleThreshold) { 638 638 639 639 // generate 2 new samples … … 646 646 int axis; 647 647 if (splitSource) { 648 axis = shaft->mSource.DominantAxis();648 axis = shaft->mSource.DominantAxis(); 649 649 } else { 650 axis = shaft->mTarget.DominantAxis();650 axis = shaft->mTarget.DominantAxis(); 651 651 } 652 652 … … 678 678 679 679 MutualVisibilitySampler::MutualVisibilitySampler(SceneGraph *sceneGraph, 680 KdTree *kdTree,681 AxisAlignedBox3 &source,682 AxisAlignedBox3 &target,683 const float solidAngleThreshold)680 KdTree *kdTree, 681 const AxisAlignedBox3 &source, 682 const AxisAlignedBox3 &target, 683 const float solidAngleThreshold) 684 684 { 685 685 mSceneGraph = sceneGraph; … … 694 694 int 695 695 ComputeBoxVisibility(SceneGraph *sceneGraph, 696 KdTree *kdTree, 697 AxisAlignedBox3 &source, 698 AxisAlignedBox3 &target, 699 const float solidAngleThreshold) 700 { 701 MutualVisibilitySampler sampler(sceneGraph, kdTree, source, target, solidAngleThreshold); 696 KdTree *kdTree, 697 const AxisAlignedBox3 &source, 698 const AxisAlignedBox3 &target, 699 const float solidAngleThreshold) 700 { 701 MutualVisibilitySampler 702 sampler(sceneGraph, kdTree, source, target, solidAngleThreshold); 702 703 703 704 -
trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.h
r245 r359 88 88 89 89 MutualVisibilitySampler(SceneGraph *sceneGraph, 90 91 92 93 90 KdTree *kdTree, 91 const AxisAlignedBox3 &source, 92 const AxisAlignedBox3 &target, 93 const float solidAngleThreshold); 94 94 int 95 95 ComputeVisibility(); … … 97 97 void 98 98 ConstructInitialSamples( 99 100 101 102 103 99 const AxisAlignedBox3 &source, 100 const AxisAlignedBox3 &target, 101 vector<RayShaft *> &samples 102 ); 103 104 104 void 105 105 ConstructInitialSamples2( 106 107 108 109 110 106 const AxisAlignedBox3 &source, 107 const AxisAlignedBox3 &target, 108 vector<RayShaft *> &samples 109 ); 110 111 111 void 112 112 ConstructInitialSamples3( 113 114 115 116 117 113 const AxisAlignedBox3 &source, 114 const AxisAlignedBox3 &target, 115 vector<RayShaft *> &samples 116 ); 117 118 118 void 119 119 AddInitialSamples( 120 121 122 123 124 120 const Rectangle3 &sourceRect, 121 const Rectangle3 &targetRect, 122 vector<RayShaft *> &samples 123 ); 124 125 125 void 126 126 AddInitialSamples2( 127 128 129 130 131 127 const Rectangle3 &sourceRect, 128 const Rectangle3 &targetRect, 129 vector<RayShaft *> &samples 130 ); 131 132 132 // the split sample method contains a methodology to create new samples 133 133 // or terminate the sampling 134 134 bool 135 135 SplitSample( 136 137 138 139 136 const RayShaft &source, 137 RayShaft &sample1, 138 RayShaft &sample2 139 ); 140 140 void 141 141 PerformSplit( 142 143 144 145 146 147 142 const RayShaft &sample, 143 const bool splitSource, 144 const int axis, 145 RayShaft &sample1, 146 RayShaft &sample2 147 ); 148 148 149 149 150 150 bool 151 151 SampleTerminationCriteriaMet( 152 152 const RayShaft &sample); 153 153 154 154 float 155 155 GetSpatialAngle(const RayShaft &sample, 156 157 158 156 const Vector3 &point 157 ); 158 159 159 int 160 160 CastRays(RayShaft &shaft); 161 161 162 162 void 163 163 ComputeError(RayShaft &sample); … … 172 172 ComputeBoxVisibility(SceneGraph *sceneGraph, 173 173 KdTree *kdTree, 174 AxisAlignedBox3 &source,175 AxisAlignedBox3 &target,176 float solidAngleThreshold);174 const AxisAlignedBox3 &source, 175 const AxisAlignedBox3 &target, 176 const float solidAngleThreshold); 177 177 178 178 -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r355 r359 341 341 for (int j=0; j < invisibleNeighbors.size(); j++) { 342 342 int visibility = ComputeBoxVisibility(mSceneGraph, 343 344 345 346 343 mKdTree, 344 box, 345 mKdTree->GetBox(invisibleNeighbors[j]), 346 1e-6f); 347 347 // exit(0); 348 348 } -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp
r352 r359 48 48 ViewCell *ViewCell::ExtrudeViewCell(const Triangle3 &baseTri, const float height) 49 49 { 50 // one mesh per view cell 50 int i; 51 // one mesh per view cell 51 52 Mesh *mesh = new Mesh(); 52 53 … … 68 69 69 70 // add base vertices and calculate top vertices 70 for (inti = 0; i < 3; ++ i)71 for (i = 0; i < 3; ++ i) 71 72 mesh->mVertices.push_back(baseTri.mVertices[i]); 72 73 73 74 // add top vertices 74 for (i = 0; i < 3; ++ i)75 for (i = 0; i < 3; ++ i) 75 76 mesh->mVertices.push_back(baseTri.mVertices[i] + height * triNorm); 76 77 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r352 r359 98 98 class BspNode 99 99 { 100 friend BspTree;100 friend class BspTree; 101 101 102 102 public: … … 143 143 class BspInterior : public BspNode 144 144 { 145 friend BspTree;145 friend class BspTree; 146 146 public: 147 147 /** Standard contructor taking split plane as argument. … … 200 200 class BspLeaf : public BspNode 201 201 { 202 friend BspTree;202 friend class BspTree; 203 203 204 204 public:
Note: See TracChangeset
for help on using the changeset viewer.