Beispiel #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;
}
Beispiel #2
0
Box GameObject::GetBoundingBox(bool includeChildren) const
{
    Box b = GetObjectBoundingBox(includeChildren);
    Matrix4 mat; transform->GetLocalToWorldMatrix(&mat);
    b = mat * b;
    return b;
}
Beispiel #3
0
Sphere GameObject::GetObjectBoundingSphere(bool includeChildren) const
{
    return Sphere::FromBox(GetObjectBoundingBox(includeChildren));
}
Beispiel #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 ();
}