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
1487 shiftPaintingColor();1487 shiftPaintingColor();
1488}1488}
1489 1489
1490void 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
1500void addVoxelInFrontOfAvatar() {
1501
1502}
1503
1490void addVoxelUnderCursor() {1504void addVoxelUnderCursor() {
1491 glm::vec3 origin, direction;1505 glm::vec3 origin, direction;
1492 viewFrustum.computePickRay(mouseX / (float)WIDTH, mouseY / (float)HEIGHT, origin, direction);1506 viewFrustum.computePickRay(mouseX / (float)WIDTH, mouseY / (float)HEIGHT, origin, direction);
@@ -1521,13 +1535,7 @@ void addVoxelUnderCursor() { · 28 unmodified lines
1521 detail.z += detail.s;1535 detail.z += detail.s;
1522 break;1536 break;
1523 }1537 }
1524 unsigned char* bufferOut;1538 addVoxel(detail);
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 }
1531 }1539 }
1532}1540}
1533 1541
@@ -1668,6 +1676,7 @@ void key(unsigned char k, int x, int y) { · 134 unmodified lines
1668 if (k == '%') ::sendVoxelServerAddScene(); // sends add scene command to voxel server1676 if (k == '%') ::sendVoxelServerAddScene(); // sends add scene command to voxel server
1669 if (k == '1') ::mouseMode = ADD_VOXELS;1677 if (k == '1') ::mouseMode = ADD_VOXELS;
1670 if (k == '2') ::mouseMode = DELETE_VOXELS;1678 if (k == '2') ::mouseMode = DELETE_VOXELS;
1679 if (k == '3') addVoxelInFrontOfAvatar();
1671 if (k == 'n' || k == 'N') 1680 if (k == 'n' || k == 'N')
1672 {1681 {
1673 noiseOn = !noiseOn; // Toggle noise 1682 noiseOn = !noiseOn; // Toggle noise