mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 04:19:19 +02:00
render code relocation, mouse wheel zoom control
This commit is contained in:
13
Camera.cpp
13
Camera.cpp
@@ -170,16 +170,3 @@ void TCamera::Stop()
|
||||
Velocity = vector3(0, 0, 0);
|
||||
};
|
||||
|
||||
// returns true if specified object is within camera frustum, false otherwise
|
||||
bool
|
||||
TCamera::IsVisible( TDynamicObject const *Dynamic ) const {
|
||||
|
||||
// sphere test is faster than AABB, so we'll use it here
|
||||
float3 diagonal(
|
||||
Dynamic->MoverParameters->Dim.L,
|
||||
Dynamic->MoverParameters->Dim.H,
|
||||
Dynamic->MoverParameters->Dim.W );
|
||||
float const radius = static_cast<float>(diagonal.Length()) * 0.5f;
|
||||
|
||||
return ( m_frustum.sphere_inside( Dynamic->GetPosition(), radius ) > 0.0f );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user