History

Working on adding an "add voxel in front of avatar" command.

Andrzej Kapolka committed 13 years ago

Commit c4110831 parent 145c6481 file · +16 −7Browse files

Showing the changes to interface/src/main.cpp (1 of 1 file). Show all

Unified · Split

interface/src/main.cpp+16−7
@@ -1487,6 +1487,20 @@ void setupPaintingVoxel() { · 1486 unmodified lines
14871487 shiftPaintingColor();
14881488 }
14891489
1490+void addVoxel(VoxelDetail& detail) {
1491+ unsigned char* bufferOut;
1492+ int sizeOut;
1493+
1494+ if (createVoxelEditMessage(PACKET_HEADER_SET_VOXEL, 0, 1, &detail, bufferOut, sizeOut)){
1495+ AgentList::getInstance()->broadcastToAgents(bufferOut, sizeOut, &AGENT_TYPE_VOXEL, 1);
1496+ delete bufferOut;
1497+ }
1498+}
1499+
1500+void addVoxelInFrontOfAvatar() {
1501+
1502+}
1503+
14901504 void addVoxelUnderCursor() {
14911505 glm::vec3 origin, direction;
14921506 viewFrustum.computePickRay(mouseX / (float)WIDTH, mouseY / (float)HEIGHT, origin, direction);
@@ -1521,13 +1535,7 @@ void addVoxelUnderCursor() { · 28 unmodified lines
15211535 detail.z += detail.s;
15221536 break;
15231537 }
1524− unsigned char* bufferOut;
1525− int sizeOut;
1526−
1527− if (createVoxelEditMessage(PACKET_HEADER_SET_VOXEL, 0, 1, &detail, bufferOut, sizeOut)){
1528− AgentList::getInstance()->broadcastToAgents(bufferOut, sizeOut, &AGENT_TYPE_VOXEL, 1);
1529− delete bufferOut;
1530− }
1538+ addVoxel(detail);
15311539 }
15321540 }
15331541
@@ -1668,6 +1676,7 @@ void key(unsigned char k, int x, int y) { · 134 unmodified lines
16681676 if (k == '%') ::sendVoxelServerAddScene(); // sends add scene command to voxel server
16691677 if (k == '1') ::mouseMode = ADD_VOXELS;
16701678 if (k == '2') ::mouseMode = DELETE_VOXELS;
1679+ if (k == '3') addVoxelInFrontOfAvatar();
16711680 if (k == 'n' || k == 'N')
16721681 {
16731682 noiseOn = !noiseOn; // Toggle noise