-
Notifications
You must be signed in to change notification settings - Fork 18
Shape key driver #28
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
base: master
Are you sure you want to change the base?
Shape key driver #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pediu review, agora tem review!
Assets/Editor/Animation/ShapeKeyDriver/ShapeKeyPositionConfigDrawer.cs
Outdated
Show resolved
Hide resolved
Assets/Editor/Animation/ShapeKeyDriver/ShapeKeyPositionConfigDrawer.cs
Outdated
Show resolved
Hide resolved
Assets/Editor/Animation/ShapeKeyDriver/ShapeKeyPositionConfigDrawer.cs
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
|
|
||
| private Vector3 GetDriverPosition(Transform transform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
precisa dessa função já que ela quase só retorna o argumento dela?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, eu acho que fica mais organizadinho dessa forma, vou manter assim pra ficar menos doidera.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fiz tudo ficar inline, esquece o comentário desse maluco aí!
| var currentPosition = posConf.GetTargetOneAxisPosition(); | ||
| var percentage = Mathf.InverseLerp(posConf.oneAxisStartPosition, | ||
| posConf.oneAxisEndPosition, currentPosition); | ||
| var interpolation = Mathf.Lerp(0, 100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aqui também pode ser só 100.0f * ... ao inves do Lerp todo
|
|
||
| var percentageMedian = (percentageX + percentageY) / 2; | ||
|
|
||
| var interpolation = Mathf.Lerp(0, 100, posConf.interpolationCurve.Evaluate(percentageMedian)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100.0f * ...
| var percentageZ = Mathf.InverseLerp(posConf.threeAxisStartPosition.z, | ||
| posConf.threeAxisEndPosition.z, currentPosition.z); | ||
|
|
||
| var percentageMedian = (percentageX + percentageY + percentageZ) / 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ 3.0f
o nome da variavel poderia ser percentageMean já que median significa outra coisa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Era Mean mudei pra Median, eu achei que era a correta, tudo bem.
|
|
||
| var percentageMedian = (percentageX + percentageY + percentageZ) / 3; | ||
|
|
||
| var interpolation = Mathf.Lerp(0, 100, posConf.interpolationCurve.Evaluate(percentageMedian)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100.0f * ...
na real, esses 100.0f * interpolation poderiam ficar no Update() segundo a sugestão de cima.
que aí concentra todas as transformações do interpolation em apenas um lugar
| Vector3 AB = b - a; | ||
| Vector3 AV = value - a; | ||
| return Vector3.Dot(AV, AB) / Vector3.Dot(AB, AB); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
essa função é usada em algum lugar?
porque aí é melhor deletá-la caso contrário
e também isso pode retornar valores inesperados caso os vetores estejam apontando em direções diferentes
isso é: essa função retorna valores entre -1.0f e 1.0f ao inves de um inverse lerp normal que retorna entre 0.0f e 1.0f
no mais, se realmente estiver sendo usada, essa função poderia ir pro VectorHelper que tenho quase certeza que existe na bitstrap
No description provided.