Fix #4770
This commit is contained in:
parent
63e1afb835
commit
ac140c9cf2
@ -305,7 +305,14 @@ void SoccerWorld::init()
|
|||||||
if (!m_ball)
|
if (!m_ball)
|
||||||
Log::fatal("SoccerWorld","Ball is missing in soccer field, abort.");
|
Log::fatal("SoccerWorld","Ball is missing in soccer field, abort.");
|
||||||
|
|
||||||
m_bgd->init(m_ball->getPhysicalObject()->getRadius());
|
float radius = m_ball->getPhysicalObject()->getRadius();
|
||||||
|
if (radius <= 0.0f)
|
||||||
|
{
|
||||||
|
btVector3 min, max;
|
||||||
|
m_ball->getPhysicalObject()->getBody()->getAabb(min, max);
|
||||||
|
radius = (max.y() - min.y()) / 2.0f;
|
||||||
|
}
|
||||||
|
m_bgd->init(radius);
|
||||||
|
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user