Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
halfspace3d Class Reference

#include <vector3d.h>

Collaboration diagram for halfspace3d:

Public Types

typedef const vector3d cv
 

Public Member Functions

 halfspace3d ()
 
 halfspace3d (cv &p1, cv &p2, cv &p3)
 
 halfspace3d (cv &p1, cv &p2, cv &p3, cv &in)
 
 halfspace3d (cv &norm, cv &p0)
 
void init (cv &p1, cv &p2, cv &p3)
 
void initCheck (cv &p1, cv &p2, cv &p3, cv &in)
 
real side (cv &pt) const
 
real intersect (cv &pos, cv &dir) const
 
vector3d intersectPt (cv &start, cv &dir) const
 

Public Attributes

vector3d n
 
real d
 

Detailed Description

Definition at line 182 of file vector3d.h.

Member Typedef Documentation

typedef const vector3d cv

Definition at line 188 of file vector3d.h.

Constructor & Destructor Documentation

halfspace3d ( )
inline

Definition at line 189 of file vector3d.h.

189 {}
halfspace3d ( cv p1,
cv p2,
cv p3 
)
inline

Definition at line 190 of file vector3d.h.

References init().

190 {init(p1,p2,p3);}
NT p1
void init(cv &p1, cv &p2, cv &p3)
Definition: vector3d.h:197

Here is the call graph for this function:

halfspace3d ( cv p1,
cv p2,
cv p3,
cv in 
)
inline

Definition at line 191 of file vector3d.h.

References initCheck().

191 {initCheck(p1,p2,p3,in);}
void initCheck(cv &p1, cv &p2, cv &p3, cv &in)
Definition: vector3d.h:203
NT p1

Here is the call graph for this function:

halfspace3d ( cv norm,
cv p0 
)
inline

Definition at line 193 of file vector3d.h.

References d, vector3d::dot(), n, and nvc::norm().

193 {n=norm;d=-n.dot(p0);}
T norm(const NVec< DIM, T > &v)
vector3d n
Definition: vector3d.h:185
NT p0
real dot(const vector3d &b) const
Definition: vector3d.h:139

Here is the call graph for this function:

Member Function Documentation

void init ( cv p1,
cv p2,
cv p3 
)
inline

Definition at line 197 of file vector3d.h.

References nvc::cross(), d, vector3d::dot(), n, and p1.

Referenced by halfspace3d(), and initCheck().

197  {
198  n=(p2-p1).cross(p3-p1);
199  d=-n.dot(p1);
200  }
NVec< 3, T > cross(const NVec< 3, T > &u, const NVec< 3, T > &v)
NT p1
vector3d n
Definition: vector3d.h:185
real dot(const vector3d &b) const
Definition: vector3d.h:139

Here is the call graph for this function:

Here is the caller graph for this function:

void initCheck ( cv p1,
cv p2,
cv p3,
cv in 
)
inline

Definition at line 203 of file vector3d.h.

References d, init(), n, and side().

Referenced by halfspace3d().

204  { init(p1,p2,p3); if (side(in)<0) {n=-n;d=-d;} }
NT p1
vector3d n
Definition: vector3d.h:185
void init(cv &p1, cv &p2, cv &p3)
Definition: vector3d.h:197
real side(cv &pt) const
Definition: vector3d.h:208

Here is the call graph for this function:

Here is the caller graph for this function:

real intersect ( cv pos,
cv dir 
) const
inline

Definition at line 212 of file vector3d.h.

References d, vector3d::dot(), and n.

Referenced by intersectPt().

213  {return -(d+n.dot(pos))/n.dot(dir);}
vector3d n
Definition: vector3d.h:185
real dot(const vector3d &b) const
Definition: vector3d.h:139

Here is the call graph for this function:

Here is the caller graph for this function:

vector3d intersectPt ( cv start,
cv dir 
) const
inline

Definition at line 217 of file vector3d.h.

References intersect().

218  {
219  return start+dir*intersect(start,dir);
220  }
real intersect(cv &pos, cv &dir) const
Definition: vector3d.h:212

Here is the call graph for this function:

real side ( cv pt) const
inline

Definition at line 208 of file vector3d.h.

References d, vector3d::dot(), and n.

Referenced by c3d6nm(), and initCheck().

209  {return n.dot(pt)+d;}
vector3d n
Definition: vector3d.h:185
real dot(const vector3d &b) const
Definition: vector3d.h:139

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

real d

Definition at line 186 of file vector3d.h.

Referenced by halfspace3d(), init(), initCheck(), intersect(), and side().

Definition at line 185 of file vector3d.h.

Referenced by halfspace3d(), init(), initCheck(), intersect(), and side().


The documentation for this class was generated from the following file: