Files Classes Functions Hierarchy
#include <d2simplexintersection.h>
Public Member Functions | |
| d2simplexintersection (d2simplex &s1, d2simplex &s2) | |
| Constructor. | |
| void | draw () |
| Draws the two triangles and colors them in if they intersect. | |
Public Attributes | |
| d2simplex & | s1 |
| Triangle 1. | |
| d2simplex & | s2 |
| Triangle 2. | |
| d2simplexOutline | s1g |
| Draw triangle 1's edges. | |
| d2simplexOutline | s2g |
| Draw triangle 2's edges. | |
| bool | intersection |
| Set to true when intersection occures. | |
Definition at line 50 of file d2simplexintersection.h.
Constructor.
Definition at line 38 of file d2simplexintersection.cpp.
00042 : s1(_s1), s2(_s2), s1g(s1), s2g(s2), intersection(false) 00043 { 00044 }
| void d2simplexintersection::draw | ( | ) | [virtual] |
Draws the two triangles and colors them in if they intersect.
Implements gobj.
Definition at line 10 of file d2simplexintersection.cpp.
References d2simplexOutline::draw(), intersection, s1, s1g, s2, and s2g.
00011 { 00012 glPushAttrib(GL_LIGHTING); 00013 glPushAttrib(GL_CURRENT_BIT); 00014 00015 glDisable(GL_LIGHTING); 00016 00017 if (intersection) 00018 { 00019 glColor3ub(255,0,0); 00020 00021 d2simplexFill(s1).draw(); 00022 d2simplexFill(s2).draw(); 00023 } 00024 00025 glColor3ub(0,255,127); 00026 s1g.draw(); 00027 d2simplexNormals(s1).draw(); 00028 00029 glColor3ub(255,255,0); 00030 s2g.draw(); 00031 d2simplexNormals(s2).draw(); 00032 00033 glPopAttrib(); 00034 glPopAttrib(); 00035 }
Set to true when intersection occures.
Definition at line 65 of file d2simplexintersection.h.
Referenced by draw(), and d2simplextest::intersection().
Draw triangle 1's edges.
Definition at line 60 of file d2simplexintersection.h.
Referenced by draw().
Draw triangle 2's edges.
Definition at line 62 of file d2simplexintersection.h.
Referenced by draw().
1.5.8