C# Класс Visualizer.GeometricPrimitive

Base class for simple geometric primitive models. This provides a vertex buffer, an index buffer, plus methods for drawing the model. Classes for specific types of primitive (CubePrimitive, SpherePrimitive, etc.) are derived from this common base, and use the AddVertex and AddIndex methods to specify their geometry.
Наследование: IDisposable
Показать файл Открыть проект

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

Метод Описание
Dispose ( ) : void

Frees resources used by this object.

Draw ( Effect effect ) : void

Draws the primitive model, using the specified effect. Unlike the other Draw overload where you just specify the world/view/projection matrices and color, this method does not set any renderstates, so you must make sure all states are set to sensible values before you call it.

Draw ( Matrix world, Matrix view, Matrix projection, Color color ) : void

Draws the primitive model, using a BasicEffect shader with default lighting. Unlike the other Draw overload where you specify a custom effect, this method sets important renderstates to sensible values for 3D model rendering, so you do not need to set these states before you call it.

Защищенные методы

Метод Описание
AddIndex ( int index ) : void

Adds a new index to the primitive model. This should only be called during the initialization process, before InitializePrimitive.

AddVertex ( Vector3 position, Vector3 normal ) : void

Adds a new vertex to the primitive model. This should only be called during the initialization process, before InitializePrimitive.

Dispose ( bool disposing ) : void

Frees resources used by this object.

InitializePrimitive ( GraphicsDevice graphicsDevice ) : void

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

AddIndex() защищенный Метод

Adds a new index to the primitive model. This should only be called during the initialization process, before InitializePrimitive.
protected AddIndex ( int index ) : void
index int
Результат void

AddVertex() защищенный Метод

Adds a new vertex to the primitive model. This should only be called during the initialization process, before InitializePrimitive.
protected AddVertex ( Vector3 position, Vector3 normal ) : void
position Vector3
normal Vector3
Результат void

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

Frees resources used by this object.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Frees resources used by this object.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

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

Draws the primitive model, using the specified effect. Unlike the other Draw overload where you just specify the world/view/projection matrices and color, this method does not set any renderstates, so you must make sure all states are set to sensible values before you call it.
public Draw ( Effect effect ) : void
effect Microsoft.Xna.Framework.Graphics.Effect
Результат void

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

Draws the primitive model, using a BasicEffect shader with default lighting. Unlike the other Draw overload where you specify a custom effect, this method sets important renderstates to sensible values for 3D model rendering, so you do not need to set these states before you call it.
public Draw ( Matrix world, Matrix view, Matrix projection, Color color ) : void
world Matrix
view Matrix
projection Matrix
color Color
Результат void

InitializePrimitive() защищенный Метод

protected InitializePrimitive ( GraphicsDevice graphicsDevice ) : void
graphicsDevice GraphicsDevice
Результат void