remove voxel drumming from C++

This commit is contained in:
ZappoMan 2014-03-03 04:00:06 -08:00
parent 59eefa314c
commit 372561195a
4 changed files with 1 additions and 40 deletions

View file

@ -272,7 +272,6 @@ Menu::Menu() :
SLOT(setFilter(bool))); SLOT(setFilter(bool)));
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHands, 0, true); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHands, 0, true);
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false);
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::VoxelDrumming, 0, false);
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::PlaySlaps, 0, false); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::PlaySlaps, 0, false);
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandsCollideWithSelf, 0, false); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandsCollideWithSelf, 0, false);

View file

@ -280,7 +280,6 @@ namespace MenuOption {
const QString TransmitterDrive = "Transmitter Drive"; const QString TransmitterDrive = "Transmitter Drive";
const QString Quit = "Quit"; const QString Quit = "Quit";
const QString Voxels = "Voxels"; const QString Voxels = "Voxels";
const QString VoxelDrumming = "Voxel Drumming";
const QString VoxelMode = "Cycle Voxel Mode"; const QString VoxelMode = "Cycle Voxel Mode";
const QString VoxelStats = "Voxel Stats"; const QString VoxelStats = "Voxel Stats";
const QString VoxelTextures = "Voxel Textures"; const QString VoxelTextures = "Voxel Textures";

View file

@ -52,43 +52,6 @@ void Hand::simulate(float deltaTime, bool isMine) {
// Iterate hand controllers, take actions as needed // Iterate hand controllers, take actions as needed
for (size_t i = 0; i < getNumPalms(); ++i) { for (size_t i = 0; i < getNumPalms(); ++i) {
PalmData& palm = getPalms()[i]; PalmData& palm = getPalms()[i];
if (palm.isActive()) {
FingerData& finger = palm.getFingers()[0]; // Sixense has only one finger
glm::vec3 fingerTipPosition = finger.getTipPosition();
// Voxel Drumming with fingertips if enabled
if (Menu::getInstance()->isOptionChecked(MenuOption::VoxelDrumming)) {
OctreeElement* fingerElement = Application::getInstance()->getVoxelTree()->getElementEnclosingPoint(
glm::vec3(fingerTipPosition / (float)TREE_SCALE));
VoxelTreeElement* fingerVoxel = static_cast<VoxelTreeElement*>(fingerElement);
if (fingerVoxel) {
if (!palm.getIsCollidingWithVoxel()) {
// Collision has just started
palm.setIsCollidingWithVoxel(true);
handleVoxelCollision(&palm, fingerTipPosition, fingerVoxel, deltaTime);
// Set highlight voxel
VoxelDetail voxel;
glm::vec3 pos = fingerVoxel->getCorner();
voxel.x = pos.x;
voxel.y = pos.y;
voxel.z = pos.z;
voxel.s = fingerVoxel->getScale();
voxel.red = fingerVoxel->getColor()[0];
voxel.green = fingerVoxel->getColor()[1];
voxel.blue = fingerVoxel->getColor()[2];
Application::getInstance()->setHighlightVoxel(voxel);
Application::getInstance()->setIsHighlightVoxel(true);
}
} else {
if (palm.getIsCollidingWithVoxel()) {
// Collision has just ended
palm.setIsCollidingWithVoxel(false);
Application::getInstance()->setIsHighlightVoxel(false);
}
}
}
}
palm.setLastControllerButtons(palm.getControllerButtons()); palm.setLastControllerButtons(palm.getControllerButtons());
} }
} }

View file

@ -121,7 +121,7 @@ glm::vec3 VoxelsScriptingInterface::getFaceVector(const QString& face) {
VoxelDetail VoxelsScriptingInterface::getVoxelEnclosingPoint(const glm::vec3& point) { VoxelDetail VoxelsScriptingInterface::getVoxelEnclosingPoint(const glm::vec3& point) {
VoxelDetail result = { 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0 }; VoxelDetail result = { 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0 };
if (_tree) { if (_tree) {
OctreeElement* element = _tree->getElementEnclosingPoint(point); OctreeElement* element = _tree->getElementEnclosingPoint(point / (float)TREE_SCALE);
if (element) { if (element) {
VoxelTreeElement* voxel = static_cast<VoxelTreeElement*>(element); VoxelTreeElement* voxel = static_cast<VoxelTreeElement*>(element);
result.x = voxel->getCorner().x; result.x = voxel->getCorner().x;