Files Classes Functions Hierarchy
#include <d2simplex.h>
Public Member Functions | |
| bool const | intersects (d2simplex const &s2) const |
| Do the two simplexes intersect? | |
| bool const | sees (d2simplex const &s2) const |
| If one simplex sees the other there is no intersection. | |
| void | rotate (doublec theta) |
| Anticlockwise rotation of the simplex about its center. | |
| void | translate (pt2c &x) |
| Shift the simplex. | |
Public Attributes | |
| point2< double > | v [3] |
| Ordered in anticlockwise direction. | |
Definition at line 14 of file d2simplex.h.
| void d2simplex::rotate | ( | doublec | theta | ) |
Anticlockwise rotation of the simplex about its center.
Definition at line 16 of file d2simplex.cpp.
References d2homogeneous::matrixMultiply(), d2homogeneous::setRotateAboutPoint(), and v.
Referenced by d2simplextestmenu01::readImmediate().
00017 { 00018 point2<double> c(v[0]); 00019 c += v[1]; 00020 c += v[2]; 00021 c *= (1.0/3.0); 00022 00023 d2homogeneous R; 00024 00025 R.setRotateAboutPoint(theta,c); 00026 00027 for (uint i=0; i<3; ++i) 00028 R.matrixMultiply(v[i]); 00029 00030 /* 00031 double const cos_t = cos(theta); 00032 double const sin_t = sin(theta); 00033 00034 pt2c r1(cos_t,-sin_t); 00035 pt2c r2(sin_t,cos_t); 00036 00037 pt2 z; 00038 for (uint i=0; i<3; ++i) 00039 { 00040 z.x = r1.dot(v[i]); 00041 z.y = r2.dot(v[i]); 00042 v[i] = z; 00043 } 00044 */ 00045 00046 00047 }
| void d2simplex::translate | ( | pt2c & | x | ) |
Shift the simplex.
Definition at line 9 of file d2simplex.cpp.
References v.
Referenced by d2simplextestmenu01::readImmediate(), and d2simplextest::test01().
| point2<double> d2simplex::v[3] |
Ordered in anticlockwise direction.
Definition at line 19 of file d2simplex.h.
Referenced by d2simplexNormals::draw(), d2simplexFill::draw(), d2simplexOutline::draw(), rotate(), d2simplexSeparateAxis::sees(), d2simplextest::test01(), and translate().
1.5.8