Class TCastleSceneCore
Unit
Declaration
type TCastleSceneCore = class(TX3DEventsEngine)
Description
Loading and processing of a scene. Almost everything visible in your game will be an instance of TCastleScene, which is a descendant of this class that adds rendering capabilities.
This class provides a lot of functionality, like loading of the scene (Load method), animating it, performing collisions with the scene, and calculating things (like LocalBoundingBox).
The actual scene information (visible and collidable things) is inside X3D nodes graph contained within the RootNode. During the lifetime of the scene, this X3D graph can change (e.g. because of animations), and you can always change it by code too. E.g. you can freely change TTransformNode.Translation or add children by TAbstractGroupingNode.AddChildren. The X3D nodes graph works like a DOM tree for rendering HTML documents: it's typically initialized from a file (3D model), but during the game execution it is dynamic, always changing.
This class takes care of performing the X3D events and routes mechanism (if ProcessEvents is True). This is what allows X3D graph to be animated, or even be interactive (respond to user actions). For a simple way to play animations, use the PlayAnimation method.
This class maintains a Shapes tree is always synchronized with the X3D nodes tree in RootNode. The Shapes tree provides a little simple view at the scene, sometimes easier (or faster) to iterate over.
Many results are cached, so querying them multiple times is fast, if the scene does not change (in a significant way) between each query. So you can query information like LocalBoundingBox, BoundingBox, VerticesCount... as often as you want to.
Source: scene/castlescenecore.pas (line 362).
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleTransform
- TX3DEventsEngine
- TCastleSceneCore
Generated by PasDoc 0.17.0.snapshot.