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
- TObject
- TShapeTree
- TShapeTreeGroup
- TShapeTreeLOD
Overview
Methods
function LODInverseTransform: PMatrix4; |
|
function CalculateLevel(const CameraPosition: TVector3): Cardinal; |
|
function DebugInfoWithoutChildren: String; override; |
Properties
property LODNode: TLODNode read FLODNode write FLODNode; |
|
property Level: Cardinal read FLevel write FLevel default 0; |
|
property WasLevel_ChangedSend: boolean
read FWasLevel_ChangedSend write FWasLevel_ChangedSend default false; |
Description
Methods
function LODInverseTransform: PMatrix4; |
|
This item has no description. |
function CalculateLevel(const CameraPosition: TVector3): Cardinal; |
|
Calculate Level. This only calculates level, doesn't assign Level property or send level_changed event. |
function DebugInfoWithoutChildren: String; override; |
|
This item has no description. Showing description inherited from TShapeTree.DebugInfoWithoutChildren. Describe this shape, not recursively. |
Properties
property LODNode: TLODNode read FLODNode write FLODNode; |
|
This item has no description. |
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 = |
property WasLevel_ChangedSend: boolean
read FWasLevel_ChangedSend write FWasLevel_ChangedSend default false; |
|
This item has no description. |
Generated by PasDoc 0.16.0-snapshot.