Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 5 files). Show all
Unified · Split
| @@ -208,6 +208,21 @@ glm::quat ControllerScriptingInterface::getSpatialControlRawRotation(int control · 207 unmodified lines | |||
| 208 | } | 208 | } |
| 209 | return glm::quat(); // bad index | 209 | return glm::quat(); // bad index |
| 210 | } | 210 | } |
| 211 | |||
| 212 | glm::vec3 ControllerScriptingInterface::getSpatialControlRawAngularVelocity(int controlIndex) const { | ||
| 213 | int palmIndex = controlIndex / NUMBER_OF_SPATIALCONTROLS_PER_PALM; | ||
| 214 | int controlOfPalm = controlIndex % NUMBER_OF_SPATIALCONTROLS_PER_PALM; | ||
| 215 | const PalmData* palmData = getActivePalm(palmIndex); | ||
| 216 | if (palmData) { | ||
| 217 | switch (controlOfPalm) { | ||
| 218 | case PALM_SPATIALCONTROL: | ||
| 219 | return palmData->getRawAngularVelocity(); | ||
| 220 | case TIP_SPATIALCONTROL: | ||
| 221 | return palmData->getRawAngularVelocity(); // Tip = palm angular velocity | ||
| 222 | } | ||
| 223 | } | ||
| 224 | return glm::vec3(0); // bad index | ||
| 225 | } | ||
| 211 | 226 | ||
| 212 | glm::vec3 ControllerScriptingInterface::getSpatialControlNormal(int controlIndex) const { | 227 | glm::vec3 ControllerScriptingInterface::getSpatialControlNormal(int controlIndex) const { |
| 213 | int palmIndex = controlIndex / NUMBER_OF_SPATIALCONTROLS_PER_PALM; | 228 | int palmIndex = controlIndex / NUMBER_OF_SPATIALCONTROLS_PER_PALM; |