Original Post
Hi everyone. I'm having a problem with the aformentioned function giving me strange results. I have a function: (by the way, i got the d3d::BoundingBox type from Frank Luna's 'Introduction to 3D Game Programming with DirectX 9.0'. Some of you may be familiar.) The function works perfectly except for the y value of the bounding box's min and max vectors. the X and Z values are fine, but the Y value is way off. So much so that my collision detections don't work because of it. :( Can anyone tell whats going wrong? Heres a picture of my debug session to confirm that the Y value is insane.
[Edited by - Multiverse on September 20, 2005 8:59:21 AM]
bool Powerup::GetBoundingVolume(d3d::BoundingBox* box)
{
d3d::BoundingBox tempbox;
D3DXMATRIX mat;
D3DXMatrixTranslation(&mat, m_Position.x,// create matrix for
m_Position.y,// this blocks
m_Position.z);// position
D3DXVec3TransformCoord( &tempbox.min, &m_BBox.min, &mat);
D3DXVec3TransformCoord( &tempbox.max, &m_BBox.max, &mat);
*box = tempbox;
return true;
}
[Edited by - Multiverse on September 20, 2005 8:59:21 AM]