VoxelInstanceLibraryMultiMeshItem
Instancer model using MultiMesh to render.
Instancer model using MultiMesh to render.
This model is suited for rendering very large amounts of simple instances, such as grass and rocks.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
VoxelInstanceLibraryMultiMeshItemConstructor
public VoxelInstanceLibraryMultiMeshItem();Properties21
CastShadowProperty
public RenderingServer.ShadowCastingSetting CastShadow { get; set; }CollisionDistanceProperty
public float CollisionDistance { get; set; }When greater than 0 and colliders are configured, hints the distance below which colliders may be created. This allows to reduce the amount of colliders while keeping a high view distance for visuals. When negative, colliders will be created at all distances. Note: the instancer creates/removes colliders on a per-chunk basis, so this distance is compared against the distance to chunks, and not individual instances.
CollisionLayerProperty
public int CollisionLayer { get; set; }CollisionMaskProperty
public int CollisionMask { get; set; }CollisionShapesProperty
public Reckfell.Collections.Array CollisionShapes { get; set; }Alternating list of CollisionShape and Transform3D. Shape comes first, followed by its local transform relative to the instance. Setting up collision shapes in the editor may require using a scene instead.
GIModeProperty
public GeometryInstance3D.GIModeEnum GIMode { get; set; }HideBeyondMaxLodProperty
public bool HideBeyondMaxLod { get; set; }MaterialOverrideProperty
public Material MaterialOverride { get; set; }MeshProperty
public Mesh Mesh { get; set; }MeshLod0DistanceRatioProperty
public float MeshLod0DistanceRatio { get; set; }MeshLod1Property
public Mesh MeshLod1 { get; set; }MeshLod1DistanceRatioProperty
public float MeshLod1DistanceRatio { get; set; }MeshLod2Property
public Mesh MeshLod2 { get; set; }MeshLod2DistanceRatioProperty
public float MeshLod2DistanceRatio { get; set; }MeshLod3Property
public Mesh MeshLod3 { get; set; }MeshLod3DistanceRatioProperty
public float MeshLod3DistanceRatio { get; set; }RemovalBehaviorProperty
public VoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnum RemovalBehavior { get; set; }Specifies what should happen when instances get removed. This is useful if they should turn into more complex objects with animation or logic in them.
RemovalSceneProperty
public PackedEntity RemovalScene { get; set; }Scene that will be used if VoxelInstanceLibraryMultiMeshItem.RemovalBehavior is set to VoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnum.Instantiate.
RenderLayerProperty
public int RenderLayer { get; set; }SceneProperty
public PackedEntity Scene { get; set; }Scene that will be used as configuration instead of manual properties. It should have a specific node structure to be supported. See [url]https://voxel-tools.readthedocs.io/en/latest/instancing/#setting-up-a-multimesh-item-from-a-scene[/url]
_MeshLodDistanceRatiosProperty
public float[] _MeshLodDistanceRatios { get; set; }Methods30
GetCastShadowsSettingRenderingServer.ShadowCastingSetting
public RenderingServer.ShadowCastingSetting GetCastShadowsSetting();RenderingServer.ShadowCastingSettingGetColliderGroupNamesReckfell.Collections.Array<StringName>
public Reckfell.Collections.Array<StringName> GetColliderGroupNames();Gets the list of group names that are added to collider nodes.
Reckfell.Collections.Array<StringName>GetCollisionDistancefloat
public float GetCollisionDistance();floatGetCollisionLayerint
public int GetCollisionLayer();intGetCollisionMaskint
public int GetCollisionMask();intGetCollisionShapesReckfell.Collections.Array
public Reckfell.Collections.Array GetCollisionShapes();Reckfell.Collections.ArrayGetGIModeGeometryInstance3D.GIModeEnum
public GeometryInstance3D.GIModeEnum GetGIMode();GeometryInstance3D.GIModeEnumGetHideBeyondMaxLodbool
public bool GetHideBeyondMaxLod();boolGetMaterialOverrideMaterial
public Material GetMaterialOverride();MaterialGetMeshMesh
public Mesh GetMesh(int meshLodIndex);| Name | Type | Default |
|---|---|---|
meshLodIndex | int | — |
MeshGetRemovalBehaviorVoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnum
public VoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnum GetRemovalBehavior();VoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnumGetRemovalScenePackedEntity
public PackedEntity GetRemovalScene();PackedEntityGetRenderLayerint
public int GetRenderLayer();intGetScenePackedEntity
public PackedEntity GetScene();PackedEntitySetCastShadowsSettingvoid
public void SetCastShadowsSetting(RenderingServer.ShadowCastingSetting mode);| Name | Type | Default |
|---|---|---|
mode | RenderingServer.ShadowCastingSetting | — |
SetColliderGroupNamesvoid
public void SetColliderGroupNames(Reckfell.Collections.Array<StringName> names);Sets the list of group names that will be added to collider nodes generated for each instance.
| Name | Type | Default |
|---|---|---|
names | Reckfell.Collections.Array<StringName> | — |
SetCollisionDistancevoid
public void SetCollisionDistance(float distance);| Name | Type | Default |
|---|---|---|
distance | float | — |
SetCollisionLayervoid
public void SetCollisionLayer(int collisionLayer);| Name | Type | Default |
|---|---|---|
collisionLayer | int | — |
SetCollisionMaskvoid
public void SetCollisionMask(int collisionMask);| Name | Type | Default |
|---|---|---|
collisionMask | int | — |
SetCollisionShapesvoid
public void SetCollisionShapes(Reckfell.Collections.Array shapeInfos);| Name | Type | Default |
|---|---|---|
shapeInfos | Reckfell.Collections.Array | — |
SetGIModevoid
public void SetGIMode(GeometryInstance3D.GIModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | GeometryInstance3D.GIModeEnum | — |
SetHideBeyondMaxLodvoid
public void SetHideBeyondMaxLod(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetMaterialOverridevoid
public void SetMaterialOverride(Material material);| Name | Type | Default |
|---|---|---|
material | Material | — |
SetMeshvoid
public void SetMesh(Mesh mesh, int meshLodIndex);| Name | Type | Default |
|---|---|---|
mesh | Mesh | — |
meshLodIndex | int | — |
SetRemovalBehaviorvoid
public void SetRemovalBehavior(VoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnum rb);| Name | Type | Default |
|---|---|---|
rb | VoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnum | — |
SetRemovalScenevoid
public void SetRemovalScene(PackedEntity scene);| Name | Type | Default |
|---|---|---|
scene | PackedEntity | — |
SetRenderLayervoid
public void SetRenderLayer(int renderLayer);| Name | Type | Default |
|---|---|---|
renderLayer | int | — |
SetScenevoid
public void SetScene(PackedEntity scene);| Name | Type | Default |
|---|---|---|
scene | PackedEntity | — |
SetupFromTemplatevoid
public void SetupFromTemplate(Entity node);| Name | Type | Default |
|---|---|---|
node | Entity | — |
_OnInstanceRemovedvoid
public virtual void _OnInstanceRemoved(VoxelInstancer instancer, Transform3D transform);This method will be called if you set VoxelInstanceLibraryMultiMeshItem.RemovalBehavior to VoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnum.Callback.
Note: this method can be called from within the removal of a node that is child of VoxelInstancer. In this context, Reckfell will prevent you from adding new child nodes. You can workaround that by using ReckfellObject.CallDeferred. See also VoxelInstancerRigidBody.QueueFreeAndNotifyInstancer.
| Name | Type | Default |
|---|---|---|
instancer | VoxelInstancer | — |
transform | Transform3D | — |
Fields and constants1
MaxMeshLodsField
public const long MaxMeshLods = 4;VoxelInstanceLibraryMultiMeshItem.RemovalBehaviorEnum
| Value | Description |
|---|---|
Callback = 2 | Calls |
Instantiate = 1 | Instantiates the |
None = 0 | No extra logic will run when instances are removed. |