Class TCastleRootTransform

Unit

Declaration

type TCastleRootTransform = class(TCastleAbstractRootTransform)

Description

Root of transformations and scenes (tree of TCastleTransform and TCastleScene).

Hierarchy

Overview

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function InternalHeadlight: TAbstractLightNode;

Properties

Public property HeadlightNode: TAbstractLightNode read GetHeadlightNode write SetHeadlightNode;
Published property MainScene: TCastleScene read FMainScene write SetMainScene;
Published property UseHeadlight: TUseHeadlight read FUseHeadlight write FUseHeadlight default hlMainScene;

Description

Methods

Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public function InternalHeadlight: TAbstractLightNode;

Headlight used to light the scene.

Returns non-nil headlight node if the algorithm described at TCastleViewport.UseHeadlight and TUseHeadlight indicates we should use a headlight. Otherwise returns Nil, to indicate we do not show a headlight now.

Properties

Public property HeadlightNode: TAbstractLightNode read GetHeadlightNode write SetHeadlightNode;

Determines the headlight look, if we use a headlight (which is determined by the algorithm described at UseHeadlight and TUseHeadlight). By default it's a simplest directional headlight, but you can customize it, and thus you can use a point light or a spot light for a headlight. Just like https://castle-engine.io/x3d_implementation_navigation_extensions.php#section_ext_headlight .

This is never Nil. Assigning here Nil simply causes us to recreate it using the simplest directional headlight.

Published property MainScene: TCastleScene read FMainScene write SetMainScene;

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.

The scene you set here must also be added to our Items.

The MainScene is used for a couple of things:

  • Determines initial Camera (if AutoCamera) and Navigation (if 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 Camera and Navigation. For example in X3D you can animate the Viewpoint position, and it will actually animate our Camera position.

    If both AutoCamera and AutoNavigation are False, none of these things are applied.

  • Determines what background is rendered. If the MainScene contains an X3D Background node (or other node descending from TAbstractBackgroundNode), it will be used.

    Otherwise we render a background using BackgroundColor.

    Note that when Transparent is True, we never render any background (neither from MainScene, nor from BackgroundColor).

  • 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.

  • Determines the main light casting shadow volumes.

  • Determines lights shining on all scenes, if UseGlobalLights.

  • Determines fog on all scenes, if UseGlobalFog.

Freeing MainScene will automatically set this property to Nil.

Published property UseHeadlight: TUseHeadlight read FUseHeadlight write FUseHeadlight default hlMainScene;

Whether the headlight is shown, see TUseHeadlight for possible values.


Generated by PasDoc 0.15.0.