handle transitions to/from STATIC_MESH

when rendering collision geometry
This commit is contained in:
Andrew Meadows 2016-07-28 10:30:28 -07:00
parent 68dd66daec
commit 83426fd5a8

View file

@ -438,13 +438,11 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
remapTextures(); remapTextures();
// update whether the model should be showing collision mesh (this may flag for fixupInScene) // update whether the model should be showing collision mesh (this may flag for fixupInScene)
ShapeType type = getShapeType(); bool showingCollisionGeometry = (bool)(args->_debugFlags & (int)RenderArgs::RENDER_DEBUG_HULLS);
bool shouldShowCollisionGeometry = type != SHAPE_TYPE_STATIC_MESH && if (showingCollisionGeometry != _showCollisionGeometry) {
type != SHAPE_TYPE_NONE && ShapeType type = getShapeType();
(args->_debugFlags & (int)RenderArgs::RENDER_DEBUG_HULLS) > 0; _showCollisionGeometry = showingCollisionGeometry;
if (shouldShowCollisionGeometry != _showCollisionGeometry) { if (_showCollisionGeometry && type != SHAPE_TYPE_STATIC_MESH && type != SHAPE_TYPE_NONE) {
_showCollisionGeometry = shouldShowCollisionGeometry;
if (_showCollisionGeometry) {
// NOTE: it is OK if _collisionMeshKey is nullptr // NOTE: it is OK if _collisionMeshKey is nullptr
model::MeshPointer mesh = collisionMeshCache.getMesh(_collisionMeshKey); model::MeshPointer mesh = collisionMeshCache.getMesh(_collisionMeshKey);
// NOTE: the model will render the collisionGeometry if it has one // NOTE: the model will render the collisionGeometry if it has one