53 #ifndef ACG_TRIANGLENODE_HH 54 #define ACG_TRIANGLENODE_HH 58 #include "BaseNode.hh" 75 typedef std::vector<ACG::Vec3f> PointVector;
78 const std::string& _name=
"<TriangleNode>" );
86 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax)
override;
94 point_.push_back( _p0 );
95 point_.push_back( _p1 );
96 point_.push_back( _p2 );
99 if ( n.
norm() > 0.00001 )
102 n =
Vec3f( 0, 0, 0 );
103 normal_.push_back( n );
112 size_t n_triangles()
const {
return point_.size() / 3; }
114 void triangle(
int _i,
119 _p0 = point_[ 3 * _i + 0 ];
120 _p1 = point_[ 3 * _i + 1 ];
121 _p2 = point_[ 3 * _i + 2 ];
126 enum FaceMode { FACE_NORMALS, FACE_COLORS, PER_VERTEX };
128 void draw_vertices();
130 void draw_wireframe();
142 #endif // ACG_TRIMESHNODE_HH defined
Namespace providing different geometric functions concerning angles.
PickTarget
What target to use for picking.
VectorT< float, 3 > Vec3f
auto norm() const -> decltype(std::sqrt(std::declval< VectorT< S, DIM >>().sqrnorm()))
compute euclidean norm
auto normalize() -> decltype(*this/=std::declval< VectorT< S, DIM >>().norm())