[go: nahoru, domu]

Skip to content

Commit

Permalink
Update SCNVector3Extensions.swift
Browse files Browse the repository at this point in the history
Fixed bug in cross product calculation
  • Loading branch information
devindazzle committed Jun 14, 2014
1 parent bd8db0b commit 212a4cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SCNVector3Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ extension SCNVector3
* Calculates the cross product between two SCNVector3.
*/
func cross(vector: SCNVector3) -> SCNVector3 {
return SCNVector3Make(y * vector.z - z * vector.y, z * vector.x - x * vector.y, x * vector.y - y * vector.x)
return SCNVector3Make(y * vector.z - z * vector.y, z * vector.x - x * vector.z, x * vector.y - y * vector.x)
}
}

Expand Down Expand Up @@ -212,7 +212,7 @@ func SCNVector3DotProduct(left: SCNVector3, right: SCNVector3) -> Float {
* Calculates the cross product between two SCNVector3 vectors
*/
func SCNVector3CrossProduct(left: SCNVector3, right: SCNVector3) -> SCNVector3 {
return SCNVector3Make(left.y * right.z - left.z * right.y, left.z * right.x - left.x * right.y, left.x * right.y - left.y * right.x)
return SCNVector3Make(left.y * right.z - left.z * right.y, left.z * right.x - left.x * right.z, left.x * right.y - left.y * right.x)
}

/**
Expand Down

0 comments on commit 212a4cc

Please sign in to comment.