C# Класс Axiom.Graphics.VertexData

Summary class collecting together vertex source information.
Наследование: DisposableObject
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
HWAnimDataItemsUsed int
HWAnimationDataList List
hardwareShadowVolWBuffer HardwareVertexBuffer
vertexBufferBinding VertexBufferBinding
vertexCount int
vertexDeclaration VertexDeclaration
vertexStart int

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

Метод Описание
AllocateHardwareAnimationElements ( ushort count ) : void

Allocate elements to serve a holder of morph / pose target data for hardware morphing / pose blending.

This method will allocate the given number of 3D texture coordinate sets for use as a morph target or target pose offset (3D position). These elements will be saved in hwAnimationDataList. It will also assume that the source of these new elements will be new buffers which are not bound at this time, so will start the sources to 1 higher than the current highest binding source. The caller is expected to bind these new buffers when appropriate. For morph animation the original position buffer will be the 'from' keyframe data, whilst for pose animation it will be the original vertex data.

Clone ( ) : VertexData

Clones this vertex data, potentially including replicating any vertex buffers.

Clone ( bool copyData ) : VertexData

Clones this vertex data, potentially including replicating any vertex buffers.

PrepareForShadowVolume ( ) : void

Modifies the vertex data to be suitable for use for rendering shadow geometry.

Preparing vertex data to generate a shadow volume involves firstly ensuring that the vertex buffer containing the positions is a standalone vertex buffer, with no other components in it. This method will therefore break apart any existing vertex buffers if position is sharing a vertex buffer. Secondly, it will double the size of this vertex buffer so that there are 2 copies of the position data for the mesh. The first half is used for the original, and the second half is used for the 'extruded' version. The vertex count used to render will remain the same though, so as not to add any overhead to regular rendering of the object. Both copies of the position are required in one buffer because shadow volumes stretch from the original mesh to the extruded version.

It's important to appreciate that this method can fundamentally change the structure of your vertex buffers, although in reality they will be new buffers. As it happens, if other objects are using the original buffers then they will be unaffected because the reference counting will keep them intact. However, if you have made any assumptions about the structure of the vertex data in the buffers of this object, you may have to rethink them.

VertexData ( ) : System

Default constructor. Calls on the current buffer manager to initialize the bindings and declarations.

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

Метод Описание
dispose ( bool disposeManagedResources ) : void

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

AllocateHardwareAnimationElements() публичный метод

Allocate elements to serve a holder of morph / pose target data for hardware morphing / pose blending.
This method will allocate the given number of 3D texture coordinate sets for use as a morph target or target pose offset (3D position). These elements will be saved in hwAnimationDataList. It will also assume that the source of these new elements will be new buffers which are not bound at this time, so will start the sources to 1 higher than the current highest binding source. The caller is expected to bind these new buffers when appropriate. For morph animation the original position buffer will be the 'from' keyframe data, whilst for pose animation it will be the original vertex data.
public AllocateHardwareAnimationElements ( ushort count ) : void
count ushort
Результат void

Clone() публичный метод

Clones this vertex data, potentially including replicating any vertex buffers.
public Clone ( ) : VertexData
Результат VertexData

Clone() публичный метод

Clones this vertex data, potentially including replicating any vertex buffers.
public Clone ( bool copyData ) : VertexData
copyData bool /// If true, makes a copy the vertex buffer in addition to the definition. /// If false, the clone will refer to the same vertex buffer this object refers to. ///
Результат VertexData

PrepareForShadowVolume() публичный метод

Modifies the vertex data to be suitable for use for rendering shadow geometry.

Preparing vertex data to generate a shadow volume involves firstly ensuring that the vertex buffer containing the positions is a standalone vertex buffer, with no other components in it. This method will therefore break apart any existing vertex buffers if position is sharing a vertex buffer. Secondly, it will double the size of this vertex buffer so that there are 2 copies of the position data for the mesh. The first half is used for the original, and the second half is used for the 'extruded' version. The vertex count used to render will remain the same though, so as not to add any overhead to regular rendering of the object. Both copies of the position are required in one buffer because shadow volumes stretch from the original mesh to the extruded version.

It's important to appreciate that this method can fundamentally change the structure of your vertex buffers, although in reality they will be new buffers. As it happens, if other objects are using the original buffers then they will be unaffected because the reference counting will keep them intact. However, if you have made any assumptions about the structure of the vertex data in the buffers of this object, you may have to rethink them.

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

VertexData() публичный метод

Default constructor. Calls on the current buffer manager to initialize the bindings and declarations.
public VertexData ( ) : System
Результат System

dispose() защищенный метод

protected dispose ( bool disposeManagedResources ) : void
disposeManagedResources bool
Результат void

Описание свойств

HWAnimDataItemsUsed публичное свойство

Number of hardware animation data items used
public int HWAnimDataItemsUsed
Результат int

HWAnimationDataList публичное свойство

VertexElements used for hardware morph / pose animation
public List HWAnimationDataList
Результат List

hardwareShadowVolWBuffer публичное свойство

Additional shadow volume vertex buffer storage.
This additional buffer is only used where we have prepared this VertexData for use in shadow volume contruction, and where the current render system supports vertex programs. This buffer contains the 'w' vertex position component which will be used by that program to differentiate between extruded and non-extruded vertices. This 'w' component cannot be included in the original position buffer because DirectX does not allow 4-component positions in the fixed-function pipeline, and the original position buffer must still be usable for fixed-function rendering.

Note that we don't store any vertex declaration or vertex buffer binding here becuase this can be reused in the shadow algorithm.

public HardwareVertexBuffer hardwareShadowVolWBuffer
Результат HardwareVertexBuffer

vertexBufferBinding публичное свойство

The vertex buffer bindings to be used.
public VertexBufferBinding vertexBufferBinding
Результат VertexBufferBinding

vertexCount публичное свойство

The number of vertices used in this operation.
public int vertexCount
Результат int

vertexDeclaration публичное свойство

Declaration of the vertex to be used in this operation.
public VertexDeclaration vertexDeclaration
Результат VertexDeclaration

vertexStart публичное свойство

The base vertex index to start from, if using unindexed geometry.
public int vertexStart
Результат int