Class TShapeTreeLOD

Unit

Declaration

type TShapeTreeLOD = class(TShapeTreeGroup)

Description

Node of the TShapeTree representing the LOD (level of detail) alternative. It chooses one child from it's children list as active. Represents the VRML >= 2.0 LOD node (not possible for VRML 1.0 LOD node, as it may affect also other nodes after LOD).

To choose which child is active we need to know the LOD node, with it's transformation in VRML graph. This information is in LODNode and LODInverseTransform properties.

Also, we need to know the current camera position. This is passed as CameraPosition to CalculateLevel. Note that this class doesn't call CalculateLevel by itself, never. You have to call CalculateLevel, and use it to set Level property, from parent scene to make this LOD work. (Reasoning behind this decision: parent scene has CameraPosition and such, and parent scene knows whether to initiate level_changes event sending.)

Hierarchy

Overview

Methods

Public function LODInverseTransform: PMatrix4;
Public function CalculateLevel(const CameraPosition: TVector3): Cardinal;

Properties

Public property LODNode: TLODNode read FLODNode write FLODNode;
Public property Level: Cardinal read FLevel write FLevel default 0;
Public property WasLevel_ChangedSend: boolean read FWasLevel_ChangedSend write FWasLevel_ChangedSend default false;

Description

Methods

Public function LODInverseTransform: PMatrix4;

This item has no description.

Public function CalculateLevel(const CameraPosition: TVector3): Cardinal;

Calculate Level. This only calculates level, doesn't assign Level property or send level_changed event.

Properties

Public property LODNode: TLODNode read FLODNode write FLODNode;

This item has no description.

Public property Level: Cardinal read FLevel write FLevel default 0;

Current level, that is index of the active child of this LOD node. This is always < Children.Count, unless there are no children. In this case it's 0.

Should be calculated by CalculateLevel. By default we simply use the first (highest-detail) LOD as active. So if you never assign this (e.g. because TCastleSceneCore.CameraViewKnown = False, that is user position is never known) we'll always use the highest-detail children.

Public property WasLevel_ChangedSend: boolean read FWasLevel_ChangedSend write FWasLevel_ChangedSend default false;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.