문제

I've just started graphics programming in Ogre, and just can't understand why there is a separate viewing frustum class and a separate camera class.
In the real world, every camera has its own viewing frustum. Shouldn't the properties of the viewing frustum be present in the camera class?

Is there any advantage in having them separate? I just don't see the point.

도움이 되었습니까?

해결책

It's called separation of concerns. Basically a class should do one thing and one thing only.

다른 팁

Isn't it that the Camera inherits FROM Frustum and not the opposite? Frustum is just a pyramid located in space and can be used for many things, like Spotlights, shadows computation, visibility, etc.

Camera is a Frustum with additional Camera Events handling, yaw/pitch/roll methods, render mode/LOD settings, visibility checks and so on...

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top