diff options
author | Maxime Curioni <maxime.curioni@gmail.com> | 2009-08-04 04:40:36 +0400 |
---|---|---|
committer | Maxime Curioni <maxime.curioni@gmail.com> | 2009-08-04 04:40:36 +0400 |
commit | bd92aea926d66cdb2548fbdd7e8d8b28208fad6d (patch) | |
tree | a146154c1310427608a393d6325dcc3c1929765f /source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp | |
parent | ff110c17f705976435ee14f2cde9c85f7334a56c (diff) |
SUMMARY:
The main contribution of this commit is the possibility to save Freestyle configuration information inside .blend files. It required an extensive refactoring of the previous interface code.
The code has been tested and does not crash on my machine. If you encounter issues, please let me know (and if possible, sending me an sample .blend file).
DETAILS:
- refactored code to notify Freestyle when adding/removing render layers (FRS_freestyle_config.{h,cpp})
- corrected the freeing of style modules when files are read from / written to disk
- moved Freestyle configuration information into scene renderlayers, to allow loading / saving .blend files (DNA_scene_types.h DNA_freestyle_types.h FRS_freestyle.cpp)
- inserted temporary trick to prevent crashes when orthographic camera is used (SilhouetteGeomEngine.cpp), but outputting incorrect feature line calculations
Diffstat (limited to 'source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp')
-rwxr-xr-x | source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp index 33c1115e94f..ecb0a4979f0 100755 --- a/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp +++ b/source/blender/freestyle/intern/view_map/SilhouetteGeomEngine.cpp @@ -52,7 +52,8 @@ real SilhouetteGeomEngine::_glModelViewMatrix[4][4] = {{1,0,0,0}, {0,0,0,1}}; real SilhouetteGeomEngine::_znear = 0.0; real SilhouetteGeomEngine::_zfar = 100.0; - +bool SilhouetteGeomEngine::_isOrthographicProjection = false; + SilhouetteGeomEngine * SilhouetteGeomEngine::_pInstance = 0; void SilhouetteGeomEngine::setTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal) @@ -91,6 +92,8 @@ void SilhouetteGeomEngine::setTransform(const real iModelViewMatrix[4][4], const _viewport[i] = iViewport[i]; } _Focal = iFocal; + + _isOrthographicProjection = (iProjectionMatrix[3][3] != 0.0); } void SilhouetteGeomEngine::setFrustum(real iZNear, real iZFar) @@ -146,6 +149,10 @@ void SilhouetteGeomEngine::ProjectSilhouette(SVertex* ioVertex) real SilhouetteGeomEngine::ImageToWorldParameter(FEdge *fe, real t) { + + if( _isOrthographicProjection ) + return t; + // we need to compute for each parameter t the corresponding // parameter T which gives the intersection in 3D. //currentEdge = (*fe); |