Passage de la 2D à la 3D pour la fonction cosAngle dans vertex.
This commit is contained in:
parent
3f4674803e
commit
ee6918a0b7
|
@ -36,7 +36,7 @@ Vertex Vertex::setNorm(float n) const {
|
||||||
|
|
||||||
float Vertex::cosAngle(Vertex v) const {
|
float Vertex::cosAngle(Vertex v) const {
|
||||||
// http://www.developpez.net/forums/d202580/applications/developpement-2d-3d-jeux/contribuez/faq-mat-quat-ajout-calculs-vectoriels/
|
// http://www.developpez.net/forums/d202580/applications/developpement-2d-3d-jeux/contribuez/faq-mat-quat-ajout-calculs-vectoriels/
|
||||||
return ((this->x*v.x + this->y*v.y) / (norm()*v.norm()));
|
return ((this->x*v.x + this->y*v.y + this->z*v.z) / (norm()*v.norm()));
|
||||||
}
|
}
|
||||||
|
|
||||||
float Vertex::angle(Vertex v) const {
|
float Vertex::angle(Vertex v) const {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user