Box GameObject::GetLocalBoundingBox(bool includeChildren) const { Box b = GetObjectBoundingBox(includeChildren); Matrix4 mat = transform->GetLocalToParentMatrix(); b = mat * b; //Apply transform to Box return b; }
Box GameObject::GetBoundingBox(bool includeChildren) const { Box b = GetObjectBoundingBox(includeChildren); Matrix4 mat; transform->GetLocalToWorldMatrix(&mat); b = mat * b; return b; }
Sphere GameObject::GetObjectBoundingSphere(bool includeChildren) const { return Sphere::FromBox(GetObjectBoundingBox(includeChildren)); }
void csMeshObject::GetRadius (float& radius, csVector3& center) { csBox3 b (GetObjectBoundingBox ()); radius = csQsqrt (csSquaredDist::PointPoint (b.Max (), b.Min ())) * 0.5f; center = b.GetCenter (); }