void BatchRenderer::DrawAABB( const rxAABB& box, const FColor& color ) { XMMATRIX matWorld = XMMatrixScaling( box.Extents.x, box.Extents.y, box.Extents.z ); XMVECTOR position = XMLoadFloat3( &box.Center ); matWorld.r[3] = XMVectorSelect( matWorld.r[3], position, XMVectorSelectControl( 1, 1, 1, 0 ) ); DrawCube( matWorld, color ); }
VOID DebugDraw::DrawAabb( const AxisAlignedBox& box, D3DCOLOR Color ) { XMMATRIX matWorld = XMMatrixScaling( box.Extents.x, box.Extents.y, box.Extents.z ); XMVECTOR position = XMLoadFloat3( &box.Center ); matWorld.r[3] = XMVectorSelect( matWorld.r[3], position, XMVectorSelectControl( 1, 1, 1, 0 ) ); DrawCubeWireframe( matWorld, Color ); }
void BatchRenderer::DrawOBB( const rxOOBB& box, const FColor& color ) { XMMATRIX matWorld = XMMatrixRotationQuaternion( XMLoadFloat4( &box.Orientation ) ); XMMATRIX matScale = XMMatrixScaling( box.Extents.x, box.Extents.y, box.Extents.z ); matWorld = XMMatrixMultiply( matScale, matWorld ); XMVECTOR position = XMLoadFloat3( &box.Center ); matWorld.r[3] = XMVectorSelect( matWorld.r[3], position, XMVectorSelectControl( 1, 1, 1, 0 ) ); DrawCube( matWorld, color ); }
VOID DebugDraw::DrawObb( const OrientedBox& obb, D3DCOLOR Color ) { XMMATRIX matWorld = XMMatrixRotationQuaternion( XMLoadFloat4( &obb.Orientation ) ); XMMATRIX matScale = XMMatrixScaling( obb.Extents.x, obb.Extents.y, obb.Extents.z ); matWorld = XMMatrixMultiply( matScale, matWorld ); XMVECTOR position = XMLoadFloat3( &obb.Center ); matWorld.r[3] = XMVectorSelect( matWorld.r[3], position, XMVectorSelectControl( 1, 1, 1, 0 ) ); DrawCubeWireframe( matWorld, Color ); }