AbstractPolyList Class Reference#include <abstractPolyList.h>
Inheritance diagram for AbstractPolyList:
Detailed Description
A polygon filtering interface.
The various AbstractPolyList subclasses are used in Torque as an interface to handle spatial queries. SceneObject::buildPolyList() takes an implementor of AbstractPolyList (such as ConcretePolyList, ClippedPolyList, etc.) and a bounding volume. The function runs geometry data from all the objects in the bounding volume through the passed PolyList.
This interface only provides a method to get data INTO your implementation. Different subclasses provide different interfaces to get data back out, depending on their specific quirks.
The physics engine now uses convex hulls for collision detection.
- See also:
- Convex
|
Public Member Functions |
| | AbstractPolyList () |
| virtual | ~AbstractPolyList () |
|
| void | setBaseTransform (const MatrixF &mat) |
| void | setTransform (const MatrixF *mat, const Point3F &scale) |
| | Sets the transform applying to the current stream of vertices.
|
| void | getTransform (MatrixF *mat, Point3F *scale) |
| | Gets the transform applying to the current stream of vertices.
|
| void | setObject (SceneObject *) |
| | This is called by the object which is currently feeding us vertices, to tell us who it is.
|
| void | addBox (const Box3F &box) |
| | Add a box via the query interface (below).
|
| void | doConstruct () |
|
It is through this interface that geometry data is fed to the PolyList. The order of calls are:
- begin()
- One or more calls to vertex() and one call to plane(), in any order.
- end()
U32 base = addPoint(pos);
pos.y += dy; addPoint(pos);
pos.x += dx; addPoint(pos);
pos.y -= dy; addPoint(pos);
pos.z += dz; addPoint(pos);
pos.x -= dx; addPoint(pos);
pos.y += dy; addPoint(pos);
pos.x += dx; addPoint(pos);
for (S32 i = 0; i < 6; i++) {
begin(0,i);
S32 v1 = base + PolyFace[i][0];
S32 v2 = base + PolyFace[i][1];
S32 v3 = base + PolyFace[i][2];
S32 v4 = base + PolyFace[i][3];
vertex(v1);
vertex(v2);
vertex(v3);
vertex(v4);
plane(v1,v2,v3);
end();
}
|
| virtual bool | isEmpty () const =0 |
| | Are we empty of data?
|
| virtual U32 | addPoint (const Point3F &p)=0 |
| | Adds a point to the poly list, and returns an ID number for that point.
|
| virtual U32 | addPlane (const PlaneF &plane)=0 |
| | Adds a plane to the poly list, and returns an ID number for that point.
|
| virtual void | begin (U32 material, U32 surfaceKey)=0 |
| | Start a surface.
|
| virtual void | plane (U32 v1, U32 v2, U32 v3)=0 |
| | Indicate the plane of the surface.
|
| virtual void | plane (const PlaneF &p)=0 |
| | Indicate the plane of the surface.
|
| virtual void | plane (const U32 index)=0 |
| | Indicate the plane of the surface.
|
| virtual void | vertex (U32 vi)=0 |
| | Reference a vertex which is in this surface.
|
| virtual void | end ()=0 |
| | Mark the end of a surface.
|
| virtual bool | getMapping (MatrixF *, Box3F *) |
| | Return list transform and bounds in list space.
|
|
This is a mechanism to let you specify interest in a specific normal. If you set a normal you're interested in, then any planes facing "away" from that normal are culled from the results.
This is handy if you're using this to do a physics check, as you're not interested in polygons facing away from you (since you don't collide with the backsides/insides of things).
|
| void | setInterestNormal (const Point3F &normal) |
| void | clearInterestNormal () |
| virtual bool | isInterestedInPlane (const PlaneF &plane) |
| virtual bool | isInterestedInPlane (const U32 index) |
Protected Member Functions |
| virtual const PlaneF & | getIndexedPlane (const U32 index)=0 |
| | A helper function to convert a plane index to a PlaneF structure.
|
Protected Attributes |
| SceneObject * | mCurrObject |
| MatrixF | mBaseMatrix |
| MatrixF | mTransformMatrix |
| MatrixF | mMatrix |
| Point3F | mScale |
| PlaneTransformer | mPlaneTransformer |
| bool | mInterestNormalRegistered |
| Point3F | mInterestNormal |
Constructor & Destructor Documentation
| AbstractPolyList::AbstractPolyList |
( |
|
) |
[inline] |
|
| virtual AbstractPolyList::~AbstractPolyList |
( |
|
) |
[virtual] |
|
Member Function Documentation
| void AbstractPolyList::setBaseTransform |
( |
const MatrixF & |
mat |
) |
[inline] |
|
| void AbstractPolyList::setTransform |
( |
const MatrixF * |
mat, |
|
|
const Point3F & |
scale |
|
) |
[inline] |
|
|
|
Sets the transform applying to the current stream of vertices.
- Parameters:
-
| mat | Transformation of the object. (in) |
| scale | Scaling of the object. (in) |
|
|
|
Gets the transform applying to the current stream of vertices.
- Parameters:
-
| mat | Transformation of the object. (out) |
| scale | Scaling of the object. (out) |
|
|
|
This is called by the object which is currently feeding us vertices, to tell us who it is.
|
| void AbstractPolyList::addBox |
( |
const Box3F & |
box |
) |
|
|
|
|
Add a box via the query interface (below).
This wraps some calls to addPoint and addPlane. |
| void AbstractPolyList::doConstruct |
( |
|
) |
[inline] |
|
| virtual bool AbstractPolyList::isEmpty |
( |
|
) |
const [pure virtual] |
|
| virtual U32 AbstractPolyList::addPoint |
( |
const Point3F & |
p |
) |
[pure virtual] |
|
| virtual U32 AbstractPolyList::addPlane |
( |
const PlaneF & |
plane |
) |
[pure virtual] |
|
| virtual void AbstractPolyList::begin |
( |
U32 |
material, |
|
|
U32 |
surfaceKey |
|
) |
[pure virtual] |
|
| virtual void AbstractPolyList::plane |
( |
U32 |
v1, |
|
|
U32 |
v2, |
|
|
U32 |
v3 |
|
) |
[pure virtual] |
|
| virtual void AbstractPolyList::plane |
( |
const PlaneF & |
p |
) |
[pure virtual] |
|
| virtual void AbstractPolyList::plane |
( |
const U32 |
index |
) |
[pure virtual] |
|
| virtual void AbstractPolyList::vertex |
( |
U32 |
vi |
) |
[pure virtual] |
|
| virtual void AbstractPolyList::end |
( |
|
) |
[pure virtual] |
|
| virtual bool AbstractPolyList::getMapping |
( |
MatrixF * |
, |
|
|
Box3F * |
|
|
) |
[virtual] |
|
|
|
Return list transform and bounds in list space.
- Returns:
- False if no data is available.
Reimplemented in DepthSortList. |
| void AbstractPolyList::setInterestNormal |
( |
const Point3F & |
normal |
) |
|
|
| void AbstractPolyList::clearInterestNormal |
( |
|
) |
[inline] |
|
| virtual bool AbstractPolyList::isInterestedInPlane |
( |
const PlaneF & |
plane |
) |
[virtual] |
|
| virtual bool AbstractPolyList::isInterestedInPlane |
( |
const U32 |
index |
) |
[virtual] |
|
| virtual const PlaneF& AbstractPolyList::getIndexedPlane |
( |
const U32 |
index |
) |
[protected, pure virtual] |
|
Field Documentation
|