VoxelViewer
Attach this as a child node of characters, so the voxel world will know where to load blocks around them. If no viewer is present in the world, nothing will generate.
Attach this as a child node of characters, so the voxel world will know where to load blocks around them. If no viewer is present in the world, nothing will generate.
The voxel world uses the position and options of all the VoxelViewer nodes to determine where to load blocks, and prioritize updates. For example, a voxel placed 100 units away from a player will have much lower priority than the modifications that player is doing when digging in front of them.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
VoxelViewerConstructor
public VoxelViewer();Properties6
EnabledInEditorProperty
public bool EnabledInEditor { get; set; }Sets whether this viewer will cause loading to occur in the editor. This is mainly intented for testing purposes.
RequiresCollisionsProperty
public bool RequiresCollisions { get; set; }If set to true, the engine will generate classic collision shapes around this viewer.
RequiresDataBlockNotificationsProperty
public bool RequiresDataBlockNotifications { get; set; }RequiresVisualsProperty
public bool RequiresVisuals { get; set; }If set to true, the engine will generate meshes around this viewer. This may be enabled for the local player.
ViewDistanceProperty
public uint ViewDistance { get; set; }How far should voxels generate around this viewer.
Note: the effective view distance may be limited by the terrain node.
Note 2: when using VoxelLodTerrain, this distance essentially acts as a limit to how far the last LOD extends.
ViewDistanceVerticalRatioProperty
public float ViewDistanceVerticalRatio { get; set; }Modifies vertical view distance to be a ratio of the VoxelViewer.ViewDistance property. For example, if VoxelViewer.ViewDistance is 100 and this property is 0.5, then horizontal view distance will be 100 and vertical view distance will be 50.
This property has limitations: it is only implemented on VoxelLodTerrain when using VoxelLodTerrain.StreamingSystemEnum.Clipbox, and applies only to the last LOD, like view distance.
Methods14
GetNetworkPeerIdint
public int GetNetworkPeerId();intGetViewDistanceuint
public uint GetViewDistance();uintGetViewDistanceVerticalRatiofloat
public float GetViewDistanceVerticalRatio();floatIsEnabledInEditorbool
public bool IsEnabledInEditor();boolIsRequiringCollisionsbool
public bool IsRequiringCollisions();boolIsRequiringDataBlockNotificationsbool
public bool IsRequiringDataBlockNotifications();boolIsRequiringVisualsbool
public bool IsRequiringVisuals();boolSetEnabledInEditorvoid
public void SetEnabledInEditor(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetNetworkPeerIdvoid
public void SetNetworkPeerId(int id);| Name | Type | Default |
|---|---|---|
id | int | — |
SetRequiresCollisionsvoid
public void SetRequiresCollisions(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetRequiresDataBlockNotificationsvoid
public void SetRequiresDataBlockNotifications(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetRequiresVisualsvoid
public void SetRequiresVisuals(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetViewDistancevoid
public void SetViewDistance(uint distance);| Name | Type | Default |
|---|---|---|
distance | uint | — |
SetViewDistanceVerticalRatiovoid
public void SetViewDistanceVerticalRatio(float ratio);| Name | Type | Default |
|---|---|---|
ratio | float | — |