History

use radians instead of degrees (almost) everywhere

Andrew Meadows committed 12 years ago

Commit aa8c2fc1 parent de8165c51 files · +302 −306Browse files

Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 51 files). Show all

Unified · Split

interface/src/avatar/SkeletonModel.cpp+4−3
@@ -24,7 +24,7 @@ void SkeletonModel::simulate(float deltaTime, bool delayLoad) { · 23 unmodified lines
2424 return;
2525 }
2626 setTranslation(_owningAvatar->getPosition());
27− setRotation(_owningAvatar->getOrientation() * glm::angleAxis(180.0f, glm::vec3(0.0f, 1.0f, 0.0f)));
27+ setRotation(_owningAvatar->getOrientation() * glm::angleAxis(PI, glm::vec3(0.0f, 1.0f, 0.0f)));
2828 const float MODEL_SCALE = 0.0006f;
2929 setScale(glm::vec3(1.0f, 1.0f, 1.0f) * _owningAvatar->getScale() * MODEL_SCALE);
3030
@@ -199,8 +199,9 @@ void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, const · 168 unmodified lines
199199 glm::mat3 axes = glm::mat3_cast(_rotation);
200200 glm::mat3 inverse = glm::mat3(glm::inverse(parentState.transform * glm::translate(state.translation) *
201201 joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation)));
202− state.rotation = glm::angleAxis(-_owningAvatar->getHead()->getLeanSideways(), glm::normalize(inverse * axes[2])) *
203− glm::angleAxis(-_owningAvatar->getHead()->getLeanForward(), glm::normalize(inverse * axes[0])) * joint.rotation;
202+ state.rotation = glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getLeanSideways(),
203+ glm::normalize(inverse * axes[2])) * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getLeanForward(),
204+ glm::normalize(inverse * axes[0])) * joint.rotation;
204205 }
205206
206207 void SkeletonModel::stretchArm(int jointIndex, const glm::vec3& position) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t