C# Класс Nez.Mesh

basic class that can be used to create simple meshes. For more advanced usage subclass and override what is needed. The general gist of usage is the following: - call setVertPositions - call setTriangles to set the triangle indices - call recalculateBounds to prepare the Mesh for rendering and culling
Наследование: RenderableComponent
Показать файл Открыть проект

Открытые методы

Метод Описание
onAddedToEntity ( ) : void
recalculateBounds ( bool recalculateUVs ) : Mesh

recalculates the bounds and optionally sets the UVs. The UVs are setup to map the texture in a best fit fashion.

render ( Graphics graphics, Camera camera ) : void
setColor ( Microsoft.Xna.Framework.Color color ) : Mesh

sets the color for all of the verts

setColorForAllVerts ( Microsoft.Xna.Framework.Color color ) : Mesh

helper that sets the color for all verts

setColorForVert ( int vertIndex, Microsoft.Xna.Framework.Color color ) : Mesh

sets the vertex color for a single vert

setTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Mesh

sets the texture. Pass in null to unset the texture.

setTriangles ( int triangles ) : Mesh

sets the triangle indices for rendering

setVertPositions ( Vector2 positions ) : Mesh

sets the vert positions. If the positions array does not match the verts array size the verts array will be recreated.

setVertPositions ( Microsoft.Xna.Framework.Vector3 positions ) : Mesh

sets the vert positions. If the positions array does not match the verts array size the verts array will be recreated.

setVertexColorEnabled ( bool shouldEnableVertexColors ) : Mesh

sets whether vertex colors will be used by the shader

Описание методов

onAddedToEntity() публичный Метод

public onAddedToEntity ( ) : void
Результат void

recalculateBounds() публичный Метод

recalculates the bounds and optionally sets the UVs. The UVs are setup to map the texture in a best fit fashion.
public recalculateBounds ( bool recalculateUVs ) : Mesh
recalculateUVs bool If set to true recalculate U vs.
Результат Mesh

render() публичный Метод

public render ( Graphics graphics, Camera camera ) : void
graphics Graphics
camera Camera
Результат void

setColor() публичный Метод

sets the color for all of the verts
public setColor ( Microsoft.Xna.Framework.Color color ) : Mesh
color Microsoft.Xna.Framework.Color Color.
Результат Mesh

setColorForAllVerts() публичный Метод

helper that sets the color for all verts
public setColorForAllVerts ( Microsoft.Xna.Framework.Color color ) : Mesh
color Microsoft.Xna.Framework.Color Color.
Результат Mesh

setColorForVert() публичный Метод

sets the vertex color for a single vert
public setColorForVert ( int vertIndex, Microsoft.Xna.Framework.Color color ) : Mesh
vertIndex int Vert index.
color Microsoft.Xna.Framework.Color Color.
Результат Mesh

setTexture() публичный Метод

sets the texture. Pass in null to unset the texture.
public setTexture ( Microsoft.Xna.Framework.Graphics.Texture2D texture ) : Mesh
texture Microsoft.Xna.Framework.Graphics.Texture2D Texture.
Результат Mesh

setTriangles() публичный Метод

sets the triangle indices for rendering
public setTriangles ( int triangles ) : Mesh
triangles int Triangles.
Результат Mesh

setVertPositions() публичный Метод

sets the vert positions. If the positions array does not match the verts array size the verts array will be recreated.
public setVertPositions ( Vector2 positions ) : Mesh
positions Microsoft.Xna.Framework.Vector2 Positions.
Результат Mesh

setVertPositions() публичный Метод

sets the vert positions. If the positions array does not match the verts array size the verts array will be recreated.
public setVertPositions ( Microsoft.Xna.Framework.Vector3 positions ) : Mesh
positions Microsoft.Xna.Framework.Vector3 Positions.
Результат Mesh

setVertexColorEnabled() публичный Метод

sets whether vertex colors will be used by the shader
public setVertexColorEnabled ( bool shouldEnableVertexColors ) : Mesh
shouldEnableVertexColors bool If set to true should enable vertex colors.
Результат Mesh