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