diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-01-25 02:12:57 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-01-25 02:12:57 +0300 |
commit | 3c09bd41fc9ef072f62f52a6661a6a41136bb421 (patch) | |
tree | e25467561101c9f7881dcaa15d56f38727aa223f /source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h | |
parent | 1e9ff2700d15de1461dde67985118778978f21be (diff) |
Clipping of imported meshes by the near and far view planes.
A straightforward clipping algorithm was implemented to
eliminate vertices that are out of the interval from the
near to far clipping distance defined by the active camera.
Previously, objects that come behind the camera could lead
to a crash. The changes in this commit is intended to
address this issue. When meshes are partially clipped, new
edges are added. These edges can result in visible strokes
if they are within the camera view.
Diffstat (limited to 'source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h')
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h index 29acbfc203f..59fa5923b36 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h +++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h @@ -33,6 +33,18 @@ extern "C" { class NodeGroup; +struct LoaderState { + float *pv; + float *pn; + unsigned *pvi; + unsigned *pni; + unsigned *pmi; + unsigned currentIndex; + unsigned currentMIndex; + float minBBox[3]; + float maxBBox[3]; +}; + class LIB_SCENE_GRAPH_EXPORT BlenderFileLoader { public: @@ -51,6 +63,10 @@ public: protected: void insertShapeNode(ObjectRen *obr, int id); + int countClippedFaces(VertRen *v1, VertRen *v2, VertRen *v3, int clipped[3]); + void clipLine(VertRen *v1, VertRen *v2, float c[3], float z); + void clipTriangle(int numTris, float triCoords[][3], VertRen *v1, VertRen *v2, VertRen *v3, int clip[3]); + void addTriangle(struct LoaderState *state, float v1[3], float v2[3], float v3[3]); protected: Render* _re; |