Changeset 2714 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 05/26/08 16:41:12 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r2713 r2714 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: po 26. V 1 0:26:0620083 # Generated by qmake (2.00a) (Qt 4.1.2) on: po 26. V 14:55:33 2008 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2713 r2714 1765 1765 if (mUpdateDynamicObjects) 1766 1766 { 1767 // delete ALL dynamic stuff and rebuild using the new trafos 1768 preprocessor->mRayCaster->DeleteDynamicObjects(); 1769 1770 1771 1772 for (size_t i = 0; i < mDynamicObjects.size(); ++ i) 1773 { 1774 SceneGraphLeaf *l = mDynamicObjects[i]; 1775 1776 1777 1778 if (l->HasChanged()) 1767 1768 // delete ALL dynamic stuff and rebuild using the new trafos 1769 preprocessor->mRayCaster->DeleteDynamicObjects(); 1770 1771 #define MULTIPLE_OBJECTS 0 1772 #define CREATE_TRANSF_COPIES_OF_DYN_OBJECTS 1 1773 1774 #if MULTIPLE_OBJECTS 1775 #if CREATE_TRANSF_COPIES_OF_DYN_OBJECTS 1776 static ObjectContainer objects; 1777 1778 if (objects.size()) { 1779 for (size_t i = 0; i < objects.size(); ++ i) { 1780 delete objects[i]; 1781 } 1782 objects.clear(); 1783 } 1784 1785 for (size_t i = 0; i < mDynamicObjects.size(); ++ i) { 1786 SceneGraphLeaf *l = mDynamicObjects[i]; 1787 for (int j=0; j < l->mGeometry.size(); j++) { 1788 if (l->mGeometry[j]->Type() == Intersectable::TRIANGLE_INTERSECTABLE) { 1789 Triangle3 t(((TriangleIntersectable *)l->mGeometry[j])->GetItem()); 1790 t.ApplyTransformation(l->GetTransformation()); 1791 objects.push_back(new TriangleIntersectable(t)); 1792 } 1793 } 1794 } 1795 mRayCaster->AddDynamicObjecs(objects, IdentityMatrix()); 1796 #else 1797 mRayCaster->AddDynamicObjecs(objects, IdentityMatrix()); 1798 #endif 1799 #endif 1800 1801 SceneGraphLeaf *toUpdate = NULL; 1802 1803 for (size_t i = 0; i < mDynamicObjects.size(); ++ i) 1804 { 1805 SceneGraphLeaf *l = mDynamicObjects[i]; 1806 1807 #if !MULTIPLE_OBJECTS 1808 UpdateObjectInRayCaster(l); 1809 #endif 1810 1811 if (l->HasChanged()) 1779 1812 { 1780 UpdateObjectInRayCaster(l);1781 1813 1782 1814 cout<<"Updating affected PVSs..."<<endl; … … 1786 1818 } 1787 1819 } 1788 1789 mUpdateDynamicObjects = false; 1820 1821 1822 mUpdateDynamicObjects = false; 1823 1790 1824 } 1791 1825 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Triangle3.h
r2579 r2714 23 23 Vector3 GetCenter() const; 24 24 25 float GetSpatialAngle(const Vector3 &point) const; 25 void ApplyTransformation(const Matrix4x4 &m) { 26 for (int i = 0; i < 3; i++) 27 mVertices[i] = m*mVertices[i]; 28 } 29 30 float GetSpatialAngle(const Vector3 &point) const; 26 31 27 32 float GetArea() const;
Note: See TracChangeset
for help on using the changeset viewer.