TSMesh
Classes:
Aligned Vertex Data
Vertex data
Convex Hull Data
Convex hulls are convex (no angles >= 180º) meshes used for collision
Assembly Variables
variables used during assembly (for skipping mesh detail levels on load and for sharing verts between meshes)
Render Methods
render(TSVertexBufferHandle & vb, GFXPrimitiveBufferHandle & pb)
This is used by sgShadowProjector to render the mesh directly, skipping the render manager.
innerRender(TSVertexBufferHandle & vb, GFXPrimitiveBufferHandle & pb)
render(TSMaterialList * , const TSRenderState & data, bool isSkinDirty, const Vector< MatrixF > & transforms, TSVertexBufferHandle & vertexBuffer, GFXPrimitiveBufferHandle & primitiveBuffer)
innerRender(TSMaterialList * , const TSRenderState & data, TSVertexBufferHandle & vb, GFXPrimitiveBufferHandle & pb)
Collision Methods
bool
buildPolyList(S32 frame, AbstractPolyList * polyList, U32 & surfaceKey, TSMaterialList * materials)
bool
getFeatures(S32 frame, const MatrixF & , const VectorF & , ConvexFeature * , U32 & surfaceKey)
bool
bool
castRayRendered(S32 frame, const Point3F & start, const Point3F & end, RayInfo * rayInfo, TSMaterialList * materials)
bool
returns false if not convex (still builds planes)
Bounding Methods
calculate and get bounding information
Public Types
_Anonymous_ { StandardMeshType = 0 SkinMeshType = 1 DecalMeshType = 2 SortedMeshType = 3 NullMeshType = 4 TypeMask = StandardMeshType|SkinMeshType|DecalMeshType|SortedMeshType|NullMeshType Billboard = BIT(31) HasDetailTexture = BIT(30) BillboardZAxis = BIT(29) UseEncodedNormals = BIT(28) FlagMask = Billboard|BillboardZAxis|HasDetailTexture|UseEncodedNormals }
Public Friends
class
Protected Attributes
Public Attributes
billboard data
Opcode::MeshInterface *
IceMaths::Point *
IceMaths::IndexedTriangle *
Opcode::Model *
index into shapes mesh list
Public Static Attributes
Enables mesh instancing on non-skin meshes that have less that this count of verts.
bool
bool
bool
on load...optionally convert primitives to other form
Protected Functions
_convertToAlignedMeshData(TSMeshVertexArray & vertexData, const Vector< Point3F > & _verts, const Vector< Point3F > & _norms)
_createVBIB(TSVertexBufferHandle & vb, GFXPrimitiveBufferHandle & pb)
Public Functions
TSMesh()
~TSMesh()
bool
buildPolyListOpcode(const S32 od, AbstractPolyList * polyList, const Box3F & nodeBox, TSMaterialList * materials)
bool
castRayOpcode(const Point3F & start, const Point3F & end, RayInfo * rayInfo, TSMaterialList * materials)
clearFlags(U32 flag)
convertToSingleStrip(const TSDrawPrimitive * primitivesIn, const S32 * indicesIn, S32 numPrimIn, S32 & numPrimOut, S32 & numIndicesOut, TSDrawPrimitive * primitivesOut, S32 * indicesOut)
convertToTris(const TSDrawPrimitive * primitivesIn, const S32 * indicesIn, S32 numPrimIn, S32 & numPrimOut, S32 & numIndicesOut, TSDrawPrimitive * primitivesOut, S32 * indicesOut)
convert primitives on load...
getNormals(S32 firstVert)
S32 *
getSharedData32(S32 parentMesh, S32 size, S32 ** source, bool skip)
methods used during assembly to share vertexand other info between meshes (and for skipping detail levels on load)
S8 *
getSharedData8(S32 parentMesh, S32 size, S8 ** source, bool skip)
leaveAsMultipleStrips(const TSDrawPrimitive * primitivesIn, const S32 * indicesIn, S32 numPrimIn, S32 & numPrimOut, S32 & numIndicesOut, TSDrawPrimitive * primitivesOut, S32 * indicesOut)
Public Static Functions
TSMesh *
assembleMesh(U32 meshType, bool skip)
Detailed Description
Aligned Vertex Data
convertToAlignedMeshData()
Reimplemented by: TSSkinMesh
bool mHasColor
bool mHasTVert2
TSMeshVertexArray mVertexData
dsize_t mNumVerts
Vertex data
FreeableVector< Point3F > verts
FreeableVector< Point3F > norms
FreeableVector< Point2F > tverts
FreeableVector< Point4F > tangents
FreeableVector< Point2F > tverts2
FreeableVector< ColorI > colors
Convex Hull Data
Convex hulls are convex (no angles >= 180º) meshes used for collision
Vector< Point3F > planeNormals
Vector< F32 > planeConstants
Vector< U32 > planeMaterials
S32 planesPerFrame
U32 mergeBufferStart
Assembly Variables
variables used during assembly (for skipping mesh detail levels on load and for sharing verts between meshes)
Vector< Point3F * > smVertsList
Vector< Point3F * > smNormsList
Vector< U8 * > smEncodedNormsList
Vector< Point2F * > smTVertsList
Vector< Point2F * > smTVerts2List
Vector< ColorI * > smColorsList
Vector< bool > smDataCopied
const Point3F smU8ToNormalTable []
Render Methods
render(TSVertexBufferHandle & vb, GFXPrimitiveBufferHandle & pb)
This is used by sgShadowProjector to render the mesh directly, skipping the render manager.
Reimplemented by: TSSkinMesh
innerRender(TSVertexBufferHandle & vb, GFXPrimitiveBufferHandle & pb)
render(TSMaterialList * , const TSRenderState & data, bool isSkinDirty, const Vector< MatrixF > & transforms, TSVertexBufferHandle & vertexBuffer, GFXPrimitiveBufferHandle & primitiveBuffer)
Reimplemented by: TSSkinMesh
innerRender(TSMaterialList * , const TSRenderState & data, TSVertexBufferHandle & vb, GFXPrimitiveBufferHandle & pb)
Material Methods
setFade(F32 fade)
clearFade()
Collision Methods
buildPolyList(S32 frame, AbstractPolyList * polyList, U32 & surfaceKey, TSMaterialList * materials)
Reimplemented by: TSSkinMesh, TSSortedMesh
getFeatures(S32 frame, const MatrixF & , const VectorF & , ConvexFeature * , U32 & surfaceKey)
support(S32 frame, const Point3F & v, F32 * currMaxDP, Point3F * currSupport)
castRay(S32 frame, const Point3F & start, const Point3F & end, RayInfo * rayInfo, TSMaterialList * materials)
Reimplemented by: TSSkinMesh, TSSortedMesh
castRayRendered(S32 frame, const Point3F & start, const Point3F & end, RayInfo * rayInfo, TSMaterialList * materials)
buildConvexHull()
returns false if not convex (still builds planes)
Reimplemented by: TSSkinMesh, TSSortedMesh
addToHull(U32 idx0, U32 idx1, U32 idx2)
Bounding Methods
calculate and get bounding information
computeBounds()
computeBounds(const MatrixF & transform, Box3F & bounds, S32 frame, Point3F * center, F32 * radius)
Reimplemented by: TSSkinMesh
computeBounds(const Point3F * , S32 numVerts, S32 stride, const MatrixF & transform, Box3F & bounds, Point3F * center, F32 * radius)
getBounds()
getCenter()
getRadius()
getNumPolys()
encodeNormal(const Point3F & normal)
decodeNormal(U8 ncode)
Public Types
@152
Enumerator
- StandardMeshType = 0
types...
- SkinMeshType = 1
- DecalMeshType = 2
- SortedMeshType = 3
- NullMeshType = 4
- TypeMask = StandardMeshType|SkinMeshType|DecalMeshType|SortedMeshType|NullMeshType
- Billboard = BIT(31)
flags (stored with meshType)...
- HasDetailTexture = BIT(30)
- BillboardZAxis = BIT(29)
- UseEncodedNormals = BIT(28)
- FlagMask = Billboard|BillboardZAxis|HasDetailTexture|UseEncodedNormals
Public Friends
Protected Attributes
Box3F mBounds
Point3F mCenter
bool mDynamic
U32 meshType
GFXPrimitiveBufferHandle mPB
F32 mRadius
TSVertexBufferHandle mVB
const GFXVertexFormat * mVertexFormat
U32 mVertSize
F32 mVisibility
Public Attributes
Point3F billboardAxis
billboard data
Vector< U8 > encodedNorms
Vector< U32 > indices
Opcode::MeshInterface * mOpMeshInterface
IceMaths::Point * mOpPoints
IceMaths::IndexedTriangle * mOpTris
Opcode::Model * mOptTree
S32 numFrames
S32 numMatFrames
S32 parentMesh
index into shapes mesh list
Vector< TSDrawPrimitive > primitives
S32 vertsPerFrame
Public Static Attributes
S32 smMaxInstancingVerts
Enables mesh instancing on non-skin meshes that have less that this count of verts.
S32 smMinStripSize
bool smUseEncodedNormals
bool smUseOneStrip
bool smUseTriangles
on load...optionally convert primitives to other form
const F32 VISIBILITY_EPSILON
Protected Functions
_convertToAlignedMeshData(TSMeshVertexArray & vertexData, const Vector< Point3F > & _verts, const Vector< Point3F > & _norms)
_createVBIB(TSVertexBufferHandle & vb, GFXPrimitiveBufferHandle & pb)
Public Functions
TSMesh()
~TSMesh()
assemble(bool skip)
persist methods...
Reimplemented by: TSSkinMesh, TSSortedMesh
buildConvexOpcode(const MatrixF & mat, const Box3F & bounds, Convex * c, Convex * list)
buildPolyListOpcode(const S32 od, AbstractPolyList * polyList, const Box3F & nodeBox, TSMaterialList * materials)
castRayOpcode(const Point3F & start, const Point3F & end, RayInfo * rayInfo, TSMaterialList * materials)
clearFlags(U32 flag)
convertToSingleStrip(const TSDrawPrimitive * primitivesIn, const S32 * indicesIn, S32 numPrimIn, S32 & numPrimOut, S32 & numIndicesOut, TSDrawPrimitive * primitivesOut, S32 * indicesOut)
convertToTris(const TSDrawPrimitive * primitivesIn, const S32 * indicesIn, S32 numPrimIn, S32 & numPrimOut, S32 & numIndicesOut, TSDrawPrimitive * primitivesOut, S32 * indicesOut)
convert primitives on load...
createTangents(const Vector< Point3F > & _verts, const Vector< Point3F > & _norms)
createVBIB()
disassemble()
Reimplemented by: TSSkinMesh, TSSortedMesh
findTangent(U32 index1, U32 index2, U32 index3, Point3F * tan0, Point3F * tan1, const Vector< Point3F > & _verts)
getFlags(U32 flag)
getMeshType()
getNormals(S32 firstVert)
getSharedData32(S32 parentMesh, S32 size, S32 ** source, bool skip)
methods used during assembly to share vertexand other info between meshes (and for skipping detail levels on load)
getSharedData8(S32 parentMesh, S32 size, S8 ** source, bool skip)
leaveAsMultipleStrips(const TSDrawPrimitive * primitivesIn, const S32 * indicesIn, S32 numPrimIn, S32 & numPrimOut, S32 & numIndicesOut, TSDrawPrimitive * primitivesOut, S32 * indicesOut)
prepOpcodeCollision()
setFlags(U32 flag)
