mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
remove voxel drumming from C++
This commit is contained in:
parent
59eefa314c
commit
372561195a
4 changed files with 1 additions and 40 deletions
|
@ -272,7 +272,6 @@ Menu::Menu() :
|
|||
SLOT(setFilter(bool)));
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHands, 0, true);
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::VoxelDrumming, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::PlaySlaps, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandsCollideWithSelf, 0, false);
|
||||
|
||||
|
|
|
@ -280,7 +280,6 @@ namespace MenuOption {
|
|||
const QString TransmitterDrive = "Transmitter Drive";
|
||||
const QString Quit = "Quit";
|
||||
const QString Voxels = "Voxels";
|
||||
const QString VoxelDrumming = "Voxel Drumming";
|
||||
const QString VoxelMode = "Cycle Voxel Mode";
|
||||
const QString VoxelStats = "Voxel Stats";
|
||||
const QString VoxelTextures = "Voxel Textures";
|
||||
|
|
|
@ -52,43 +52,6 @@ void Hand::simulate(float deltaTime, bool isMine) {
|
|||
// Iterate hand controllers, take actions as needed
|
||||
for (size_t i = 0; i < getNumPalms(); ++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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ glm::vec3 VoxelsScriptingInterface::getFaceVector(const QString& face) {
|
|||
VoxelDetail VoxelsScriptingInterface::getVoxelEnclosingPoint(const glm::vec3& point) {
|
||||
VoxelDetail result = { 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0 };
|
||||
if (_tree) {
|
||||
OctreeElement* element = _tree->getElementEnclosingPoint(point);
|
||||
OctreeElement* element = _tree->getElementEnclosingPoint(point / (float)TREE_SCALE);
|
||||
if (element) {
|
||||
VoxelTreeElement* voxel = static_cast<VoxelTreeElement*>(element);
|
||||
result.x = voxel->getCorner().x;
|
||||
|
|
Loading…
Reference in a new issue