Class TCastleTransformReference

Unit

Declaration

type TCastleTransformReference = class(TCastleTransform)

Description

Reference another TCastleTransform instance, to render one TCastleTransform multiple times within the same viewport.

Hierarchy

Overview

Methods

Protected procedure LocalRender(const Params: TRenderParams); override;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public function PropertySections(const PropertyName: String): TPropertySections; override;

Properties

Published property Reference: TCastleTransform read FReference write SetReference;
Published property RevertReference: TCastleTransform read FRevertReference write SetRevertReference;
Published property ReferenceTransformation: TReferenceTransformation read FReferenceTransformation write FReferenceTransformation default rtIgnoreTransform;

Description

Methods

Protected procedure LocalRender(const Params: TRenderParams); override;

This item has no description. Showing description inherited from TCastleTransform.LocalRender.

Collect the things to be rendered now.

Override this method if you need to perform custom rendering, by direct OpenGL(ES) calls. Never call this method yourself – the rendering of TCastleViewport will call it when needed.

Warning: It is an advanced topic how to make such rendering work, and make it work in a cross-platform way. You will need to understand how OpenGL(ES) works, and you will need to account for how the engine renders things too, to not conflict with the engine – e.g. you will have to use RenderContext for some things. If you're not ready for this, then you're better off not overriding this method, instead just rely on the engine built-in rendering, done by TCastleScene and other components.

This method gets parameters (Params) including a full transformation of this scene.

In return, it should add the things to be rendered in this frame using Params.AddRenderEvent.

Internally: TCastleScene also adds X3D shapes to be rendered to TRenderParams.Collector. But you should not need to deal with TRenderParams.Collector in your own code.

TODO: The names LocalRender, TRenderParams are now confusing. LocalRender is not a method where one should "render" anymore. It's a "collection phase". Think of it as "TCastleTranssform.CollectThingsToRender(const Params: ...)" and bear with us as we figure out a non-confusing naming around this.

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public function PropertySections(const PropertyName: String): TPropertySections; override;

This item has no description. Showing description inherited from TCastleComponent.PropertySections.

Section where to show property in the editor.

Properties

Published property Reference: TCastleTransform read FReference write SetReference;

Reference another TCastleTransform instance, rendering and processing it as our child. This makes the referenced instance being visible multiple times within the same viewport.

The referenced instance doesn't have to be present itself in any viewport. But if it is present in some viewport, it has to be the same viewport as our own. In other words, you cannot use the same TCastleTransform instance in 2 different viewports.

To be more precise, you actually cannot use the same TCastleTransform instance in 2 different TCastleAbstractRootTransform instances (see TCastleTransform.World). When 2 viewports share the same Items then (and only then) the same TCastleTransform instance are present in multiple viewports. See https://castle-engine.io/multiple_viewports_to_display_one_world .

Published property RevertReference: TCastleTransform read FRevertReference write SetRevertReference;

Not displayed, used only for the "Revert To Referenced Transform" feature in the editor.

Published property ReferenceTransformation: TReferenceTransformation read FReferenceTransformation write FReferenceTransformation default rtIgnoreTransform;

How do we treat the transformation of TCastleTransformReference.Reference when rendering TCastleTransformReference.

See also
TReferenceTransformation
How do we treat the transformation of TCastleTransformReference.Reference when rendering TCastleTransformReference.

Generated by PasDoc 0.16.0-snapshot.