Game Engine Architecture
179 The benefi ts of the axis+angle representation are that it is reasonably intu- itive and also compact (only requires four fl ...
180 4. 3D Math for Games 4.5.6. Dual Quaternions Complete transformations involving rotation, translation, and scale can be repr ...
181 If we subtract the number of constraints from the number of fl oating-point parameters, we arrive at the number of degrees o ...
182 4. 3D Math for Games x z y C r Figure 4.27. Point-radius representation of a sphere. A ray is a line that extends to infi ni ...
183 nicely into a four-element vector, [ Cx Cy Cz r ]. As we’ll see below when we dis- cuss SIMD vector processing, there are di ...
184 4. 3D Math for Games We won’t derive or prove this result any further here, but a thorough explana- tion of why this litt le ...
4.7. Hardware-Accelerated SIMD Math 185 One convenient representation of a frustum is as an array of six planes, each of which i ...
186 4. 3D Math for Games a single 128-bit register; four operations such as additions or multiplications are performed in parall ...
4.7. Hardware-Accelerated SIMD Math 187 vector calculations without incurring a transfer cost. Scalars are represented by duplic ...
188 4. 3D Math for Games __m128 addWithAssembly( __m128 a, __m128 b) { __m128 r; __asm { movaps xmm0, xmmword ptr [a] movaps xmm ...
189 // test the two functions __m128 c = addWithAssembly(a, b); __m128 d = addWithIntrinsics(a, b); // store the original values ...
190 4. 3D Math for Games __m128 mulVectorMatrixAttempt1(__m128 v, __m128 Mcol1, __m128 Mcol2, __m128 Mcol3, __m128 Mcol4) { __m1 ...
191 #define _mm_replicate_x_ps(v) \ _mm_shuffle_ps((v), (v), SHUFFLE_PARAM(0, 0, 0, 0)) #define _mm_replicate_y_ps(v) \ _mm_shuf ...
192 4. 3D Math for Games On some CPUs, the code shown above can be optimized even further by using a rather handy multiply-and-a ...
193 ever, your mileage may vary, so don’t count on rand() being based on any particular algorithm. If you want to be sure, you’l ...
194 4. 3D Math for Games rithm that is much simpler to implement and runs faster than the Mersenne Twister algorithm. He claimed ...
Part II Low-Level Engine Systems ...
...
5 Engine Support Systems E very game engine requires some low-level support systems that manage mundane but crucial tasks, such ...
198 5. Engine Support Systems 5.1.1. C++ Static Initialization Order (or Lack Thereof) Since the programming language used in mo ...
«
6
7
8
9
10
11
12
13
14
15
»
Free download pdf