diff --git a/assignment-client/src/voxels/VoxelScriptingInterface.cpp b/assignment-client/src/voxels/VoxelScriptingInterface.cpp index 8c31d0b5f8..3f4df78baf 100644 --- a/assignment-client/src/voxels/VoxelScriptingInterface.cpp +++ b/assignment-client/src/voxels/VoxelScriptingInterface.cpp @@ -28,3 +28,11 @@ void VoxelScriptingInterface::queueDestructiveVoxelAdd(float x, float y, float z // queue the destructive add queueVoxelAdd(PACKET_TYPE_SET_VOXEL_DESTRUCTIVE, addVoxelDetail); } + +void VoxelScriptingInterface::queueVoxelDelete(float x, float y, float z, float scale) { + + // setup a VoxelDetail struct with data + VoxelDetail deleteVoxelDetail = {x, y, z, scale, 0, 0, 0}; + + _voxelPacketSender.sendVoxelEditMessage(PACKET_TYPE_ERASE_VOXEL, deleteVoxelDetail); +} diff --git a/assignment-client/src/voxels/VoxelScriptingInterface.h b/assignment-client/src/voxels/VoxelScriptingInterface.h index 6ac2cd6bfe..ac1de6928d 100644 --- a/assignment-client/src/voxels/VoxelScriptingInterface.h +++ b/assignment-client/src/voxels/VoxelScriptingInterface.h @@ -38,6 +38,13 @@ public slots: /// \param green the G value for RGB color of voxel /// \param blue the B value for RGB color of voxel void queueDestructiveVoxelAdd(float x, float y, float z, float scale, uchar red, uchar green, uchar blue); + + /// queues the deletion of a voxel, sent by calling process on the PacketSender + /// \param x the x-coordinate of the voxel (in VS space) + /// \param y the y-coordinate of the voxel (in VS space) + /// \param z the z-coordinate of the voxel (in VS space) + /// \param scale the scale of the voxel (in VS space) + void queueVoxelDelete(float x, float y, float z, float scale); private: /// attached VoxelEditPacketSender that handles queuing and sending of packets to VS VoxelEditPacketSender _voxelPacketSender;