Torque3D Documentation / _generateds / ClippedPolyList

ClippedPolyList

Engine/source/collision/clippedPolyList.h

The clipped polylist class takes the geometry passed to it and clips it against the PlaneList set.

More...

Classes:

Public Types

IndexList 
IndexListIterator 
PlaneList 
PlaneListIterator 
PolyList 
PolyListIterator 
VertexList 
VertexListIterator 

Public Static Attributes

Public Attributes

If non-zero any poly facing away from this normal is removed from the list.

The per-vertex normals.

If the dot product result between a poly's normal and mNormal is greater than this value it will be rejected.

The list of planes to clip against.

Private Functions

memcpy(U32 * d, U32 * s, U32 size)

Public Functions

Adds a plane to the poly list, and returns an ID number for that point.

Adds a point to the poly list, and returns an ID number for that point.

Adds a point and normal to the poly list, and returns an ID number for them.

begin(BaseMatInstance * material, U32 surfaceKey)

Start a surface.

Often after clipping you'll end up with orphan verticies that are unused by the poly list.

end()

Mark the end of a surface.

Generates averaged normals from the poly normals.

bool

Are we empty of data?

Indicate the plane of the surface.

plane(const U32 index)

Indicate the plane of the surface.

plane(U32 v1, U32 v2, U32 v3)

Indicate the plane of the surface.

This breaks all polys in the polylist into triangles.

vertex(U32 vi)

Reference a vertex which is in this surface.

Protected Functions

A helper function to convert a plane index to a PlaneF structure.

Detailed Description

The clipped polylist class takes the geometry passed to it and clips it against the PlaneList set.

It also contains helper functions for

Public Types

typedef FastVector< U32 > IndexList 
typedef IndexList::iterator IndexListIterator 
typedef Vector< PlaneF > PlaneList 
typedef PlaneList::iterator PlaneListIterator 
typedef Vector< Poly > PolyList 
typedef PolyList::iterator PolyListIterator 
typedef Vector< Vertex > VertexList 
typedef VertexList::iterator VertexListIterator 

Public Static Attributes

bool allowClipping 

???

const U32 IndexListReserveSize 

Public Attributes

IndexList mIndexList 
VectorF mNormal 

If non-zero any poly facing away from this normal is removed from the list.

This should be set before filling the polylist.

Vector< VectorF > mNormalList 

The per-vertex normals.

F32 mNormalTolCosineRadians 

If the dot product result between a poly's normal and mNormal is greater than this value it will be rejected.

The default value is 0.
90 degrees = mCos( mDegToRad( 90.0f ) = 0

PlaneList mPlaneList 

The list of planes to clip against.

This should be set before filling the polylist.

PolyList mPolyList 
PlaneList mPolyPlaneList 
IndexList mTempIndexList 
PolyList mTempPolyList 
VertexList mVertexList 

Private Functions

memcpy(U32 * d, U32 * s, U32 size)

Public Functions

ClippedPolyList()

~ClippedPolyList()

addPlane(const PlaneF & plane)

Reimplemented from: AbstractPolyList

addPoint(const Point3F & p)

Reimplemented from: AbstractPolyList

addPointAndNormal(const Point3F & p, const Point3F & normal)

Reimplemented from: AbstractPolyList

begin(BaseMatInstance * material, U32 surfaceKey)

Reimplemented from: AbstractPolyList

clear()

cullUnusedVerts()

Often after clipping you'll end up with orphan verticies that are unused by the poly list.

This removes these unused verts and updates the index list.

end()

Reimplemented from: AbstractPolyList

Reimplemented by: DepthSortList

generateNormals()

Generates averaged normals from the poly normals.

isEmpty()

Reimplemented from: AbstractPolyList

plane(const PlaneF & p)

Reimplemented from: AbstractPolyList

plane(const U32 index)

Reimplemented from: AbstractPolyList

plane(U32 v1, U32 v2, U32 v3)

Reimplemented from: AbstractPolyList

triangulate()

This breaks all polys in the polylist into triangles.

vertex(U32 vi)

Reimplemented from: AbstractPolyList

Protected Functions

getIndexedPlane(const U32 index)

Reimplemented from: AbstractPolyList