TerrainService

Server interface to the terrain system

Summary
TerrainServiceServer interface to the terrain system
Functions
NKAssignToCellAssigns a game object to the cell it is currently in.
NKRemoveFromCellRemoves a game object from whatever cell it is currently assigned to.
NKUpdateCellAssignmentUpdates a game object’s cell assignment, removing it from a previous cell if it was in one and assigning it to the appropriate cell for its current position.
NKModifyWorldRequests a voxel modification to the terrain system
SVoxelModifiedHelper struct that contains data returned from a voxel that has been modified
Functions
NKGetPositionGets the world position of the voxel that was modified
NKGetPreviousMaterialGets the previous material of this voxel prior to modification
NKGetNewMaterialGets the new material of this voxel since modification

Functions

NKAssignToCell

Assigns a game object to the cell it is currently in.

Parameters

GameObjectThe game object to assign to a cell.

NKRemoveFromCell

Removes a game object from whatever cell it is currently assigned to.

Parameters

GameObjectThe game object whose cell assignment should be removed.

NKUpdateCellAssignment

Updates a game object’s cell assignment, removing it from a previous cell if it was in one and assigning it to the appropriate cell for its current position.

Parameters

GameObject- The game object whose cell assignment should be updated.

NKModifyWorld

Requests a voxel modification to the terrain system

Parameters

Tablea LUA table defining the items to be dropped in the following format
EVoxelOperation   modificationType - type used to determine what operation should occur (add, remove, swap, etc)
int               materialID       -  material id to be added or swapped. Removal operations don't use this value
vec3              position         - real world position of the modification
vec3              dimensions       - height, width and length of the modification brush dimensions. Used for square brush types
float             radius           - radius of the sphere brush type
EVoxelBrushShapes brushType        - type of the brush
WorldPlayer       player           -  that made the modification
uint64_t          userdata1        - The object which made the modification. Gets passed back down to Lua with the modification callback so we can perform appropriate actions on the object based off the results.

SVoxelModified

Helper struct that contains data returned from a voxel that has been modified

Summary
Functions
NKGetPositionGets the world position of the voxel that was modified
NKGetPreviousMaterialGets the previous material of this voxel prior to modification
NKGetNewMaterialGets the new material of this voxel since modification

Functions

NKGetPosition

Gets the world position of the voxel that was modified

Returns

vec3real world position of the voxel that was modified

NKGetPreviousMaterial

Gets the previous material of this voxel prior to modification

Returns

intthe material ID of the previous material of the voxel

NKGetNewMaterial

Gets the new material of this voxel since modification

Returns

intthe material ID of the new material of the voxel
Close