Main Page | Namespace List | Class List | Directories | File List | Namespace Members | Class Members | File Members

iquadric_ui.cpp File Reference

#include <iquadric_ui.h>
#include <vector>
#include <cmath>
#include <maya/MFnCamera.h>
#include <maya/MFnTransform.h>
#include <maya/MTypes.h>
#include <maya/MVector.h>
#include <maya/MMatrix.h>
#include <maya/MFloatMatrix.h>
#include <iquadric_geo.h>
#include <iquadric_shading.h>
#include <imath.h>
#include <error_checker.h>
#include <imaterial.h>

Defines

#define LEAD_COLOR   18
#define ACTIVE_COLOR   15
#define ACTIVE_AFFECTED_COLOR   8
#define DORMANT_COLOR   4
#define HILITE_COLOR   17

Functions

void renderBBox (const MBoundingBox &bbox)
 Render bounding box.
void renderQuad (const std::vector< MPoint > &points)
 Render a screen-sized quad.
void generateQuad (M3dView &view, const MMatrix &local_inverse, std::vector< MPoint > &quad_points)
 Generate screen sized quad for rendering unlimited, infinite quadric Quad generation by querying Maya is necessary to get a consistent depth buffering.
MPoint getIntersection (float t, const MPoint &ray_base, const MVector &ray)
 Compute intersection point and check height limit for infinite quadrics.
bool getIntersectionLimited (float t, const MPoint &ray_base, const MVector &ray, float dist, MPoint center, MPoint &intersection)
 Compute intersection point and check height limit for infinite quadrics.
bool getTQuadric (const MPoint &ray_base, const MVector &ray3, const MMatrix &Quadric, MVector &t)
 Perform ray - quadric intersection.
bool intersectQuadric (const MPoint &ray_base, const MVector &ray3, const MMatrix &Quadric, double max_dist, bool is_limited, const MPoint &center, MPoint &intersection)

Detailed Description


Function Documentation

void @0::generateQuad M3dView &  view,
const MMatrix &  local_inverse,
std::vector< MPoint > &  quad_points
[static]
 

Generate screen sized quad for rendering unlimited, infinite quadric Quad generation by querying Maya is necessary to get a consistent depth buffering.

Parameters:
view current view
quad_points storage for the corner points of the quad

MPoint @0::getIntersection float  t,
const MPoint &  ray_base,
const MVector &  ray
[inline, static]
 

Compute intersection point and check height limit for infinite quadrics.

Parameters:
t 
ray_base origin / base of the ray
ray current ray (normalized!)

bool @0::getIntersectionLimited float  t,
const MPoint &  ray_base,
const MVector &  ray,
float  dist,
MPoint  center,
MPoint &  intersection
[inline, static]
 

Compute intersection point and check height limit for infinite quadrics.

Returns:
true if the given parameter describe a valid intersection, otherwise false
Parameters:
t 
ray_base origin / base of the ray
ray current ray (normalized!)
dist maximal (allowed) distance between center and surface
center center of the quadric
intersection intersection point (use only if return value is true)

bool @0::getTQuadric const MPoint &  ray_base,
const MVector &  ray3,
const MMatrix &  Quadric,
MVector &  t
[static]
 

Perform ray - quadric intersection.

Returns:
true if at least one valid parameter value t has been found
Parameters:
ray_base base / origin of ray
ray3 ray direction (normalized!)
Quadric parameter matrix of quadric
t x and y component are storage for the t ray parameters found (which give a solution) t contains the values in sorted order, if the second elemnt is zero then only one valid parameter exist
Note:
The ray base vector and ray origin vector have to have a the standard homogenious coordinates (direction: w=0, base: w=1)

void @0::renderBBox const MBoundingBox &  bbox  )  [static]
 

Render bounding box.

Parameters:
bbox bounding box to draw
Note:
At the moment a screen size quad is drawn! First have to figure out how to compute the bbox efficiently.

void @0::renderQuad const std::vector< MPoint > &  points  )  [static]
 

Render a screen-sized quad.

Parameters:
points points of the plane form lower-left to upper-left CCW


Generated on Sat Dec 31 18:07:49 2005 for ICaster by  doxygen 1.4.4