crossVectors method

Vector3 crossVectors(
  1. Vector3 a,
  2. Vector3 b
)

Computes the cross product of the two given 3D vectors and stores the result in this 3D vector.

Implementation

Vector3 crossVectors(Vector3 a, Vector3 b ) {
	final ax = a.x, ay = a.y, az = a.z;
	final bx = b.x, by = b.y, bz = b.z;

	x = ( ay * bz ) - ( az * by );
	y = ( az * bx ) - ( ax * bz );
	z = ( ax * by ) - ( ay * bx );

	return this;
}