Warning: this symbol is deprecated: leave MainScene unset; almost all useful MainScene features can be now achieved without setting MainScene
The main scene of the world. It's not necessary to set this. It adds some optional features that require a notion of the "main" scene to make sense.
Determines initial TCastleViewport.Camera (if TCastleViewport.AutoCamera) and TCastleViewport.Navigation (if TCastleAutoNavigationViewport.AutoNavigation) properties. This includes camera position, orientation, projection. This includes navigation type (examine, walk, fly), move speed. These follow the X3D Viewpoint, OrthoViewpoint and NavigationInfo nodes defined inside the MainScene
.
Later changes to nodes Viewpoint/NavigatioInfo using X3D events inside MainScene
may also influence the TCastleViewport.Camera and TCastleViewport.Navigation. For example in X3D you can animate the Viewpoint position, and it will actually animate our TCastleViewport.Camera position.
If both TCastleViewport.AutoCamera and TCastleAutoNavigationViewport.AutoNavigation are False
, none of these things are applied.
Instead of relying on MainScene
for this, we advise to leave TCastleViewport.AutoCamera and TCastleAutoNavigationViewport.AutoNavigation as False
, and set proper camera and navigation at design-time. If you want to animate the camera usin animation designed in glTF or X3D, then make TCastleCamera a parent of animated transformation exposed using TCastleSceneCore.ExposeTransforms.
Determines what background is rendered. If the MainScene
contains an X3D Background node (or other node descending from TAbstractBackgroundNode), it will be used.
This is overridden if you set TCastleViewport.Background to non-nil. MainScene
's background is ignored in this case.
When neither MainScene
background is present, nor TCastleViewport.Background is specified, then we render a background using TCastleViewport.BackgroundColor.
Note that when TCastleViewport.Transparent is True
, we never render any background (neither from MainScene
, nor from TCastleViewport.BackgroundColor).
Instead of relying on MainScene
for this, we advise to set TCastleViewport.Background.
Determines whether headlight is used if UseHeadlight is hlMainScene. The value of MainScene.HeadlightOn then determines the headlight. The initial MainScene.HeadlightOn value depends on the X3D NavigationInfo node inside MainScene
.
Instead of relying on MainScene
for this, we advise to add light instance (like TCastleDirectionalLight) as TCastleCamera child.
Determines the main light casting shadow volumes.
Determines lights shining on all scenes, as this scene has by default TCastleScene.CastGlobalLights when you set it as MainScene
. This can also be achieved on any other scene too, by setting TCastleScene.CastGlobalLights.
Instead of relying on MainScene
for lights, we advise to setup light instances (TCastleDirectionalLight, TCastlePointLight, TCastleSpotLight) in viewport items and/or set TCastleScene.CastGlobalLights on some scenes.
Determines fog on all scenes, if TCastleViewport.UseGlobalFog.
The screen effects defined inside MainScene
(TScreenEffectNode) are automatically used.
Instead of relying on MainScene
for this, add screen effects using TCastleScreenEffects.AddScreenEffect.
Main scene is informed about pointing device move, even when the pointing device is not over this scene, and this scene is not capturing pointing device events (the scene "capturing" events once you click on it).