PDRectangle Class Reference

#include <pDomain.h>

Inheritance diagram for PDRectangle:

Inheritance graph
[legend]
Collaboration diagram for PDRectangle:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 PDRectangle (const pVec &p0, const pVec &u0, const pVec &v0)
 ~PDRectangle ()
bool Within (const pVec &pos) const
pVec Generate () const
pDomaincopy () const

Public Attributes

pVec p
pVec u
pVec v
pVec uNrm
pVec vNrm
pVec nrm
float uLen
float vLen
float D


Detailed Description

Definition at line 140 of file pDomain.h.


Constructor & Destructor Documentation

PDRectangle::PDRectangle ( const pVec p0,
const pVec u0,
const pVec v0 
) [inline]

Definition at line 147 of file pDomain.h.

References D, pVec::length(), pVec::normalize(), nrm, p, u, uLen, uNrm, v, vLen, and vNrm.

Referenced by copy().

00148     {
00149         p = p0;
00150         u = u0;
00151         v = v0;
00152 
00153         // The rest of this is needed for Avoid and Bounce.
00154         uLen = u.length();
00155         uNrm = u / uLen;
00156         vLen = v.length();
00157         vNrm = v / vLen;
00158 
00159         nrm = Cross(uNrm, vNrm); // This is the non-unit normal.
00160         nrm.normalize(); // Must normalize it.
00161 
00162         D = -(p * nrm);
00163     }

Here is the call graph for this function:

Here is the caller graph for this function:

PDRectangle::~PDRectangle (  )  [inline]

Definition at line 165 of file pDomain.h.

00166     {
00167         // std::cerr << "del " << typeid(*this).name() << this << std::endl;
00168     }


Member Function Documentation

bool PDRectangle::Within ( const pVec pos  )  const [inline, virtual]

Implements pDomain.

Definition at line 170 of file pDomain.h.

00171     {
00172         return false;
00173     }

pVec PDRectangle::Generate (  )  const [inline, virtual]

Implements pDomain.

Definition at line 175 of file pDomain.h.

References p, pos, pRandf, u, and v.

00176     {
00177         pVec pos = p + u * pRandf() + v * pRandf();
00178         return pos;
00179     }

pDomain* PDRectangle::copy (  )  const [inline, virtual]

Implements pDomain.

Definition at line 181 of file pDomain.h.

References PDRectangle().

00182     {
00183         PDRectangle *P = new PDRectangle(*this);
00184         return P;
00185     }

Here is the call graph for this function:


Member Data Documentation

pVec PDRectangle::p

Definition at line 143 of file pDomain.h.

Referenced by PABounce::Exec(), PAAvoid::Exec(), Generate(), and PDRectangle().

pVec PDRectangle::u

Definition at line 143 of file pDomain.h.

Referenced by PABounce::Exec(), PAAvoid::Exec(), Generate(), and PDRectangle().

pVec PDRectangle::v

Definition at line 143 of file pDomain.h.

Referenced by PABounce::Exec(), PAAvoid::Exec(), Generate(), and PDRectangle().

pVec PDRectangle::uNrm

Definition at line 143 of file pDomain.h.

Referenced by PAAvoid::Exec(), and PDRectangle().

pVec PDRectangle::vNrm

Definition at line 143 of file pDomain.h.

Referenced by PAAvoid::Exec(), and PDRectangle().

pVec PDRectangle::nrm

Definition at line 143 of file pDomain.h.

Referenced by PABounce::Exec(), PAAvoid::Exec(), and PDRectangle().

float PDRectangle::uLen

Definition at line 144 of file pDomain.h.

Referenced by PDRectangle().

float PDRectangle::vLen

Definition at line 144 of file pDomain.h.

Referenced by PDRectangle().

float PDRectangle::D

Definition at line 144 of file pDomain.h.

Referenced by PABounce::Exec(), PAAvoid::Exec(), and PDRectangle().


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:51:57 2008 for Armagetron Advanced by  doxygen 1.5.4