mirror of
				https://github.com/HandmadeMath/HandmadeMath.git
				synced 2025-10-26 12:26:59 +00:00 
			
		
		
		
	Quaternion add and sub ops are not SSEd
This commit is contained in:
		| @@ -1357,11 +1357,14 @@ HMM_INLINE hmm_quaternion HMM_AddQuaternion(hmm_quaternion Left, hmm_quaternion | |||||||
| { | { | ||||||
|     hmm_quaternion Result; |     hmm_quaternion Result; | ||||||
|  |  | ||||||
|  | #if HANDMADE_MATH__USE_SSE         | ||||||
|  |     Result.InternalElementsSSE = _mm_add_ps(Left.InternalElementsSSE, Right.InternalElementsSSE);         | ||||||
|  | #else          | ||||||
|     Result.X = Left.X + Right.X; |     Result.X = Left.X + Right.X; | ||||||
|     Result.Y = Left.Y + Right.Y; |     Result.Y = Left.Y + Right.Y; | ||||||
|     Result.Z = Left.Z + Right.Z; |     Result.Z = Left.Z + Right.Z; | ||||||
|     Result.W = Left.W + Right.W; |     Result.W = Left.W + Right.W; | ||||||
|  | #endif | ||||||
|     return (Result); |     return (Result); | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -1369,10 +1372,14 @@ HMM_INLINE hmm_quaternion HMM_SubtractQuaternion(hmm_quaternion Left, hmm_quater | |||||||
| { | { | ||||||
|     hmm_quaternion Result; |     hmm_quaternion Result; | ||||||
|  |  | ||||||
|  | #if HANDMADE_MATH__USE_SSE | ||||||
|  |     Result.InternalElementsSSE = _mm_sub_ps(Left.InternalElementsSSE, Right.InternalElementsSSE); | ||||||
|  | #else | ||||||
|     Result.X = Left.X - Right.X; |     Result.X = Left.X - Right.X; | ||||||
|     Result.Y = Left.Y - Right.Y; |     Result.Y = Left.Y - Right.Y; | ||||||
|     Result.Z = Left.Z - Right.Z; |     Result.Z = Left.Z - Right.Z; | ||||||
|     Result.W = Left.W - Right.W; |     Result.W = Left.W - Right.W; | ||||||
|  | #endif | ||||||
|          |          | ||||||
|     return (Result); |     return (Result); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 strangezak
					strangezak