C# Класс Axiom.Core.InstancedGeometry

Pre-transforms and batches up meshes for efficient use as instanced geometry in a scene Shader instancing allows to save both memory and draw calls. While StaticGeometry stores 500 times the same object in a batch to display 500 objects, this shader instancing implementation stores only 80 times the object, and then re-uses the vertex data with different shader parameter. Although you save memory, you make more draw call. However, you still make less draw calls than if you were rendering each object independently. Plus, you can move the batched objects independently of one another which you cannot do with StaticGeometry.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
mBatchInstanceDimensions Vector3
mBuilt bool
mCastShadows bool
mHalfBatchInstanceDimensions Vector3
mName String
mOrigin Vector3
mOwner SceneManager
mSquaredUpperDistance float
mUpperDistance float
mVisible bool

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

Метод Описание
AddEntity ( Entity ent, Vector3 position ) : void
AddEntity ( Entity ent, Vector3 position, Quaternion orientation ) : void
AddEntity ( Entity ent, Vector3 position, Quaternion orientation, Vector3 scale ) : void

Adds an Entity to the static geometry. This method takes an existing Entity and adds its details to the list of elements to include when building. Note that the Entity itself is not copied or referenced in this method; an Entity is passed simply so that you can change the materials of attached SubEntity objects if you want. You can add the same Entity instance multiple times with different material settings completely safely, and destroy the Entity before destroying this InstancedGeometry if you like. The Entity passed in is simply Must be called before 'Build'.

AddEntity ( Entity ent, Vector3 position, Vector3 scale ) : void
AddSceneNode ( SceneNode node ) : void

adds all the Entity objects attached to a SceneNode and all it's children to the static geometry. This method performs just like addEntity, except it adds all the entities attached to an entire sub-tree to the geometry. The position / orientation / scale parameters are taken from the node structure instead of being specified manually.

DetermineGeometry ( SubMesh sm ) : List

Look up or calculate the geometry data to use for this SubMesh

InstancedGeometry ( SceneManager owner, String name ) : System
SplitGeometry ( VertexData vd, IndexData id, Axiom.Core.SubMeshLodGeometryLink &targetGeomLink ) : void

Split some shared geometry into dedicated geometry.

Приватные методы

Метод Описание
BuildIndexRemap ( uint pBuffer, int numIndexes, int>.Dictionary &remap ) : void
BuildIndexRemap ( ushort pBuffer, int numIndexes, int>.Dictionary &remap ) : void
RemapIndexes ( uint src, uint dst, int>.Dictionary &remap, int numIndexes ) : void
RemapIndexes ( ushort src, ushort dst, int>.Dictionary &remap, int numIndexes ) : void

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

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

public AddEntity ( Entity ent, Vector3 position ) : void
ent Entity
position Vector3
Результат void

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

public AddEntity ( Entity ent, Vector3 position, Quaternion orientation ) : void
ent Entity
position Vector3
orientation Axiom.Math.Quaternion
Результат void

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

Adds an Entity to the static geometry. This method takes an existing Entity and adds its details to the list of elements to include when building. Note that the Entity itself is not copied or referenced in this method; an Entity is passed simply so that you can change the materials of attached SubEntity objects if you want. You can add the same Entity instance multiple times with different material settings completely safely, and destroy the Entity before destroying this InstancedGeometry if you like. The Entity passed in is simply Must be called before 'Build'.
public AddEntity ( Entity ent, Vector3 position, Quaternion orientation, Vector3 scale ) : void
ent Entity The Entity to use as a definition (the Mesh and Materials /// referenced will be recorded for the build call).
position Vector3 The world position at which to add this Entity
orientation Axiom.Math.Quaternion The world orientation at which to add this Entity
scale Vector3
Результат void

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

public AddEntity ( Entity ent, Vector3 position, Vector3 scale ) : void
ent Entity
position Vector3
scale Vector3
Результат void

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

adds all the Entity objects attached to a SceneNode and all it's children to the static geometry. This method performs just like addEntity, except it adds all the entities attached to an entire sub-tree to the geometry. The position / orientation / scale parameters are taken from the node structure instead of being specified manually.
public AddSceneNode ( SceneNode node ) : void
node SceneNode
Результат void

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

Look up or calculate the geometry data to use for this SubMesh
public DetermineGeometry ( SubMesh sm ) : List
sm SubMesh
Результат List

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

public InstancedGeometry ( SceneManager owner, String name ) : System
owner SceneManager
name String
Результат System

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

Split some shared geometry into dedicated geometry.
public SplitGeometry ( VertexData vd, IndexData id, Axiom.Core.SubMeshLodGeometryLink &targetGeomLink ) : void
vd Axiom.Graphics.VertexData
id Axiom.Graphics.IndexData
targetGeomLink Axiom.Core.SubMeshLodGeometryLink
Результат void

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

mBatchInstanceDimensions защищенное свойство

protected Vector3 mBatchInstanceDimensions
Результат Vector3

mBuilt защищенное свойство

protected bool mBuilt
Результат bool

mCastShadows защищенное свойство

protected bool mCastShadows
Результат bool

mHalfBatchInstanceDimensions защищенное свойство

protected Vector3 mHalfBatchInstanceDimensions
Результат Vector3

mName защищенное свойство

protected String mName
Результат String

mOrigin защищенное свойство

protected Vector3 mOrigin
Результат Vector3

mOwner защищенное свойство

protected SceneManager,Axiom.Core mOwner
Результат SceneManager

mSquaredUpperDistance защищенное свойство

protected float mSquaredUpperDistance
Результат float

mUpperDistance защищенное свойство

protected float mUpperDistance
Результат float

mVisible защищенное свойство

protected bool mVisible
Результат bool