C# Class MonoGame.Interop.Wpf.Primitives.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.
Inheritance: IDisposable
Datei anzeigen Open project: Eastrall/MonoGame.Interop

Public Methods

Method Description
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.

Protected Methods

Method Description
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

Method Details

AddIndex() protected method

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
return void

AddVertex() protected method

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
return void

Dispose() public method

Frees resources used by this object.
public Dispose ( ) : void
return void

Dispose() protected method

Frees resources used by this object.
protected Dispose ( bool disposing ) : void
disposing bool
return void

Draw() public method

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
return void

Draw() public method

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
return void

InitializePrimitive() protected method

protected InitializePrimitive ( GraphicsDevice graphicsDevice ) : void
graphicsDevice GraphicsDevice
return void