Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shot explorer new shots #1992

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed character 1/3 rotation
Vlad Stepura committed Apr 15, 2020
commit 2ab2c45d2b440fcb8635d4f27a84f4bf198f750c
100 changes: 47 additions & 53 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/js/shot-explorer/ShotsRule/RulesGenerator.js
Original file line number Diff line number Diff line change
@@ -45,10 +45,12 @@ const generateRule = (focusedCenter, character, shot, camera, skinnedMesh, chara
if(i < 10) {
results.push(new RollRule(focusedCenter, camera))
}
if(i < 70) {
let headQuaternion = headBone.worldQuaternion()
if(i < 80) {
let headQuaternion = new THREE.Quaternion()
headBone.getWorldQuaternion(headQuaternion)
headQuaternion.premultiply(character.quaternion.clone())
let rotation = new THREE.Euler().setFromQuaternion(headQuaternion)
let characterRotation = rotation.y * THREE.Math.RAD2DEG
let characterRotation = character.rotation.y * THREE.Math.RAD2DEG
let cameraRotation = shot.cameraRotation ? shot.cameraRotation * THREE.Math.RAD2DEG : 0
let characterFacingRotation = cameraRotation - (characterRotation)
characterFacingRotation = clamRotationTo(characterFacingRotation)