|
Revision 10853, 1.6 kB
(checked in by robert, 3 years ago)
|
|
From Sukender,
"Here is our freshly baked 3DS reader/writer (named 'v0.5' to differentiate from previous one). Changes are against trunk rev. 10819.
Short changelog (from rev 10819):
- Added 3DS writer
- Sync'd with latest lib3DS
- Added options, especially "flattenMatrixTransforms" to get the "old" behaviour (else the reader correctly maps to OSG the transforms from the 3DS file).
What should be done:
- Check with pivot points, with and without "flattenMatrixTransforms" option.
- We ran tests on it, but we can never be 100% sure there is no bug. Testing from the community would of course be helpful."
|
| Line | |
|---|
| 1 | #ifndef _3DS_WRITER_COMPARE_TRIANGLE_HEADER__ |
|---|
| 2 | #define _3DS_WRITER_COMPARE_TRIANGLE_HEADER__ |
|---|
| 3 | |
|---|
| 4 | #include <osg/Geode> |
|---|
| 5 | #include <osg/Geometry> |
|---|
| 6 | #include <iostream> |
|---|
| 7 | |
|---|
| 8 | struct Triangle |
|---|
| 9 | { |
|---|
| 10 | unsigned int t1; |
|---|
| 11 | unsigned int t2; |
|---|
| 12 | unsigned int t3; |
|---|
| 13 | unsigned int material; |
|---|
| 14 | }; |
|---|
| 15 | |
|---|
| 16 | class WriterCompareTriangle { |
|---|
| 17 | public: |
|---|
| 18 | WriterCompareTriangle(const osg::Geode & geode, unsigned int nbVertices); |
|---|
| 19 | |
|---|
| 20 | bool operator()(const std::pair<Triangle, int> & t1, |
|---|
| 21 | const std::pair<Triangle, int> & t2) const; |
|---|
| 22 | private: |
|---|
| 23 | void |
|---|
| 24 | setMaxMin(unsigned int & nbVerticesX, |
|---|
| 25 | unsigned int & nbVerticesY, |
|---|
| 26 | unsigned int & nbVerticesZ) const; |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | void |
|---|
| 34 | cutscene(int nbVertices, |
|---|
| 35 | const osg::BoundingBox & sceneBox); |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | int inWhichBox(const osg::BoundingBox::value_type x, |
|---|
| 43 | const osg::BoundingBox::value_type y, |
|---|
| 44 | const osg::BoundingBox::value_type z) const; |
|---|
| 45 | int inWhichBox(const osg::BoundingBox::vec_type & point) const; |
|---|
| 46 | |
|---|
| 47 | const osg::Geode & geode; |
|---|
| 48 | std::vector<osg::BoundingBox> boxList; |
|---|
| 49 | }; |
|---|
| 50 | |
|---|
| 51 | #endif // _3DS_WRITER_COMPARE_TRIANGLE_HEADER__ |
|---|