| 956 | } |
| 957 | |
| 958 | bool TSStatic::buildPolyList(PolyListContext context, AbstractPolyList* polyList, const Box3F &box, const SphereF &) |
| 959 | { |
| 960 | if ( !mShapeInstance ) |
| 961 | return false; |
| 962 | |
| 963 | // This is safe to set even if we're not outputing |
| 964 | polyList->setTransform( &mObjToWorld, mObjScale ); |
| 965 | polyList->setObject( this ); |
| 966 | |
| 967 | if ( context == PLC_Export ) |
| 968 | { |
| 969 | // Use highest detail level |
| 970 | S32 dl = 0; |
| 971 | |
| 972 | // Try to call on the client so we can export materials |
| 973 | if ( isServerObject() && getClientObject() ) |
| 974 | dynamic_cast<TSStatic*>(getClientObject())->mShapeInstance->buildPolyList( polyList, dl ); |
| 975 | else |
| 976 | mShapeInstance->buildPolyList( polyList, dl ); |
| 977 | } |
| 978 | else if ( context == PLC_Selection ) |
| 979 | { |
| 980 | // Use the last rendered detail level |
| 981 | S32 dl = mShapeInstance->getCurrentDetail(); |
| 982 | mShapeInstance->buildPolyListOpcode( dl, polyList, box ); |
| 983 | } |
| 984 | else |
| 985 | { |
| 986 | // Figure out the mesh type we're looking for. |
| 987 | MeshType meshType = ( context == PLC_Decal ) ? mDecalType : mCollisionType; |
| 988 | |
| 989 | if ( meshType == None ) |
| 990 | return false; |
| 991 | else if ( meshType == Bounds ) |
| 992 | polyList->addBox( mObjBox ); |
| 993 | else if ( meshType == VisibleMesh ) |
| 994 | mShapeInstance->buildPolyList( polyList, 0 ); |
| 995 | else |
| 996 | { |
| 997 | // Everything else is done from the collision meshes |
| 998 | // which may be built from either the visual mesh or |
| 999 | // special collision geometry. |
| 1000 | for ( U32 i = 0; i < mCollisionDetails.size(); i++ ) |
| 1001 | mShapeInstance->buildPolyListOpcode( mCollisionDetails[i], polyList, box ); |
| 1002 | } |
| 1003 | } |
| 1004 | |
| 1005 | return true; |
| 1006 | } |
| 1007 | |
| 1008 | void TSStatic::buildConvex(const Box3F& box, Convex* convex) |
| 1009 | { |
nothing calls this directly
no test coverage detected