Instanced |
public class InstancedModelGroupVisual3D : BaseDXVisual3D
The InstancedModelGroupVisual3D type exposes the following members.
Name | Description | |
---|---|---|
InstancedModelGroupVisual3D | Constructor |
Name | Description | |
---|---|---|
InstancesData | Gets or sets an array of InstanceData structs that define the world transformations (positions, scales, rotations) and colors or instanced geometry objects. After each change of InstancesData user must call Update method. | |
IsWpf3DVisible |
Gets a Boolean that specifies if this BaseDXVisual3D can show its content when rendered with WPF 3D objects.
(Overrides BaseDXVisual3DIsWpf3DVisible) | |
IsWpfHitTestVisible | Gets or sets a Boolean that specifies if WPF hit testing can be done on the instanced 3D objects when rendered with DirectX hardware acceleration. When IsWpfHitTestVisible is true then InstancedModelGroupVisual3D always creates WPF's Model3D objects that are used by WPF's hit testing. This can increase initialization time. Default value is false. When showing instanced objects, it is recommended to use DXEngine hit testing that support fast hit testing on instanced objects and leave this property on false. | |
Model3DGroup | Gets Model3DGroup that is used by this InstancedModelGroupVisual3D | |
UseDynamicInstanceBuffer | Gets or sets a Boolean that specifies if dynamic instance buffer is created instead of immutable instance buffer. Dynamic instance buffer has better performance when instance data is changed often. On the other side the immutable buffer is better when the instance data is not changed or changed only a few times. Default value is false - use immutable buffer. |
Name | Description | |
---|---|---|
Update | Update method updates the data for all instances. It must be called after InstancesData are changed. When only some of the instances were changed, it is highly recommended to call Update(Int32, Int32, Boolean) and pass startIndex and count as parameters. | |
Update(Int32, Int32, Boolean) | Update method updates instance data specified with startIndex, count parameters and updateBounds. This method can be called after some instance transformations or colors were changed. | |
UpdateMaterial | UpdateMaterial updates the used specular material. It must be called after the SpecularMaterial is changed. |
Name | Description | |
---|---|---|
ClearDXAttribute |
Clears the value from DXAttributeType so that IsDXAttributeSet(Visual3D, DXAttributeType) method returns false for that DXAttributeType.
(Defined by Extensions) | |
GetDXAttribute |
Gets the value of the specified DXAttributeType from the specified Visual3D.
If the attributeType does not exists then an exception is thrown.
Use GetDXAttributeOrDefaultT(Visual3D, DXAttributeType) or GetDXAttributeOrDefaultT(Visual3D, DXAttributeType, T) to prevent throwing exception when the value is not set.
(Defined by Extensions) | |
GetDXAttributeCollection |
Gets a DXAttributeCollection will a collection of all DXEngine's attributes set to the specified WPF's object.
Returns null when no DXAttributeCollection was attached to the WPF object.
(Defined by Extensions) | |
GetDXAttributeOrDefaultT |
Gets the value of the specified DXAttributeType from the specified Visual3D.
If the attributeType does not exists then a default value for the type T is returned.
(Defined by Extensions) | |
GetDXAttributeOrDefaultT |
Gets the value of the specified DXAttributeType from the specified Visual3D.
If the attributeType does not exists then the specified defaultValue is returned.
(Defined by Extensions) | |
IsDXAttributeSet |
Returns true if the specified attributeType was set (result is true even if the value is null).
(Defined by Extensions) | |
SetDXAttribute |
Annotates the specified wpfObject with adding or updating a DXEngine's attribute to it.
The attribute is specified with attributeType and its value.
This can be used to annotate WPF's objects with DXEngine's attributes.
(Defined by Extensions) |
InstancedModelGroupVisual3D is a WPF Visual3D object that can be used to define a Model3DGroup that will be rendered multiple times as instances where each instace can have its own world matrix (defines scale, rotation and translation).
When rendered with DirectX, InstancedModelGroupVisual3D provides the fastest way to render many Model3DGroup instances.
InstancedModelGroupVisual3D renders the Model3DGroup with rendering each Child GeometryModel3D as instanced MeshGeometry3D where each instance has the same color - the one defined in the GeometryModel3D's Material or BackMaterial.
Because InstancedModelGroupVisual3D uses MeshGeometry3D instancing, it can render only SolidColorBrush DiffuseMaterials.
For more information about instanced rendering see remarks for InstancedMeshGeometryVisual3D.
If you want to render many instances of GeometryModel3D or MeshGeometry3D, then you can also use the InstancedMeshGeometryVisual3D.