SceneObject
Description
- Derived from
-
Disposable abstract
ISceneObject - Extended by
-
SceneEntityBase abstract
SceneEntityView abstract
Abstract base class for ISceneObject implementations.
By convention, scene objects serialize property values to JSON via the IJsonizable interface only for properties that are annotated with JsonProperty.
Subclasses shall signal their dirty state by calling the DirtyState method, optionally overriding the DirtyStateCheck method to implement custom dirty state checks. All dirty state processing should be performed in the subsequent call to DoUpdateState.
The default implementations of ISceneObject.QueryDistance and ISceneObject.QueryRay produce no query results. Overriding methods may use the following helpers:
The default implementation of ISceneObject.CallbackMask returns SceneObjectCallback.All.
Protected / Methods
DirtyFrame
This method may be called to indicate that the dirty state of this scene object requires that a new frame is rendered.
After calling this method, the next call to IUpdateableFrameTime.UpdateFrameTime will return true
, which will trigger rendering of a new frame. This method is called automatically after DoUpdateState, so usually it is not necessary to call it explicitly.
- See also
DirtyState
Marks the state of this scene object as dirty, so that ISceneObject.NeedsUpdateState will return true
.
Calling this method will trigger a subsequent call to DoUpdateState, followed by a call to DirtyFrame. To skip dirty state processing and just trigger rendering of a new frame, call the DirtyFrame method instead of DirtyState.
DirtyStateCheck
Called by ISceneObject.UpdateState when ISceneObject.NeedsUpdateState is false
.
Subclasses may override this method in order to perform custom dirty state checks, and to call DirtyState as result.
- See also
DirtyStateIfOutdated
Calls DirtyState if the current version of versioned in is not equal to version in.
- See also
DoUpdateState
Updates the state of this scene object, in order to reflect all recent changes.
This method will be called from within ISceneObject.UpdateState only when ISceneObject.NeedsUpdateState is true
. The ISceneObject.NeedsUpdateState flag is reset to false
before this method is called. The DirtyFrame method is called after calling this method.
MeshAttach
Attaches the given IMeshBound object to the underlying terrain mesh, by calling IMeshBound.MeshBind on it.
This scene object must be attached to a scene.
MeshDetach
Detaches the given IMeshBound object from the underlying terrain mesh, by calling IMeshBound.MeshUnbind on it.
This scene object must be attached to a scene.
QueryFilter
Checks if this scene object shall be included in a spatial query.
This method is intended to be used in implementations of ISceneObject.QueryDistance. It should not be used in other implementations of ISceneQueryProvider, where the ISceneQueryResultBuilder.ResultCheck1 method should be used instead.
QueryModelResult
Performs a ray intersection query for the given terrain model.
If the ray hits the given model in, a ModelResult is generated, using ISceneObject.QuerySceneObjectResult as IParentObjectContainer.ParentObject.
QueryScreenLabelResult
2 overloads
Performs an intersection query for the given screen label.
If the point hits the given screenLabel in, a ScreenLabelResult is generated, using ISceneObject.QuerySceneObjectResult as IParentObjectContainer.ParentObject.
Performs an intersection query for the given screen label.
If the point hits the given screen label, a ScreenLabelResult is generated, using ISceneObject.QuerySceneObjectResult as IParentObjectContainer.ParentObject.