Castle Game Engine |
Class TCastleViewport
UnitDeclaration
DescriptionCustom 2D viewport showing 3D world. This uses assigned SceneManager to show 3D world on the screen. For simple games, using this is not needed, because TCastleSceneManager also acts as a viewport (when TCastleSceneManager.DefaultViewport is You can control the size of this viewport by FullSize, Left, Bottom, Width, Height properties. For custom viewports, you often want to set FullSize = Example usages: in a typical 3D modeling programs, you like to have 4 viewports with 4 different cameras (front view, side view, top view, and free perspective view). See examples/vrml/multiple_viewports.lpr in engine sources for demo of this. Or when you make a split-screen game, played by 2 people on a single monitor. Viewports may be overlapping, that is one viewport may (partially) obscure another viewport. Just like with any other TUIControl, position of viewport on the Controls list (like TCastleControlCustom.Controls or TCastleWindowCustom.Controls) is important: Controls are specified in the front-to-back order. That is, if the viewport X may obscure viewport Y, then X must be before Y on the Controls list. Example usage of overlapping viewports: imagine a space shooter, like Epic or Wing Commander. You can imagine that a camera is mounted on each rocket fired by the player. You can display in one viewport (with FullSize = Hierarchy
OverviewMethods
Properties
DescriptionMethods
Properties
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:13 |