Class TCastleControl

Unit

Declaration

type TCastleControl = class(TCastleControlCustom)

Description

Control to render everything (3D or 2D) with Castle Game Engine, with a default TCastleSceneManager instance already created for you. This is the simplest way to render a 3D world with 2D controls above. Add your game stuff (descending from TCastleTransform, like TCastleScene) to the scene manager available in SceneManager property. Add the rest (like 2D user-inteface) to the TCastleControlCustom.Controls property (from ancestor TCastleControlCustom).

You can directly access the SceneManager and configure it however you like.

You have comfortable Load method that simply loads a single model to your world.

Note that if you don't plan to use the default SceneManager instance, then you should better create TCastleControlCustom instead of this class.

Hierarchy

Overview

Methods

Public constructor Create(AOwner: TComponent); override;
Public procedure Load(const SceneURL: string);
Public procedure Load(ARootNode: TX3DRootNode; const OwnsRootNode: boolean);
Public function MainScene: TCastleScene;
Public function Camera: TCamera;

Properties

Published property SceneManager: TControlGameSceneManager read FSceneManager;
Published property OnCameraChanged: TNotifyEvent read GetOnCameraChanged write SetOnCameraChanged;
Published property ShadowVolumes: boolean read GetShadowVolumes write SetShadowVolumes default TCastleAbstractViewport.DefaultShadowVolumes;
Published property ShadowVolumesRender: boolean read GetShadowVolumesRender write SetShadowVolumesRender default false;

Description

Methods

Public constructor Create(AOwner: TComponent); override;
 
Public procedure Load(const SceneURL: string);

Load a single 3D model to your world (removing other models, and resetting the camera).

This is nice for simple 3D model browsers, but usually for games you don't want to use this method — it's more flexible to create TCastleScene yourself, and add it to scene manager yourself, see engine examples like scene_manager_basic.lpr.

Public procedure Load(ARootNode: TX3DRootNode; const OwnsRootNode: boolean);
 
Public function MainScene: TCastleScene;
 
Public function Camera: TCamera;
 

Properties

Published property SceneManager: TControlGameSceneManager read FSceneManager;
 
Published property OnCameraChanged: TNotifyEvent read GetOnCameraChanged write SetOnCameraChanged;
 
Published property ShadowVolumes: boolean read GetShadowVolumes write SetShadowVolumes default TCastleAbstractViewport.DefaultShadowVolumes;

See TCastleAbstractViewport.ShadowVolumes.

Published property ShadowVolumesRender: boolean read GetShadowVolumesRender write SetShadowVolumesRender default false;

See TCastleAbstractViewport.ShadowVolumesRender.


Generated by PasDoc 0.15.0.