Tesla Graphics Engine Documentation (January 2012)
Mesh Class
TeslaTesla.SceneMesh
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.
Declaration Syntax
C#
public class Mesh : Spatial, IRenderable, IPickable
Members
All Members Constructors Methods Properties



Icon Member Description
Mesh()()()()
Do not use directly, for ISavable

Mesh(String)
Creates a new Mesh.

Mesh(String, MeshData)
Creates a new Mesh using the supplied MeshData object, which may or may not be null. Useful if multiple meshes are to share the same geometry.

AcceptVisitor(IVisitor, Boolean)
Accept a visitor and let it perform an action on this Spatial.
(Inherited from Spatial.)
AddController(ISpatialController)
Add a controller to this Spatial's collection.
(Inherited from Spatial.)
AddLight(Light)
Adds a light to the Spatial's light collection.
(Inherited from Spatial.)
ClearDirty(DirtyMark)
Clears the specified dirty mark from this Spatial.
(Inherited from Spatial.)
CollectLights(LightCollection)
Collects all the lights from this Spatial up to the root, copying all lights at each node.
(Inherited from Spatial.)
ComputeTangentBasis()()()()
Compute the tangent basis of the mesh's geometry. This requires the geometry to have both normals and texture coordinates (first index is used). It will reconstruct the vertex buffer.

Controllers
Gets the read-only controller collection attached to this Spatial.
(Inherited from Spatial.)
Draw(IRenderer)
Draws the spatial if it skips the render queue, or adds this mesh to the queue to be rendered at a later time.
(Overrides Spatial.Draw(IRenderer).)
Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetControllerAt(Int32)
Gets the controller at the specified index in this Spatial's collection. If the index is out of range, null will be returned.
(Inherited from Spatial.)
GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetLightAt(Int32)
Gets the light from the Spatial's light collection if it exists.
(Inherited from Spatial.)
GetType()()()()
Gets the Type of the current instance.
(Inherited from Object.)
IntersectsPrimitivesWhere(Ray)
Performs a Ray-Triangle intersection test on the geometry. Will return an empty record for line meshes.

IsDirty(DirtyMark)
Checks if this Spatial is marked with the specified dirty mark.
(Inherited from Spatial.)
IsPickable
Gets if the mesh is pickable. Same as querying the scene hint's picking hint.

LastFrustumIntersect
Gets or sets the last frustum intersection result, which is used in the cull check in OnDraw(). Set this if you render a subtree and do not want it to be influenced by the parent.
(Inherited from Spatial.)
Lights
Gets the local light collection relative to this Spatial. This collection is not read-only, but it is safe to modify its content as it will update the spatial it is attached to automatically.
(Inherited from Spatial.)
MarkDirty(DirtyMark)
Marks the spatial dirty, but does not propagate the mark up/down the tree.
(Inherited from Spatial.)
Material
Gets or sets the Material, which describes how to render the mesh.

MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
MeshData
Gets or sets the MeshData, representing the actual geometry of the mesh.

ModelBound
Gets or sets the mesh's bounding volume, which contains the entire geometry in model (local) space.

Name
Get or set this Spatial's name.
(Inherited from Spatial.)
OnDraw(IRenderer)
Checks if the Spatial should be culled, if the Spatial is visible then Draw() will be called.
(Inherited from Spatial.)
OrthoOrder
Gets the ortho order. When the renderable is used in the ortho render bucket, it is sorted based on this value (lower values are rendered first and higher values last).

Parent
Gets this Spatial's parent.
(Inherited from Spatial.)
ParentHintable
Gets the IHintable parent fro this Spatial, for inheritable scene hints to use.
(Inherited from Spatial.)
PropagateBoundToRoot()()()()
Update this Spatial's parent world bounding and propagates the call to the root, ensuring all ancestors' world boundings properly contain their children's.
(Inherited from Spatial.)
PropagateDirtyDown(DirtyMark)
Marks this spatial with the dirty flag and then propagates it down the scene graph. This is meant to be overridden by subclasses that have children.
(Inherited from Spatial.)
PropagateDirtyUp(DirtyMark)
Marks this spatial with the dirty flag and then propagates it up the scene graph.
(Inherited from Spatial.)
Read(ISavableReader)
Deserializes the object and populates it from the input.
(Overrides Spatial.Read(ISavableReader).)
RemoveAllControllers()()()()
Remove all controllers from this Spatial's collection.
(Inherited from Spatial.)
RemoveAllLights()()()()
Removes all lights from the Spatial's light collection.
(Inherited from Spatial.)
RemoveController(ISpatialController)
Removes a controller from this Spatial's collection.
(Inherited from Spatial.)
RemoveControllerAt(Int32)
Removes a controller from the specified index in this Spatial's collection. If the index is out of range, then false will be returned.
(Inherited from Spatial.)
RemoveFromParent()()()()
Removes this spatial from its parent, if it exists.
(Inherited from Spatial.)
RemoveLight(Light)
Removes the specified light from the Spatial light collection, if it exists.
(Inherited from Spatial.)
RemoveLightAt(Int32)
Removes a light by index from the Spatial's light collection.
(Inherited from Spatial.)
Render(IRenderer)
Makes the actual device calls to render the mesh.

RenderBucketType
Gets or sets the renderable's render bucket type.

Rotation
Get or set this Spatial's local rotation.
(Inherited from Spatial.)
Scale
Get or set this Spatial's local scale.
(Inherited from Spatial.)
SceneHints
Gets this Spatial's scene hints, a collection of enumerations that describe how the spatial should be processed.
(Inherited from Spatial.)
SetMaterial(Material)
Set the mesh's material. Same as mesh.Material property
(Overrides Spatial.SetMaterial(Material).)
SetModelBound(BoundingVolume)
Set the model bound. Same as using mesh.ModelBound property.
(Overrides Spatial.SetModelBound(BoundingVolume).)
SetRandomColors(Single)
Sets random colors with constant alpha in the geometry, matching the number of vertices. If none are present, the method will return. If the geometry already has colors, it will update the vertex buffer and not reconstruct it, otherwise it will rebuild the vertex buffer.

SetRandomColors()()()()
Sets random colors in the geometry, matching the number of vertices. If none are present, the method will return. If the geometry already has colors, it will update the vertex buffer and not reconstruct it.

SetRenderState(RenderState)
Sets the render state onto the Material, if it exists. If not, the state is lost.
(Overrides Spatial.SetRenderState(RenderState).)
SetRotation(Matrix)
Convience method to set local rotation from a matrix.
(Inherited from Spatial.)
SetScale(Single)
Convience method to set local uniform scale.
(Inherited from Spatial.)
SetSolidColor(Color)
Sets a single solid vertex color in the Mesh's MeshData, matching the number of vertices contained. If none are present, the method will return. If the geometry already has colors, it will update the vertex buffer and not reconstruct it.

SetTranslation(Single, Single, Single)
Convience method to set local translation.
(Inherited from Spatial.)
SortLights()()()()
Sorts the mesh's world lights.
(Overrides Spatial.SortLights()()()().)
ToString()()()()
Returns a String that represents the current Object.
(Inherited from Object.)
Transform
Get or set this Spatial's local transform.
(Inherited from Spatial.)
Translation
Get or set this Spatial's local translation.
(Inherited from Spatial.)
TransparencyType
Gets the transparency mode to use, one-pass or two-pass.

Update(GameTime)
Update the Spatial. Updating it will update the transformation, lighting, and bounding properties if they are dirty. Update order: 1. Controllers 2. World Transform 3. World lighting 4. Children (if Node) 5. World Bounding 6. Propagate Bound (if initiator)
(Inherited from Spatial.)
Update(GameTime, Boolean)
Update the Spatial. Updating it will update the transformation, lighting, and bounding properties if they are dirty. This is mainly used internally, as initiating will propagate the scene world bounding to the root node, after its children and their children are updated (if a Node). Update order: 1. Controllers 2. World Transform 3. World lighting 4. Children (if Node) 5. World Bounding 6. Propagate Bound (if initiator)
(Inherited from Spatial.)
UpdateControllers(GameTime)
Updates the controllers attached to this node.
(Inherited from Spatial.)
UpdateModelBound()()()()
Update the model bound based on the mesh's geometric data.

UpdateWorldBound(Boolean)
Updates the world bounding of this Mesh, which is simply the model bound transformed by the world transformation of the mesh.
(Overrides Spatial.UpdateWorldBound(Boolean).)
UpdateWorldLights(Boolean)
Updates world lights.
(Overrides Spatial.UpdateWorldLights(Boolean).)
UpdateWorldTransform(Boolean)
Updates the world transform of this spatial, clearing the dirty mark if present.
(Inherited from Spatial.)
WorldBounding
Gets or sets the world bounding for this Spatial. This may be null.
(Inherited from Spatial.)
WorldLights
Gets the world light collection owned by this Mesh.

WorldMatrix
Get the world matrix for this Spatial. This is equivalent to spatial.WorldTransforms.GetMatrix()
(Inherited from Spatial.)
WorldRotation
Get this Spatial's world rotation.
(Inherited from Spatial.)
WorldScale
Gets this Spatial's world scale.
(Inherited from Spatial.)
WorldTransform
Gets this Spatial's world transform.
(Inherited from Spatial.)
WorldTranslation
Get this Spatial's world translation.
(Inherited from Spatial.)
Write(ISavableWriter)
Serializes the object and writes it to the output.
(Overrides Spatial.Write(ISavableWriter).)
Inheritance Hierarchy
Object
Spatial
  Mesh
    Box
    Line
    Pyramid
    Quad
    Sphere
    Teapot
    Torus

Assembly: Tesla (Module: Tesla) Version: 0.5.0.0 (0.5.0.0)