Skip to content

Conversation

@BitCakeStudio
Copy link

No description provided.

Copy link
Contributor

@vamolessa vamolessa left a 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!

}


private Vector3 GetDriverPosition(Transform transform)
Copy link
Contributor

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?

Copy link
Author

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.

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,
Copy link
Contributor

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));
Copy link
Contributor

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;
Copy link
Contributor

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

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));
Copy link
Contributor

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);
}
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants