| 543 | } |
| 544 | |
| 545 | void Tr2InstancedMesh::RenderDebugInfo( const Matrix& worldTransform, ITr2DebugRenderer2& renderer, const Matrix* boneTransforms, const int32_t* meshBindingIndices, size_t boneCount, const Tr2MorphTargetAnimationData* morphTargets, size_t morphTargetsCount ) |
| 546 | { |
| 547 | if( renderer.HasOption( this, "Instance Mesh Bounds" ) ) |
| 548 | { |
| 549 | if( m_boundsMethod == STATIC ) |
| 550 | { |
| 551 | renderer.DrawBox( this, worldTransform, m_minBounds, m_maxBounds, Tr2DebugRenderer::Wireframe, Tr2DebugColor( 0xffaa8800, 0x22aa8800 ) ); |
| 552 | } |
| 553 | else |
| 554 | { |
| 555 | auto parentBounds = GetBounds(); |
| 556 | if( parentBounds ) |
| 557 | { |
| 558 | if( m_instanceGeometryResource ) |
| 559 | { |
| 560 | auto sphere = GetInstanceBoundsClosestToPoint( TransformCoord( Tr2Renderer::GetViewPosition(), Inverse( worldTransform ) ) ); |
| 561 | if( sphere && !parentBounds.IsPointInside( Tr2Renderer::GetViewPosition() ) ) |
| 562 | { |
| 563 | auto aabb = CcpMath::AxisAlignedBox( sphere ); |
| 564 | renderer.DrawBox( this, worldTransform, aabb.m_min, aabb.m_max, Tr2DebugRenderer::Wireframe, Tr2DebugColor( 0xff008888, 0x22008888 ) ); |
| 565 | } |
| 566 | } |
| 567 | renderer.DrawBox( this, worldTransform, parentBounds.m_min, parentBounds.m_max, Tr2DebugRenderer::Wireframe, Tr2DebugColor( 0xff888888, 0x22888888 ) ); |
| 568 | } |
| 569 | } |
| 570 | } |
| 571 | } |
| 572 | |
| 573 | void Tr2InstancedMesh::SetDynamicBounds( float maxInstanceSize ) |
| 574 | { |
nothing calls this directly
no test coverage detected