Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::_internal::UIGeom Class Reference

Piece of 3D geometry that tracks its own 2D projection. More...

#include <ThirdPersonManipulator.h>

List of all members.

Public Member Functions

void computeProjection (RenderDevice *rd)
bool contains (const Vector2 &p, float &nearestDepth, Vector2 &tangent2D, float &projectionW, float lineRadius=9) const
void render (RenderDevice *rd, float lineScale=1.0f)
 UIGeom ()

Public Attributes

Array< PolyLine2Dline2D
Array< PolyLineline3D
Array< Array< float > > lineDepth
Array< Array< float > > lineW
Array< ConvexPolygon2Dpoly2D
Array< ConvexPolygonpoly3D
Array< bool > polyBackfacing
Array< float > polyDepth
bool visible

Static Protected Member Functions

static Vector3 computeEye (RenderDevice *rd)
static Vector3 segmentNormal (const LineSegment &seg, const Vector3 &eye)

Protected Attributes

bool m_twoSidedPolys


Detailed Description

Piece of 3D geometry that tracks its own 2D projection.

For use in building 3D clickable widgets using only 2D code.

The 2D approach allows the click width around a line to be constant width; it also allows the use of arbitrary projection matrices. However, it has problems at the near plane unlike a ray-cast 3D approach.


Constructor & Destructor Documentation

G3D::_internal::UIGeom::UIGeom (  )  [inline]


Member Function Documentation

static Vector3 G3D::_internal::UIGeom::computeEye ( RenderDevice rd  )  [static, protected]

Returns the object space eye point.

void G3D::_internal::UIGeom::computeProjection ( RenderDevice rd  ) 

Computes the 2D positions from the 3D ones using the renderDevice and updates the zOrder.

bool G3D::_internal::UIGeom::contains ( const Vector2 p,
float &  nearestDepth,
Vector2 tangent2D,
float &  projectionW,
float  lineRadius = 9 
) const

Returns true and sets nearestDepth (on the range 0 = close, 1 = far) if p is in a polygon (or within lineRadius of the nearest line) and the depth of that object is less than nearestDepth, otherwise returns false.

depth values are approximate.

Parameters:
tangent2D Returns the projected tangent (unit length 3D vector projected into 2D, which then has non-unit length) to the selected location if it was a line; undefined if it was a plane.
projectionW Returns the if close to a line.

void G3D::_internal::UIGeom::render ( RenderDevice rd,
float  lineScale = 1.0f 
)

Render in 3D using the current blending mode, etc.

Line normals are set to face towards the camera, perpendicular to the line.

static Vector3 G3D::_internal::UIGeom::segmentNormal ( const LineSegment seg,
const Vector3 eye 
) [static, protected]

Returns the normal to a line segment.


Member Data Documentation

Recomputed from 3D in the computeProjection method.

Relative to the "current" object to world matrix.

If true, backface polygons are tested for mouse clicks.

Recomputed from 3D in the computeProjection method.

Relative to the "current" object to world matrix.

If last time we rendered the poly3D was backwards.


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:49 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo