Tesla Graphics Engine Documentation (January 2012)
Tesla.Scene Namespace
Declaration Syntax
namespace Tesla.Scene
All Types Classes Interfaces Enumerations
Icon Type Description
Base class for Spatial Controllers.

Hint for how the engine will treat scene graph Spatials during the culling pass.

Dirty flags for use in updating the scene graph.

Hintable interface that provides a SceneHints structure that can have local and absolute hints that tell the engine how to update/render a scene. Absolute hints can be influenced by the parent hintable, if the local hint is set to inherit.

Spatial controllers are added to any Spatial subclass that can be used to modify the spatial in some way over time. They are updated when the Spatial they are attached to is updated.

Visitor interface to traverse the scene graph and perform an operation on each node.

Collection for managing a list of lights in the 3D world. Lights can be sorted based on an IRenderable's position in the world, otherwise a light collection is little more than a container.

Hint for how the engine combines lights when updating the world light list for each mesh.

IComparer for lights that computes the how much a light affects a given Spatial.

A Mesh is a "leaf" element in the scene graph that is actual geometry that can be rendered by the device. It contains a material that describes how it is to be rendered, a model bound, and a final light collection that is sorted.

MeshData represents the raw geometric data of a Mesh. This class has built in properties for common vertex elements, however custom vertex elements can be added. When a MeshData constructs a vertex buffer, it will sort the vertex elements in the order of their VertexSemantic enumeration and their semantic index. Keep this in mind when writing shaders, to ensure vertex input layouts match. The MeshData contains a CPU copy of all data, which it uses when constructing the vertex/index buffers. This data can be used to access geometry without having to read from the graphics device. Calling Reconstruct() will completely rebuild the vertex/index buffers and dispose of previously held resources. Do not do this per-frame. MeshData supports dynamic buffers, and once the buffers are constructed UpdateVertex/IndexData can be used to set data without recreating resources.

A node represents an internal element in the scene graph, meaning it is capable of owning children. They are responsible for updating and drawing said children. Although Nodes are purely logical and are not actually drawn, their world bounding contains all their children's, which is leveraged during the culling process to cull entire subtree's in the scene graph that are not visible.

Picking hints for how the engine will treat the scene graph Spatials during picking/collision queries.

Utility for creating a pick query, casting a ray into a scene and finding the objects that intersect (are under the cursor).

SceneHints is a collection of enumerations that are used to evaluate a Spatial in the scene graph. These properties can be inherited from the Spatial's parent, if the local hint is set to inherit.

The scene graph is a tree hierarchy that contains: 1. Transformations 2. Bounding Volumes 3. Lights Spatial is the root class that every object in the scene graph inherits from. A spatial is simply an entity that exists somewhere in the world, whether it's logical or a renderable model. Spatial's that are nodes can have children, those that are Mesh's represent a renderable 3D model and are "leaves" on the scene graph. In the scene local vs world properties correspond to the frame - local values are local to the Spatial, where as world properties are absolute (and often are influenced by parents or children of the Spatial). These properties are updated when Update() is called. Spatial is smart enough to only recompute these values if they have been changed, reducing redundant computations. During drawing operations, the scene graph automatically performs a culling check with the renderer's current camera. This is done in the OnDraw() method.