Don't process an invalid window position
This is used for computing a vector index, so it can't be negative.
This commit is contained in:
parent
a5ed5e5675
commit
38584e55dd
|
@ -383,10 +383,11 @@ void CCAMERA::MakeRayAtCurrrentMousePosition( SFVEC3F &aOutOrigin,
|
||||||
const SFVEC2I windowPos = SFVEC2I( m_lastPosition.x,
|
const SFVEC2I windowPos = SFVEC2I( m_lastPosition.x,
|
||||||
m_windowSize.y - m_lastPosition.y );
|
m_windowSize.y - m_lastPosition.y );
|
||||||
|
|
||||||
if( ( windowPos.x < m_windowSize.x ) &&
|
if( ( 0 < windowPos.x ) && ( windowPos.x < m_windowSize.x ) &&
|
||||||
( windowPos.y < m_windowSize.y ) )
|
( 0 < windowPos.y ) && ( windowPos.y < m_windowSize.y ) )
|
||||||
MakeRay( windowPos,
|
{
|
||||||
aOutOrigin, aOutDirection );
|
MakeRay( windowPos, aOutOrigin, aOutDirection );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue