Skip to content

Commit

Permalink
Prevent assertion on invalid opacities.
Browse files Browse the repository at this point in the history
Instead, just clamp the value
  • Loading branch information
sethhillbrand committed Aug 21, 2024
1 parent d9cf5e8 commit 8516cf6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions 3d-viewer/3d_rendering/raytracing/create_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1424,13 +1424,12 @@ void RENDER_3D_RAYTRACE_BASE::addModels( CONTAINER_3D& aDstContainer, const S3DM
wxASSERT( a3DModel->m_Meshes != nullptr );
wxASSERT( a3DModel->m_MaterialsSize > 0 );
wxASSERT( a3DModel->m_MeshesSize > 0 );
wxASSERT( aFPOpacity > 0.0f );
wxASSERT( aFPOpacity <= 1.0f );

if( aFPOpacity > 1.0f )
{
aFPOpacity = 1.0f;
}

if( aFPOpacity < 0.0f )
aFPOpacity = 0.0f;

if( ( a3DModel->m_Materials != nullptr ) && ( a3DModel->m_Meshes != nullptr )
&& ( a3DModel->m_MaterialsSize > 0 ) && ( a3DModel->m_MeshesSize > 0 ) )
Expand Down

0 comments on commit 8516cf6

Please sign in to comment.