ESyS-Particle
4.0.1
|
Class representing the edge of a polygon. More...
#include <Edge.h>
Public Member Functions | |
Edge (int, int, const Vec3 &, const Vec3 &) | |
Edge (int, int, const Vec3 &, const Vec3 &, Triangle *) | |
Edge (int, int, const Vec3 &, const Vec3 &, Triangle *, Triangle *) | |
bool | isValidContact (const Vec3 &) const |
Vec3 | getBoundingBoxMin () const |
Vec3 | getBoundingBoxMax () const |
Vec3 | getDirectionFromPoint (const Vec3 &) const |
void | moveNode (int, const Vec3 &) |
void | move (const Vec3 &) |
void | applyForce (const Vec3 &f) |
pair< int, int > | getIDs () const |
Friends | |
ostream & | operator<< (ostream &, const Edge &) |
Class representing the edge of a polygon.
Edge::Edge | ( | int | id1, |
int | id2, | ||
const Vec3 & | p1, | ||
const Vec3 & | p2 | ||
) |
Construct edge from 2 points. Set triangle pointers to NULL
id1 | the id of p1 |
id2 | the id of p2 |
p1 | |
p2 |
Edge::Edge | ( | int | id1, |
int | id2, | ||
const Vec3 & | p1, | ||
const Vec3 & | p2, | ||
Triangle * | t1 | ||
) |
Construct edge from 2 points and 1 triangle pointer. Set other triangle pointer to NULL
id1 | the id of p1 |
id2 | the id of p2 |
p1 | |
p2 | |
t1 |
Edge::Edge | ( | int | id1, |
int | id2, | ||
const Vec3 & | p1, | ||
const Vec3 & | p2, | ||
Triangle * | t1, | ||
Triangle * | t2 | ||
) |
Construct edge from 2 points and 2 triangle pointers.
id1 | the id of p1 |
id2 | the id of p2 |
p1 | |
p2 | |
t1 | |
t2 |
Vec3 Edge::getBoundingBoxMax | ( | ) | const |
Get min. corner of axis-aligned bounding box.
Reimplemented from AEdge.
Vec3 Edge::getBoundingBoxMin | ( | ) | const |
Get min. corner of axis-aligned bounding box.
Reimplemented from AEdge.
Vec3 Edge::getDirectionFromPoint | ( | const Vec3 & | p | ) | const |
get unit direction vector between a point and the closest point along the supporting line of the edge (pointing away from the edge).
p | the point |
Referenced by EEdgeInteraction::calcForces().
bool Edge::isValidContact | ( | const Vec3 & | P | ) | const |
Check if any of the adjacent triangles (if there are any) has contact, i.e the perpendicular line from the supporting plane to the point hits the triangle, an thus makes the edge contact invalid
P | the point |
References Triangle::dist().
Referenced by EEdgeInteraction::calcForces().
void Edge::move | ( | const Vec3 & | d | ) |
Translate whole edge
d | the amount of movement |
void Edge::moveNode | ( | int | id, |
const Vec3 & | d | ||
) |
Move one of the corners. The identifier for the corner is the global node id. If the edge doesn't contain the node with the id , do nothing.
id | the global id of the node to be moved |
d | the amount of movement |