Showing the changes to interface/src/ControllerScriptingInterface.cpp (1 of 11 files). Show all
Unified · Split
| @@ -172,6 +172,21 @@ glm::vec3 ControllerScriptingInterface::getSpatialControlVelocity(int controlInd · 171 unmodified lines | ||
| 172 | 172 | return glm::vec3(0); // bad index |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | +glm::quat ControllerScriptingInterface::getSpatialControlRawRotation(int controlIndex) const { | |
| 176 | + int palmIndex = controlIndex / NUMBER_OF_SPATIALCONTROLS_PER_PALM; | |
| 177 | + int controlOfPalm = controlIndex % NUMBER_OF_SPATIALCONTROLS_PER_PALM; | |
| 178 | + const PalmData* palmData = getActivePalm(palmIndex); | |
| 179 | + if (palmData) { | |
| 180 | + switch (controlOfPalm) { | |
| 181 | + case PALM_SPATIALCONTROL: | |
| 182 | + return palmData->getRawRotation(); | |
| 183 | + case TIP_SPATIALCONTROL: | |
| 184 | + return palmData->getRawRotation(); // currently the tip doesn't have a unique rotation, use the palm rotation | |
| 185 | + } | |
| 186 | + } | |
| 187 | + return glm::quat(); // bad index | |
| 188 | +} | |
| 189 | + | |
| 175 | 190 | glm::vec3 ControllerScriptingInterface::getSpatialControlNormal(int controlIndex) const { |
| 176 | 191 | int palmIndex = controlIndex / NUMBER_OF_SPATIALCONTROLS_PER_PALM; |
| 177 | 192 | int controlOfPalm = controlIndex % NUMBER_OF_SPATIALCONTROLS_PER_PALM; |