Fix audio listener positionning code crash
This commit is contained in:
parent
c806c1de49
commit
8ca0fea6fa
@ -524,6 +524,19 @@ void Camera::getCameraSettings(float *above_kart, float *cam_angle,
|
||||
*/
|
||||
void Camera::update(float dt)
|
||||
{
|
||||
if (m_kart == NULL)
|
||||
{
|
||||
if (race_manager->getNumLocalPlayers() < 2)
|
||||
{
|
||||
Vec3 pos(m_camera->getPosition());
|
||||
SFXManager::get()->positionListener(pos,
|
||||
Vec3(m_camera->getTarget()) - pos,
|
||||
Vec3(0, 1, 0));
|
||||
}
|
||||
|
||||
return; // cameras not attached to kart must be positioned manually
|
||||
}
|
||||
|
||||
if (race_manager->getNumLocalPlayers() < 2)
|
||||
{
|
||||
Vec3 heading(sin(m_kart->getHeading()), 0.0f, cos(m_kart->getHeading()));
|
||||
@ -532,8 +545,6 @@ void Camera::update(float dt)
|
||||
Vec3(0, 1, 0));
|
||||
}
|
||||
|
||||
if (m_kart == NULL) return; // cameras not attached to kart must be positioned manually
|
||||
|
||||
float above_kart, cam_angle, side_way, distance;
|
||||
bool smoothing;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user