ruby-bullet 0.1.0-x86-linux → 0.1.1-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (284) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +3 -0
  3. data/Rakefile +14 -2
  4. data/bindings/bullet/interface/BulletCollision/CollisionDispatch/btCollisionWorld.i +2 -2
  5. data/bindings/bullet/interface/bullet_wrap.cpp +17548 -6035
  6. data/bindings/bullet/interface/bullet_wrap.h +7 -7
  7. data/bindings/bullet/interface/bullet_wrap.o +0 -0
  8. data/lib/bullet.so +0 -0
  9. data/lib/ruby-bullet/version.rb +1 -1
  10. data/ruby-bullet.gemspec +0 -3
  11. metadata +169 -444
  12. data/deps/include/bullet/Bullet-C-Api.h +0 -176
  13. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btAxisSweep3.h +0 -1051
  14. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h +0 -82
  15. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h +0 -270
  16. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h +0 -80
  17. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btDbvt.h +0 -1257
  18. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h +0 -146
  19. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btDispatcher.h +0 -110
  20. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h +0 -151
  21. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h +0 -469
  22. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h +0 -40
  23. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.h +0 -579
  24. data/deps/include/bullet/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h +0 -171
  25. data/deps/include/bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.h +0 -51
  26. data/deps/include/bullet/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h +0 -36
  27. data/deps/include/bullet/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h +0 -66
  28. data/deps/include/bullet/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h +0 -66
  29. data/deps/include/bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.h +0 -44
  30. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionConfiguration.h +0 -48
  31. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h +0 -45
  32. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.h +0 -172
  33. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionObject.h +0 -524
  34. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h +0 -509
  35. data/deps/include/bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h +0 -86
  36. data/deps/include/bullet/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h +0 -95
  37. data/deps/include/bullet/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h +0 -116
  38. data/deps/include/bullet/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h +0 -109
  39. data/deps/include/bullet/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h +0 -84
  40. data/deps/include/bullet/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h +0 -137
  41. data/deps/include/bullet/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h +0 -54
  42. data/deps/include/bullet/BulletCollision/CollisionDispatch/btGhostObject.h +0 -175
  43. data/deps/include/bullet/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h +0 -46
  44. data/deps/include/bullet/BulletCollision/CollisionDispatch/btManifoldResult.h +0 -128
  45. data/deps/include/bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.h +0 -81
  46. data/deps/include/bullet/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h +0 -75
  47. data/deps/include/bullet/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h +0 -66
  48. data/deps/include/bullet/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h +0 -69
  49. data/deps/include/bullet/BulletCollision/CollisionDispatch/btUnionFind.h +0 -129
  50. data/deps/include/bullet/BulletCollision/CollisionShapes/btBox2dShape.h +0 -369
  51. data/deps/include/bullet/BulletCollision/CollisionShapes/btBoxShape.h +0 -312
  52. data/deps/include/bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h +0 -139
  53. data/deps/include/bullet/BulletCollision/CollisionShapes/btCapsuleShape.h +0 -173
  54. data/deps/include/bullet/BulletCollision/CollisionShapes/btCollisionMargin.h +0 -27
  55. data/deps/include/bullet/BulletCollision/CollisionShapes/btCollisionShape.h +0 -150
  56. data/deps/include/bullet/BulletCollision/CollisionShapes/btCompoundShape.h +0 -212
  57. data/deps/include/bullet/BulletCollision/CollisionShapes/btConcaveShape.h +0 -60
  58. data/deps/include/bullet/BulletCollision/CollisionShapes/btConeShape.h +0 -103
  59. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvex2dShape.h +0 -80
  60. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexHullShape.h +0 -122
  61. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexInternalShape.h +0 -224
  62. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexPointCloudShape.h +0 -105
  63. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexPolyhedron.h +0 -62
  64. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexShape.h +0 -84
  65. data/deps/include/bullet/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h +0 -75
  66. data/deps/include/bullet/BulletCollision/CollisionShapes/btCylinderShape.h +0 -200
  67. data/deps/include/bullet/BulletCollision/CollisionShapes/btEmptyShape.h +0 -70
  68. data/deps/include/bullet/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h +0 -161
  69. data/deps/include/bullet/BulletCollision/CollisionShapes/btMaterial.h +0 -35
  70. data/deps/include/bullet/BulletCollision/CollisionShapes/btMinkowskiSumShape.h +0 -60
  71. data/deps/include/bullet/BulletCollision/CollisionShapes/btMultiSphereShape.h +0 -99
  72. data/deps/include/bullet/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h +0 -120
  73. data/deps/include/bullet/BulletCollision/CollisionShapes/btOptimizedBvh.h +0 -65
  74. data/deps/include/bullet/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h +0 -112
  75. data/deps/include/bullet/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h +0 -93
  76. data/deps/include/bullet/BulletCollision/CollisionShapes/btShapeHull.h +0 -59
  77. data/deps/include/bullet/BulletCollision/CollisionShapes/btSphereShape.h +0 -73
  78. data/deps/include/bullet/BulletCollision/CollisionShapes/btStaticPlaneShape.h +0 -103
  79. data/deps/include/bullet/BulletCollision/CollisionShapes/btStridingMeshInterface.h +0 -162
  80. data/deps/include/bullet/BulletCollision/CollisionShapes/btTetrahedronShape.h +0 -74
  81. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleBuffer.h +0 -69
  82. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleCallback.h +0 -42
  83. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h +0 -133
  84. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h +0 -84
  85. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleInfoMap.h +0 -241
  86. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleMesh.h +0 -69
  87. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleMeshShape.h +0 -89
  88. data/deps/include/bullet/BulletCollision/CollisionShapes/btTriangleShape.h +0 -182
  89. data/deps/include/bullet/BulletCollision/CollisionShapes/btUniformScalingShape.h +0 -87
  90. data/deps/include/bullet/BulletCollision/Gimpact/btBoxCollision.h +0 -647
  91. data/deps/include/bullet/BulletCollision/Gimpact/btClipPolygon.h +0 -182
  92. data/deps/include/bullet/BulletCollision/Gimpact/btContactProcessing.h +0 -145
  93. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactBvh.h +0 -396
  94. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h +0 -306
  95. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactMassUtil.h +0 -60
  96. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactQuantizedBvh.h +0 -372
  97. data/deps/include/bullet/BulletCollision/Gimpact/btGImpactShape.h +0 -1171
  98. data/deps/include/bullet/BulletCollision/Gimpact/btGenericPoolAllocator.h +0 -163
  99. data/deps/include/bullet/BulletCollision/Gimpact/btGeometryOperations.h +0 -212
  100. data/deps/include/bullet/BulletCollision/Gimpact/btQuantization.h +0 -88
  101. data/deps/include/bullet/BulletCollision/Gimpact/btTriangleShapeEx.h +0 -180
  102. data/deps/include/bullet/BulletCollision/Gimpact/gim_array.h +0 -326
  103. data/deps/include/bullet/BulletCollision/Gimpact/gim_basic_geometry_operations.h +0 -543
  104. data/deps/include/bullet/BulletCollision/Gimpact/gim_bitset.h +0 -123
  105. data/deps/include/bullet/BulletCollision/Gimpact/gim_box_collision.h +0 -590
  106. data/deps/include/bullet/BulletCollision/Gimpact/gim_box_set.h +0 -674
  107. data/deps/include/bullet/BulletCollision/Gimpact/gim_clip_polygon.h +0 -210
  108. data/deps/include/bullet/BulletCollision/Gimpact/gim_contact.h +0 -164
  109. data/deps/include/bullet/BulletCollision/Gimpact/gim_geom_types.h +0 -97
  110. data/deps/include/bullet/BulletCollision/Gimpact/gim_geometry.h +0 -42
  111. data/deps/include/bullet/BulletCollision/Gimpact/gim_hash_table.h +0 -902
  112. data/deps/include/bullet/BulletCollision/Gimpact/gim_linear_math.h +0 -1573
  113. data/deps/include/bullet/BulletCollision/Gimpact/gim_math.h +0 -157
  114. data/deps/include/bullet/BulletCollision/Gimpact/gim_memory.h +0 -190
  115. data/deps/include/bullet/BulletCollision/Gimpact/gim_radixsort.h +0 -406
  116. data/deps/include/bullet/BulletCollision/Gimpact/gim_tri_collision.h +0 -379
  117. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h +0 -59
  118. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btConvexCast.h +0 -73
  119. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h +0 -42
  120. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h +0 -91
  121. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h +0 -50
  122. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h +0 -75
  123. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h +0 -43
  124. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h +0 -103
  125. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h +0 -158
  126. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h +0 -40
  127. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h +0 -228
  128. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btPointCollector.h +0 -64
  129. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.h +0 -46
  130. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h +0 -72
  131. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h +0 -63
  132. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.h +0 -50
  133. data/deps/include/bullet/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h +0 -179
  134. data/deps/include/bullet/BulletCollision/btBulletCollisionCommon.h +0 -69
  135. data/deps/include/bullet/BulletDynamics/Character/btCharacterControllerInterface.h +0 -46
  136. data/deps/include/bullet/BulletDynamics/Character/btKinematicCharacterController.h +0 -163
  137. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h +0 -346
  138. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btConstraintSolver.h +0 -52
  139. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btContactConstraint.h +0 -71
  140. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btContactSolverInfo.h +0 -87
  141. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h +0 -614
  142. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h +0 -99
  143. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btHinge2Constraint.h +0 -58
  144. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btHingeConstraint.h +0 -381
  145. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btJacobianEntry.h +0 -156
  146. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h +0 -161
  147. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h +0 -130
  148. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSliderConstraint.h +0 -333
  149. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h +0 -107
  150. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSolverBody.h +0 -191
  151. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btSolverConstraint.h +0 -98
  152. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.h +0 -452
  153. data/deps/include/bullet/BulletDynamics/ConstraintSolver/btUniversalConstraint.h +0 -62
  154. data/deps/include/bullet/BulletDynamics/Dynamics/btActionInterface.h +0 -46
  155. data/deps/include/bullet/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h +0 -203
  156. data/deps/include/bullet/BulletDynamics/Dynamics/btDynamicsWorld.h +0 -151
  157. data/deps/include/bullet/BulletDynamics/Dynamics/btRigidBody.h +0 -691
  158. data/deps/include/bullet/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h +0 -89
  159. data/deps/include/bullet/BulletDynamics/Vehicle/btRaycastVehicle.h +0 -236
  160. data/deps/include/bullet/BulletDynamics/Vehicle/btVehicleRaycaster.h +0 -35
  161. data/deps/include/bullet/BulletDynamics/Vehicle/btWheelInfo.h +0 -119
  162. data/deps/include/bullet/BulletDynamics/btBulletDynamicsCommon.h +0 -48
  163. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverBuffer_DX11.h +0 -323
  164. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverLinkData_DX11.h +0 -103
  165. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverLinkData_DX11SIMDAware.h +0 -173
  166. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverTriangleData_DX11.h +0 -96
  167. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverVertexBuffer_DX11.h +0 -107
  168. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolverVertexData_DX11.h +0 -63
  169. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11.h +0 -691
  170. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/DX11/btSoftBodySolver_DX11SIMDAware.h +0 -81
  171. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverBuffer_OpenCL.h +0 -209
  172. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverLinkData_OpenCL.h +0 -99
  173. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverLinkData_OpenCLSIMDAware.h +0 -169
  174. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverOutputCLtoGL.h +0 -62
  175. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverTriangleData_OpenCL.h +0 -84
  176. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverVertexBuffer_OpenGL.h +0 -166
  177. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolverVertexData_OpenCL.h +0 -52
  178. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCL.h +0 -527
  179. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/btSoftBodySolver_OpenCLSIMDAware.h +0 -81
  180. data/deps/include/bullet/BulletMultiThreaded/GpuSoftBodySolvers/Shared/btSoftBodySolverData.h +0 -748
  181. data/deps/include/bullet/BulletMultiThreaded/HeapManager.h +0 -117
  182. data/deps/include/bullet/BulletMultiThreaded/PlatformDefinitions.h +0 -99
  183. data/deps/include/bullet/BulletMultiThreaded/PosixThreadSupport.h +0 -142
  184. data/deps/include/bullet/BulletMultiThreaded/PpuAddressSpace.h +0 -37
  185. data/deps/include/bullet/BulletMultiThreaded/SequentialThreadSupport.h +0 -96
  186. data/deps/include/bullet/BulletMultiThreaded/SpuCollisionObjectWrapper.h +0 -40
  187. data/deps/include/bullet/BulletMultiThreaded/SpuCollisionTaskProcess.h +0 -163
  188. data/deps/include/bullet/BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h +0 -120
  189. data/deps/include/bullet/BulletMultiThreaded/SpuDoubleBuffer.h +0 -126
  190. data/deps/include/bullet/BulletMultiThreaded/SpuFakeDma.h +0 -135
  191. data/deps/include/bullet/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h +0 -72
  192. data/deps/include/bullet/BulletMultiThreaded/SpuLibspe2Support.h +0 -180
  193. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/Box.h +0 -167
  194. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuCollisionShapes.h +0 -128
  195. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuContactResult.h +0 -106
  196. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuConvexPenetrationDepthSolver.h +0 -51
  197. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h +0 -140
  198. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuLocalSupport.h +0 -19
  199. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuMinkowskiPenetrationDepthSolver.h +0 -48
  200. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuPreferredPenetrationDirections.h +0 -70
  201. data/deps/include/bullet/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/boxBoxDistance.h +0 -65
  202. data/deps/include/bullet/BulletMultiThreaded/SpuSampleTask/SpuSampleTask.h +0 -54
  203. data/deps/include/bullet/BulletMultiThreaded/SpuSampleTaskProcess.h +0 -153
  204. data/deps/include/bullet/BulletMultiThreaded/SpuSync.h +0 -149
  205. data/deps/include/bullet/BulletMultiThreaded/TrbDynBody.h +0 -79
  206. data/deps/include/bullet/BulletMultiThreaded/TrbStateVec.h +0 -339
  207. data/deps/include/bullet/BulletMultiThreaded/Win32ThreadSupport.h +0 -138
  208. data/deps/include/bullet/BulletMultiThreaded/btGpu3DGridBroadphase.h +0 -138
  209. data/deps/include/bullet/BulletMultiThreaded/btGpu3DGridBroadphaseSharedCode.h +0 -430
  210. data/deps/include/bullet/BulletMultiThreaded/btGpu3DGridBroadphaseSharedDefs.h +0 -61
  211. data/deps/include/bullet/BulletMultiThreaded/btGpu3DGridBroadphaseSharedTypes.h +0 -67
  212. data/deps/include/bullet/BulletMultiThreaded/btGpuDefines.h +0 -211
  213. data/deps/include/bullet/BulletMultiThreaded/btGpuUtilsSharedCode.h +0 -55
  214. data/deps/include/bullet/BulletMultiThreaded/btGpuUtilsSharedDefs.h +0 -52
  215. data/deps/include/bullet/BulletMultiThreaded/btParallelConstraintSolver.h +0 -285
  216. data/deps/include/bullet/BulletMultiThreaded/btThreadSupportInterface.h +0 -85
  217. data/deps/include/bullet/BulletMultiThreaded/vectormath2bullet.h +0 -73
  218. data/deps/include/bullet/BulletSoftBody/btDefaultSoftBodySolver.h +0 -63
  219. data/deps/include/bullet/BulletSoftBody/btSoftBody.h +0 -987
  220. data/deps/include/bullet/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h +0 -153
  221. data/deps/include/bullet/BulletSoftBody/btSoftBodyData.h +0 -217
  222. data/deps/include/bullet/BulletSoftBody/btSoftBodyHelpers.h +0 -143
  223. data/deps/include/bullet/BulletSoftBody/btSoftBodyInternals.h +0 -930
  224. data/deps/include/bullet/BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h +0 -48
  225. data/deps/include/bullet/BulletSoftBody/btSoftBodySolverVertexBuffer.h +0 -165
  226. data/deps/include/bullet/BulletSoftBody/btSoftBodySolvers.h +0 -154
  227. data/deps/include/bullet/BulletSoftBody/btSoftRigidCollisionAlgorithm.h +0 -75
  228. data/deps/include/bullet/BulletSoftBody/btSoftRigidDynamicsWorld.h +0 -107
  229. data/deps/include/bullet/BulletSoftBody/btSoftSoftCollisionAlgorithm.h +0 -69
  230. data/deps/include/bullet/BulletSoftBody/btSparseSDF.h +0 -306
  231. data/deps/include/bullet/LinearMath/btAabbUtil2.h +0 -236
  232. data/deps/include/bullet/LinearMath/btAlignedAllocator.h +0 -107
  233. data/deps/include/bullet/LinearMath/btAlignedObjectArray.h +0 -494
  234. data/deps/include/bullet/LinearMath/btConvexHull.h +0 -241
  235. data/deps/include/bullet/LinearMath/btConvexHullComputer.h +0 -103
  236. data/deps/include/bullet/LinearMath/btDefaultMotionState.h +0 -40
  237. data/deps/include/bullet/LinearMath/btGeometryUtil.h +0 -42
  238. data/deps/include/bullet/LinearMath/btGrahamScan2dConvexHull.h +0 -110
  239. data/deps/include/bullet/LinearMath/btHashMap.h +0 -450
  240. data/deps/include/bullet/LinearMath/btIDebugDraw.h +0 -418
  241. data/deps/include/bullet/LinearMath/btList.h +0 -73
  242. data/deps/include/bullet/LinearMath/btMatrix3x3.h +0 -771
  243. data/deps/include/bullet/LinearMath/btMinMax.h +0 -71
  244. data/deps/include/bullet/LinearMath/btMotionState.h +0 -40
  245. data/deps/include/bullet/LinearMath/btPoolAllocator.h +0 -121
  246. data/deps/include/bullet/LinearMath/btQuadWord.h +0 -180
  247. data/deps/include/bullet/LinearMath/btQuaternion.h +0 -430
  248. data/deps/include/bullet/LinearMath/btQuickprof.h +0 -203
  249. data/deps/include/bullet/LinearMath/btRandom.h +0 -42
  250. data/deps/include/bullet/LinearMath/btScalar.h +0 -539
  251. data/deps/include/bullet/LinearMath/btSerializer.h +0 -639
  252. data/deps/include/bullet/LinearMath/btStackAlloc.h +0 -116
  253. data/deps/include/bullet/LinearMath/btTransform.h +0 -307
  254. data/deps/include/bullet/LinearMath/btTransformUtil.h +0 -228
  255. data/deps/include/bullet/LinearMath/btVector3.h +0 -766
  256. data/deps/include/bullet/MiniCL/MiniCLTask/MiniCLTask.h +0 -62
  257. data/deps/include/bullet/MiniCL/MiniCLTaskScheduler.h +0 -194
  258. data/deps/include/bullet/MiniCL/cl.h +0 -867
  259. data/deps/include/bullet/MiniCL/cl_MiniCL_Defs.h +0 -439
  260. data/deps/include/bullet/MiniCL/cl_gl.h +0 -113
  261. data/deps/include/bullet/MiniCL/cl_platform.h +0 -254
  262. data/deps/include/bullet/btBulletCollisionCommon.h +0 -69
  263. data/deps/include/bullet/btBulletDynamicsCommon.h +0 -48
  264. data/deps/include/bullet/vectormath/scalar/boolInVec.h +0 -225
  265. data/deps/include/bullet/vectormath/scalar/floatInVec.h +0 -343
  266. data/deps/include/bullet/vectormath/scalar/mat_aos.h +0 -1630
  267. data/deps/include/bullet/vectormath/scalar/quat_aos.h +0 -433
  268. data/deps/include/bullet/vectormath/scalar/vec_aos.h +0 -1426
  269. data/deps/include/bullet/vectormath/scalar/vectormath_aos.h +0 -1872
  270. data/deps/include/bullet/vectormath/sse/boolInVec.h +0 -247
  271. data/deps/include/bullet/vectormath/sse/floatInVec.h +0 -340
  272. data/deps/include/bullet/vectormath/sse/mat_aos.h +0 -2190
  273. data/deps/include/bullet/vectormath/sse/quat_aos.h +0 -579
  274. data/deps/include/bullet/vectormath/sse/vec_aos.h +0 -1455
  275. data/deps/include/bullet/vectormath/sse/vecidx_aos.h +0 -80
  276. data/deps/include/bullet/vectormath/sse/vectormath_aos.h +0 -2547
  277. data/deps/include/bullet/vectormath/vmInclude.h +0 -27
  278. data/deps/lib/libBulletCollision.a +0 -0
  279. data/deps/lib/libBulletDynamics.a +0 -0
  280. data/deps/lib/libBulletMultiThreaded.a +0 -0
  281. data/deps/lib/libBulletSoftBody.a +0 -0
  282. data/deps/lib/libBulletSoftBodySolvers_OpenCL_Mini.a +0 -0
  283. data/deps/lib/libLinearMath.a +0 -0
  284. data/deps/lib/libMiniCL.a +0 -0
@@ -1,2547 +0,0 @@
1
- /*
2
- Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
3
- All rights reserved.
4
-
5
- Redistribution and use in source and binary forms,
6
- with or without modification, are permitted provided that the
7
- following conditions are met:
8
- * Redistributions of source code must retain the above copyright
9
- notice, this list of conditions and the following disclaimer.
10
- * Redistributions in binary form must reproduce the above copyright
11
- notice, this list of conditions and the following disclaimer in the
12
- documentation and/or other materials provided with the distribution.
13
- * Neither the name of the Sony Computer Entertainment Inc nor the names
14
- of its contributors may be used to endorse or promote products derived
15
- from this software without specific prior written permission.
16
-
17
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
- POSSIBILITY OF SUCH DAMAGE.
28
- */
29
-
30
-
31
- #ifndef _VECTORMATH_AOS_CPP_SSE_H
32
- #define _VECTORMATH_AOS_CPP_SSE_H
33
-
34
- #include <math.h>
35
- #include <xmmintrin.h>
36
- #include <emmintrin.h>
37
- #include <assert.h>
38
-
39
- #define Vector3Ref Vector3&
40
- #define QuatRef Quat&
41
- #define Matrix3Ref Matrix3&
42
-
43
- #if (defined (_WIN32) && (_MSC_VER) && _MSC_VER >= 1400)
44
- #define USE_SSE3_LDDQU
45
-
46
- #define VM_ATTRIBUTE_ALIGNED_CLASS16(a) __declspec(align(16)) a
47
- #define VM_ATTRIBUTE_ALIGN16 __declspec(align(16))
48
- #define VECTORMATH_FORCE_INLINE __forceinline
49
- #else
50
- #define VM_ATTRIBUTE_ALIGNED_CLASS16(a) a __attribute__ ((aligned (16)))
51
- #define VM_ATTRIBUTE_ALIGN16 __attribute__ ((aligned (16)))
52
- #define VECTORMATH_FORCE_INLINE inline
53
- #ifdef __SSE3__
54
- #define USE_SSE3_LDDQU
55
- #endif //__SSE3__
56
- #endif//_WIN32
57
-
58
-
59
- #ifdef USE_SSE3_LDDQU
60
- #include <pmmintrin.h>//_mm_lddqu_si128
61
- #endif //USE_SSE3_LDDQU
62
-
63
-
64
- // TODO: Tidy
65
- typedef __m128 vec_float4;
66
- typedef __m128 vec_uint4;
67
- typedef __m128 vec_int4;
68
- typedef __m128i vec_uchar16;
69
- typedef __m128i vec_ushort8;
70
-
71
- #define vec_splat(x, e) _mm_shuffle_ps(x, x, _MM_SHUFFLE(e,e,e,e))
72
-
73
- #define _mm_ror_ps(vec,i) \
74
- (((i)%4) ? (_mm_shuffle_ps(vec,vec, _MM_SHUFFLE((unsigned char)(i+3)%4,(unsigned char)(i+2)%4,(unsigned char)(i+1)%4,(unsigned char)(i+0)%4))) : (vec))
75
- #define _mm_rol_ps(vec,i) \
76
- (((i)%4) ? (_mm_shuffle_ps(vec,vec, _MM_SHUFFLE((unsigned char)(7-i)%4,(unsigned char)(6-i)%4,(unsigned char)(5-i)%4,(unsigned char)(4-i)%4))) : (vec))
77
-
78
- #define vec_sld(vec,vec2,x) _mm_ror_ps(vec, ((x)/4))
79
-
80
- #define _mm_abs_ps(vec) _mm_andnot_ps(_MASKSIGN_,vec)
81
- #define _mm_neg_ps(vec) _mm_xor_ps(_MASKSIGN_,vec)
82
-
83
- #define vec_madd(a, b, c) _mm_add_ps(c, _mm_mul_ps(a, b) )
84
-
85
- union SSEFloat
86
- {
87
- __m128i vi;
88
- __m128 m128;
89
- __m128 vf;
90
- unsigned int ui[4];
91
- unsigned short s[8];
92
- float f[4];
93
- SSEFloat(__m128 v) : m128(v) {}
94
- SSEFloat(__m128i v) : vi(v) {}
95
- SSEFloat() {}//uninitialized
96
- };
97
-
98
- static VECTORMATH_FORCE_INLINE __m128 vec_sel(__m128 a, __m128 b, __m128 mask)
99
- {
100
- return _mm_or_ps(_mm_and_ps(mask, b), _mm_andnot_ps(mask, a));
101
- }
102
- static VECTORMATH_FORCE_INLINE __m128 vec_sel(__m128 a, __m128 b, const unsigned int *_mask)
103
- {
104
- return vec_sel(a, b, _mm_load_ps((float *)_mask));
105
- }
106
- static VECTORMATH_FORCE_INLINE __m128 vec_sel(__m128 a, __m128 b, unsigned int _mask)
107
- {
108
- return vec_sel(a, b, _mm_set1_ps(*(float *)&_mask));
109
- }
110
-
111
- static VECTORMATH_FORCE_INLINE __m128 toM128(unsigned int x)
112
- {
113
- return _mm_set1_ps( *(float *)&x );
114
- }
115
-
116
- static VECTORMATH_FORCE_INLINE __m128 fabsf4(__m128 x)
117
- {
118
- return _mm_and_ps( x, toM128( 0x7fffffff ) );
119
- }
120
- /*
121
- union SSE64
122
- {
123
- __m128 m128;
124
- struct
125
- {
126
- __m64 m01;
127
- __m64 m23;
128
- } m64;
129
- };
130
-
131
- static VECTORMATH_FORCE_INLINE __m128 vec_cts(__m128 x, int a)
132
- {
133
- assert(a == 0); // Only 2^0 supported
134
- (void)a;
135
- SSE64 sse64;
136
- sse64.m64.m01 = _mm_cvttps_pi32(x);
137
- sse64.m64.m23 = _mm_cvttps_pi32(_mm_ror_ps(x,2));
138
- _mm_empty();
139
- return sse64.m128;
140
- }
141
-
142
- static VECTORMATH_FORCE_INLINE __m128 vec_ctf(__m128 x, int a)
143
- {
144
- assert(a == 0); // Only 2^0 supported
145
- (void)a;
146
- SSE64 sse64;
147
- sse64.m128 = x;
148
- __m128 result =_mm_movelh_ps(
149
- _mm_cvt_pi2ps(_mm_setzero_ps(), sse64.m64.m01),
150
- _mm_cvt_pi2ps(_mm_setzero_ps(), sse64.m64.m23));
151
- _mm_empty();
152
- return result;
153
- }
154
- */
155
- static VECTORMATH_FORCE_INLINE __m128 vec_cts(__m128 x, int a)
156
- {
157
- assert(a == 0); // Only 2^0 supported
158
- (void)a;
159
- __m128i result = _mm_cvtps_epi32(x);
160
- return (__m128 &)result;
161
- }
162
-
163
- static VECTORMATH_FORCE_INLINE __m128 vec_ctf(__m128 x, int a)
164
- {
165
- assert(a == 0); // Only 2^0 supported
166
- (void)a;
167
- return _mm_cvtepi32_ps((__m128i &)x);
168
- }
169
-
170
- #define vec_nmsub(a,b,c) _mm_sub_ps( c, _mm_mul_ps( a, b ) )
171
- #define vec_sub(a,b) _mm_sub_ps( a, b )
172
- #define vec_add(a,b) _mm_add_ps( a, b )
173
- #define vec_mul(a,b) _mm_mul_ps( a, b )
174
- #define vec_xor(a,b) _mm_xor_ps( a, b )
175
- #define vec_and(a,b) _mm_and_ps( a, b )
176
- #define vec_cmpeq(a,b) _mm_cmpeq_ps( a, b )
177
- #define vec_cmpgt(a,b) _mm_cmpgt_ps( a, b )
178
-
179
- #define vec_mergeh(a,b) _mm_unpacklo_ps( a, b )
180
- #define vec_mergel(a,b) _mm_unpackhi_ps( a, b )
181
-
182
- #define vec_andc(a,b) _mm_andnot_ps( b, a )
183
-
184
- #define sqrtf4(x) _mm_sqrt_ps( x )
185
- #define rsqrtf4(x) _mm_rsqrt_ps( x )
186
- #define recipf4(x) _mm_rcp_ps( x )
187
- #define negatef4(x) _mm_sub_ps( _mm_setzero_ps(), x )
188
-
189
- static VECTORMATH_FORCE_INLINE __m128 newtonrapson_rsqrt4( const __m128 v )
190
- {
191
- #define _half4 _mm_setr_ps(.5f,.5f,.5f,.5f)
192
- #define _three _mm_setr_ps(3.f,3.f,3.f,3.f)
193
- const __m128 approx = _mm_rsqrt_ps( v );
194
- const __m128 muls = _mm_mul_ps(_mm_mul_ps(v, approx), approx);
195
- return _mm_mul_ps(_mm_mul_ps(_half4, approx), _mm_sub_ps(_three, muls) );
196
- }
197
-
198
- static VECTORMATH_FORCE_INLINE __m128 acosf4(__m128 x)
199
- {
200
- __m128 xabs = fabsf4(x);
201
- __m128 select = _mm_cmplt_ps( x, _mm_setzero_ps() );
202
- __m128 t1 = sqrtf4(vec_sub(_mm_set1_ps(1.0f), xabs));
203
-
204
- /* Instruction counts can be reduced if the polynomial was
205
- * computed entirely from nested (dependent) fma's. However,
206
- * to reduce the number of pipeline stalls, the polygon is evaluated
207
- * in two halves (hi amd lo).
208
- */
209
- __m128 xabs2 = _mm_mul_ps(xabs, xabs);
210
- __m128 xabs4 = _mm_mul_ps(xabs2, xabs2);
211
- __m128 hi = vec_madd(vec_madd(vec_madd(_mm_set1_ps(-0.0012624911f),
212
- xabs, _mm_set1_ps(0.0066700901f)),
213
- xabs, _mm_set1_ps(-0.0170881256f)),
214
- xabs, _mm_set1_ps( 0.0308918810f));
215
- __m128 lo = vec_madd(vec_madd(vec_madd(_mm_set1_ps(-0.0501743046f),
216
- xabs, _mm_set1_ps(0.0889789874f)),
217
- xabs, _mm_set1_ps(-0.2145988016f)),
218
- xabs, _mm_set1_ps( 1.5707963050f));
219
-
220
- __m128 result = vec_madd(hi, xabs4, lo);
221
-
222
- // Adjust the result if x is negactive.
223
- return vec_sel(
224
- vec_mul(t1, result), // Positive
225
- vec_nmsub(t1, result, _mm_set1_ps(3.1415926535898f)), // Negative
226
- select);
227
- }
228
-
229
- static VECTORMATH_FORCE_INLINE __m128 sinf4(vec_float4 x)
230
- {
231
-
232
- //
233
- // Common constants used to evaluate sinf4/cosf4/tanf4
234
- //
235
- #define _SINCOS_CC0 -0.0013602249f
236
- #define _SINCOS_CC1 0.0416566950f
237
- #define _SINCOS_CC2 -0.4999990225f
238
- #define _SINCOS_SC0 -0.0001950727f
239
- #define _SINCOS_SC1 0.0083320758f
240
- #define _SINCOS_SC2 -0.1666665247f
241
-
242
- #define _SINCOS_KC1 1.57079625129f
243
- #define _SINCOS_KC2 7.54978995489e-8f
244
-
245
- vec_float4 xl,xl2,xl3,res;
246
-
247
- // Range reduction using : xl = angle * TwoOverPi;
248
- //
249
- xl = vec_mul(x, _mm_set1_ps(0.63661977236f));
250
-
251
- // Find the quadrant the angle falls in
252
- // using: q = (int) (ceil(abs(xl))*sign(xl))
253
- //
254
- vec_int4 q = vec_cts(xl,0);
255
-
256
- // Compute an offset based on the quadrant that the angle falls in
257
- //
258
- vec_int4 offset = _mm_and_ps(q,toM128(0x3));
259
-
260
- // Remainder in range [-pi/4..pi/4]
261
- //
262
- vec_float4 qf = vec_ctf(q,0);
263
- xl = vec_nmsub(qf,_mm_set1_ps(_SINCOS_KC2),vec_nmsub(qf,_mm_set1_ps(_SINCOS_KC1),x));
264
-
265
- // Compute x^2 and x^3
266
- //
267
- xl2 = vec_mul(xl,xl);
268
- xl3 = vec_mul(xl2,xl);
269
-
270
- // Compute both the sin and cos of the angles
271
- // using a polynomial expression:
272
- // cx = 1.0f + xl2 * ((C0 * xl2 + C1) * xl2 + C2), and
273
- // sx = xl + xl3 * ((S0 * xl2 + S1) * xl2 + S2)
274
- //
275
-
276
- vec_float4 cx =
277
- vec_madd(
278
- vec_madd(
279
- vec_madd(_mm_set1_ps(_SINCOS_CC0),xl2,_mm_set1_ps(_SINCOS_CC1)),xl2,_mm_set1_ps(_SINCOS_CC2)),xl2,_mm_set1_ps(1.0f));
280
- vec_float4 sx =
281
- vec_madd(
282
- vec_madd(
283
- vec_madd(_mm_set1_ps(_SINCOS_SC0),xl2,_mm_set1_ps(_SINCOS_SC1)),xl2,_mm_set1_ps(_SINCOS_SC2)),xl3,xl);
284
-
285
- // Use the cosine when the offset is odd and the sin
286
- // when the offset is even
287
- //
288
- res = vec_sel(cx,sx,vec_cmpeq(vec_and(offset,
289
- toM128(0x1)),
290
- _mm_setzero_ps()));
291
-
292
- // Flip the sign of the result when (offset mod 4) = 1 or 2
293
- //
294
- return vec_sel(
295
- vec_xor(toM128(0x80000000U), res), // Negative
296
- res, // Positive
297
- vec_cmpeq(vec_and(offset,toM128(0x2)),_mm_setzero_ps()));
298
- }
299
-
300
- static VECTORMATH_FORCE_INLINE void sincosf4(vec_float4 x, vec_float4* s, vec_float4* c)
301
- {
302
- vec_float4 xl,xl2,xl3;
303
- vec_int4 offsetSin, offsetCos;
304
-
305
- // Range reduction using : xl = angle * TwoOverPi;
306
- //
307
- xl = vec_mul(x, _mm_set1_ps(0.63661977236f));
308
-
309
- // Find the quadrant the angle falls in
310
- // using: q = (int) (ceil(abs(xl))*sign(xl))
311
- //
312
- //vec_int4 q = vec_cts(vec_add(xl,vec_sel(_mm_set1_ps(0.5f),xl,(0x80000000))),0);
313
- vec_int4 q = vec_cts(xl,0);
314
-
315
- // Compute the offset based on the quadrant that the angle falls in.
316
- // Add 1 to the offset for the cosine.
317
- //
318
- offsetSin = vec_and(q,toM128((int)0x3));
319
- __m128i temp = _mm_add_epi32(_mm_set1_epi32(1),(__m128i &)offsetSin);
320
- offsetCos = (__m128 &)temp;
321
-
322
- // Remainder in range [-pi/4..pi/4]
323
- //
324
- vec_float4 qf = vec_ctf(q,0);
325
- xl = vec_nmsub(qf,_mm_set1_ps(_SINCOS_KC2),vec_nmsub(qf,_mm_set1_ps(_SINCOS_KC1),x));
326
-
327
- // Compute x^2 and x^3
328
- //
329
- xl2 = vec_mul(xl,xl);
330
- xl3 = vec_mul(xl2,xl);
331
-
332
- // Compute both the sin and cos of the angles
333
- // using a polynomial expression:
334
- // cx = 1.0f + xl2 * ((C0 * xl2 + C1) * xl2 + C2), and
335
- // sx = xl + xl3 * ((S0 * xl2 + S1) * xl2 + S2)
336
- //
337
- vec_float4 cx =
338
- vec_madd(
339
- vec_madd(
340
- vec_madd(_mm_set1_ps(_SINCOS_CC0),xl2,_mm_set1_ps(_SINCOS_CC1)),xl2,_mm_set1_ps(_SINCOS_CC2)),xl2,_mm_set1_ps(1.0f));
341
- vec_float4 sx =
342
- vec_madd(
343
- vec_madd(
344
- vec_madd(_mm_set1_ps(_SINCOS_SC0),xl2,_mm_set1_ps(_SINCOS_SC1)),xl2,_mm_set1_ps(_SINCOS_SC2)),xl3,xl);
345
-
346
- // Use the cosine when the offset is odd and the sin
347
- // when the offset is even
348
- //
349
- vec_uint4 sinMask = (vec_uint4)vec_cmpeq(vec_and(offsetSin,toM128(0x1)),_mm_setzero_ps());
350
- vec_uint4 cosMask = (vec_uint4)vec_cmpeq(vec_and(offsetCos,toM128(0x1)),_mm_setzero_ps());
351
- *s = vec_sel(cx,sx,sinMask);
352
- *c = vec_sel(cx,sx,cosMask);
353
-
354
- // Flip the sign of the result when (offset mod 4) = 1 or 2
355
- //
356
- sinMask = vec_cmpeq(vec_and(offsetSin,toM128(0x2)),_mm_setzero_ps());
357
- cosMask = vec_cmpeq(vec_and(offsetCos,toM128(0x2)),_mm_setzero_ps());
358
-
359
- *s = vec_sel((vec_float4)vec_xor(toM128(0x80000000),(vec_uint4)*s),*s,sinMask);
360
- *c = vec_sel((vec_float4)vec_xor(toM128(0x80000000),(vec_uint4)*c),*c,cosMask);
361
- }
362
-
363
- #include "vecidx_aos.h"
364
- #include "floatInVec.h"
365
- #include "boolInVec.h"
366
-
367
- #ifdef _VECTORMATH_DEBUG
368
- #include <stdio.h>
369
- #endif
370
- namespace Vectormath {
371
-
372
- namespace Aos {
373
-
374
- //-----------------------------------------------------------------------------
375
- // Forward Declarations
376
- //
377
-
378
- class Vector3;
379
- class Vector4;
380
- class Point3;
381
- class Quat;
382
- class Matrix3;
383
- class Matrix4;
384
- class Transform3;
385
-
386
- // A 3-D vector in array-of-structures format
387
- //
388
- class Vector3
389
- {
390
- __m128 mVec128;
391
-
392
- VECTORMATH_FORCE_INLINE void set128(vec_float4 vec);
393
-
394
- VECTORMATH_FORCE_INLINE vec_float4& get128Ref();
395
-
396
- public:
397
- // Default constructor; does no initialization
398
- //
399
- VECTORMATH_FORCE_INLINE Vector3( ) { };
400
-
401
- // Default copy constructor
402
- //
403
- VECTORMATH_FORCE_INLINE Vector3(const Vector3& vec);
404
-
405
- // Construct a 3-D vector from x, y, and z elements
406
- //
407
- VECTORMATH_FORCE_INLINE Vector3( float x, float y, float z );
408
-
409
- // Construct a 3-D vector from x, y, and z elements (scalar data contained in vector data type)
410
- //
411
- VECTORMATH_FORCE_INLINE Vector3( const floatInVec &x, const floatInVec &y, const floatInVec &z );
412
-
413
- // Copy elements from a 3-D point into a 3-D vector
414
- //
415
- explicit VECTORMATH_FORCE_INLINE Vector3( const Point3 &pnt );
416
-
417
- // Set all elements of a 3-D vector to the same scalar value
418
- //
419
- explicit VECTORMATH_FORCE_INLINE Vector3( float scalar );
420
-
421
- // Set all elements of a 3-D vector to the same scalar value (scalar data contained in vector data type)
422
- //
423
- explicit VECTORMATH_FORCE_INLINE Vector3( const floatInVec &scalar );
424
-
425
- // Set vector float data in a 3-D vector
426
- //
427
- explicit VECTORMATH_FORCE_INLINE Vector3( __m128 vf4 );
428
-
429
- // Get vector float data from a 3-D vector
430
- //
431
- VECTORMATH_FORCE_INLINE __m128 get128( ) const;
432
-
433
- // Assign one 3-D vector to another
434
- //
435
- VECTORMATH_FORCE_INLINE Vector3 & operator =( const Vector3 &vec );
436
-
437
- // Set the x element of a 3-D vector
438
- //
439
- VECTORMATH_FORCE_INLINE Vector3 & setX( float x );
440
-
441
- // Set the y element of a 3-D vector
442
- //
443
- VECTORMATH_FORCE_INLINE Vector3 & setY( float y );
444
-
445
- // Set the z element of a 3-D vector
446
- //
447
- VECTORMATH_FORCE_INLINE Vector3 & setZ( float z );
448
-
449
- // Set the x element of a 3-D vector (scalar data contained in vector data type)
450
- //
451
- VECTORMATH_FORCE_INLINE Vector3 & setX( const floatInVec &x );
452
-
453
- // Set the y element of a 3-D vector (scalar data contained in vector data type)
454
- //
455
- VECTORMATH_FORCE_INLINE Vector3 & setY( const floatInVec &y );
456
-
457
- // Set the z element of a 3-D vector (scalar data contained in vector data type)
458
- //
459
- VECTORMATH_FORCE_INLINE Vector3 & setZ( const floatInVec &z );
460
-
461
- // Get the x element of a 3-D vector
462
- //
463
- VECTORMATH_FORCE_INLINE const floatInVec getX( ) const;
464
-
465
- // Get the y element of a 3-D vector
466
- //
467
- VECTORMATH_FORCE_INLINE const floatInVec getY( ) const;
468
-
469
- // Get the z element of a 3-D vector
470
- //
471
- VECTORMATH_FORCE_INLINE const floatInVec getZ( ) const;
472
-
473
- // Set an x, y, or z element of a 3-D vector by index
474
- //
475
- VECTORMATH_FORCE_INLINE Vector3 & setElem( int idx, float value );
476
-
477
- // Set an x, y, or z element of a 3-D vector by index (scalar data contained in vector data type)
478
- //
479
- VECTORMATH_FORCE_INLINE Vector3 & setElem( int idx, const floatInVec &value );
480
-
481
- // Get an x, y, or z element of a 3-D vector by index
482
- //
483
- VECTORMATH_FORCE_INLINE const floatInVec getElem( int idx ) const;
484
-
485
- // Subscripting operator to set or get an element
486
- //
487
- VECTORMATH_FORCE_INLINE VecIdx operator []( int idx );
488
-
489
- // Subscripting operator to get an element
490
- //
491
- VECTORMATH_FORCE_INLINE const floatInVec operator []( int idx ) const;
492
-
493
- // Add two 3-D vectors
494
- //
495
- VECTORMATH_FORCE_INLINE const Vector3 operator +( const Vector3 &vec ) const;
496
-
497
- // Subtract a 3-D vector from another 3-D vector
498
- //
499
- VECTORMATH_FORCE_INLINE const Vector3 operator -( const Vector3 &vec ) const;
500
-
501
- // Add a 3-D vector to a 3-D point
502
- //
503
- VECTORMATH_FORCE_INLINE const Point3 operator +( const Point3 &pnt ) const;
504
-
505
- // Multiply a 3-D vector by a scalar
506
- //
507
- VECTORMATH_FORCE_INLINE const Vector3 operator *( float scalar ) const;
508
-
509
- // Divide a 3-D vector by a scalar
510
- //
511
- VECTORMATH_FORCE_INLINE const Vector3 operator /( float scalar ) const;
512
-
513
- // Multiply a 3-D vector by a scalar (scalar data contained in vector data type)
514
- //
515
- VECTORMATH_FORCE_INLINE const Vector3 operator *( const floatInVec &scalar ) const;
516
-
517
- // Divide a 3-D vector by a scalar (scalar data contained in vector data type)
518
- //
519
- VECTORMATH_FORCE_INLINE const Vector3 operator /( const floatInVec &scalar ) const;
520
-
521
- // Perform compound assignment and addition with a 3-D vector
522
- //
523
- VECTORMATH_FORCE_INLINE Vector3 & operator +=( const Vector3 &vec );
524
-
525
- // Perform compound assignment and subtraction by a 3-D vector
526
- //
527
- VECTORMATH_FORCE_INLINE Vector3 & operator -=( const Vector3 &vec );
528
-
529
- // Perform compound assignment and multiplication by a scalar
530
- //
531
- VECTORMATH_FORCE_INLINE Vector3 & operator *=( float scalar );
532
-
533
- // Perform compound assignment and division by a scalar
534
- //
535
- VECTORMATH_FORCE_INLINE Vector3 & operator /=( float scalar );
536
-
537
- // Perform compound assignment and multiplication by a scalar (scalar data contained in vector data type)
538
- //
539
- VECTORMATH_FORCE_INLINE Vector3 & operator *=( const floatInVec &scalar );
540
-
541
- // Perform compound assignment and division by a scalar (scalar data contained in vector data type)
542
- //
543
- VECTORMATH_FORCE_INLINE Vector3 & operator /=( const floatInVec &scalar );
544
-
545
- // Negate all elements of a 3-D vector
546
- //
547
- VECTORMATH_FORCE_INLINE const Vector3 operator -( ) const;
548
-
549
- // Construct x axis
550
- //
551
- static VECTORMATH_FORCE_INLINE const Vector3 xAxis( );
552
-
553
- // Construct y axis
554
- //
555
- static VECTORMATH_FORCE_INLINE const Vector3 yAxis( );
556
-
557
- // Construct z axis
558
- //
559
- static VECTORMATH_FORCE_INLINE const Vector3 zAxis( );
560
-
561
- };
562
-
563
- // Multiply a 3-D vector by a scalar
564
- //
565
- VECTORMATH_FORCE_INLINE const Vector3 operator *( float scalar, const Vector3 &vec );
566
-
567
- // Multiply a 3-D vector by a scalar (scalar data contained in vector data type)
568
- //
569
- VECTORMATH_FORCE_INLINE const Vector3 operator *( const floatInVec &scalar, const Vector3 &vec );
570
-
571
- // Multiply two 3-D vectors per element
572
- //
573
- VECTORMATH_FORCE_INLINE const Vector3 mulPerElem( const Vector3 &vec0, const Vector3 &vec1 );
574
-
575
- // Divide two 3-D vectors per element
576
- // NOTE:
577
- // Floating-point behavior matches standard library function divf4.
578
- //
579
- VECTORMATH_FORCE_INLINE const Vector3 divPerElem( const Vector3 &vec0, const Vector3 &vec1 );
580
-
581
- // Compute the reciprocal of a 3-D vector per element
582
- // NOTE:
583
- // Floating-point behavior matches standard library function recipf4.
584
- //
585
- VECTORMATH_FORCE_INLINE const Vector3 recipPerElem( const Vector3 &vec );
586
-
587
- // Compute the absolute value of a 3-D vector per element
588
- //
589
- VECTORMATH_FORCE_INLINE const Vector3 absPerElem( const Vector3 &vec );
590
-
591
- // Copy sign from one 3-D vector to another, per element
592
- //
593
- VECTORMATH_FORCE_INLINE const Vector3 copySignPerElem( const Vector3 &vec0, const Vector3 &vec1 );
594
-
595
- // Maximum of two 3-D vectors per element
596
- //
597
- VECTORMATH_FORCE_INLINE const Vector3 maxPerElem( const Vector3 &vec0, const Vector3 &vec1 );
598
-
599
- // Minimum of two 3-D vectors per element
600
- //
601
- VECTORMATH_FORCE_INLINE const Vector3 minPerElem( const Vector3 &vec0, const Vector3 &vec1 );
602
-
603
- // Maximum element of a 3-D vector
604
- //
605
- VECTORMATH_FORCE_INLINE const floatInVec maxElem( const Vector3 &vec );
606
-
607
- // Minimum element of a 3-D vector
608
- //
609
- VECTORMATH_FORCE_INLINE const floatInVec minElem( const Vector3 &vec );
610
-
611
- // Compute the sum of all elements of a 3-D vector
612
- //
613
- VECTORMATH_FORCE_INLINE const floatInVec sum( const Vector3 &vec );
614
-
615
- // Compute the dot product of two 3-D vectors
616
- //
617
- VECTORMATH_FORCE_INLINE const floatInVec dot( const Vector3 &vec0, const Vector3 &vec1 );
618
-
619
- // Compute the square of the length of a 3-D vector
620
- //
621
- VECTORMATH_FORCE_INLINE const floatInVec lengthSqr( const Vector3 &vec );
622
-
623
- // Compute the length of a 3-D vector
624
- //
625
- VECTORMATH_FORCE_INLINE const floatInVec length( const Vector3 &vec );
626
-
627
- // Normalize a 3-D vector
628
- // NOTE:
629
- // The result is unpredictable when all elements of vec are at or near zero.
630
- //
631
- VECTORMATH_FORCE_INLINE const Vector3 normalize( const Vector3 &vec );
632
-
633
- // Compute cross product of two 3-D vectors
634
- //
635
- VECTORMATH_FORCE_INLINE const Vector3 cross( const Vector3 &vec0, const Vector3 &vec1 );
636
-
637
- // Outer product of two 3-D vectors
638
- //
639
- VECTORMATH_FORCE_INLINE const Matrix3 outer( const Vector3 &vec0, const Vector3 &vec1 );
640
-
641
- // Pre-multiply a row vector by a 3x3 matrix
642
- // NOTE:
643
- // Slower than column post-multiply.
644
- //
645
- VECTORMATH_FORCE_INLINE const Vector3 rowMul( const Vector3 &vec, const Matrix3 & mat );
646
-
647
- // Cross-product matrix of a 3-D vector
648
- //
649
- VECTORMATH_FORCE_INLINE const Matrix3 crossMatrix( const Vector3 &vec );
650
-
651
- // Create cross-product matrix and multiply
652
- // NOTE:
653
- // Faster than separately creating a cross-product matrix and multiplying.
654
- //
655
- VECTORMATH_FORCE_INLINE const Matrix3 crossMatrixMul( const Vector3 &vec, const Matrix3 & mat );
656
-
657
- // Linear interpolation between two 3-D vectors
658
- // NOTE:
659
- // Does not clamp t between 0 and 1.
660
- //
661
- VECTORMATH_FORCE_INLINE const Vector3 lerp( float t, const Vector3 &vec0, const Vector3 &vec1 );
662
-
663
- // Linear interpolation between two 3-D vectors (scalar data contained in vector data type)
664
- // NOTE:
665
- // Does not clamp t between 0 and 1.
666
- //
667
- VECTORMATH_FORCE_INLINE const Vector3 lerp( const floatInVec &t, const Vector3 &vec0, const Vector3 &vec1 );
668
-
669
- // Spherical linear interpolation between two 3-D vectors
670
- // NOTE:
671
- // The result is unpredictable if the vectors point in opposite directions.
672
- // Does not clamp t between 0 and 1.
673
- //
674
- VECTORMATH_FORCE_INLINE const Vector3 slerp( float t, const Vector3 &unitVec0, const Vector3 &unitVec1 );
675
-
676
- // Spherical linear interpolation between two 3-D vectors (scalar data contained in vector data type)
677
- // NOTE:
678
- // The result is unpredictable if the vectors point in opposite directions.
679
- // Does not clamp t between 0 and 1.
680
- //
681
- VECTORMATH_FORCE_INLINE const Vector3 slerp( const floatInVec &t, const Vector3 &unitVec0, const Vector3 &unitVec1 );
682
-
683
- // Conditionally select between two 3-D vectors
684
- // NOTE:
685
- // This function uses a conditional select instruction to avoid a branch.
686
- // However, the transfer of select1 to a VMX register may use more processing time than a branch.
687
- // Use the boolInVec version for better performance.
688
- //
689
- VECTORMATH_FORCE_INLINE const Vector3 select( const Vector3 &vec0, const Vector3 &vec1, bool select1 );
690
-
691
- // Conditionally select between two 3-D vectors (scalar data contained in vector data type)
692
- // NOTE:
693
- // This function uses a conditional select instruction to avoid a branch.
694
- //
695
- VECTORMATH_FORCE_INLINE const Vector3 select( const Vector3 &vec0, const Vector3 &vec1, const boolInVec &select1 );
696
-
697
- // Store x, y, and z elements of 3-D vector in first three words of a quadword, preserving fourth word
698
- //
699
- VECTORMATH_FORCE_INLINE void storeXYZ( const Vector3 &vec, __m128 * quad );
700
-
701
- // Load four three-float 3-D vectors, stored in three quadwords
702
- //
703
- VECTORMATH_FORCE_INLINE void loadXYZArray( Vector3 & vec0, Vector3 & vec1, Vector3 & vec2, Vector3 & vec3, const __m128 * threeQuads );
704
-
705
- // Store four 3-D vectors in three quadwords
706
- //
707
- VECTORMATH_FORCE_INLINE void storeXYZArray( const Vector3 &vec0, const Vector3 &vec1, const Vector3 &vec2, const Vector3 &vec3, __m128 * threeQuads );
708
-
709
- // Store eight 3-D vectors as half-floats
710
- //
711
- VECTORMATH_FORCE_INLINE void storeHalfFloats( const Vector3 &vec0, const Vector3 &vec1, const Vector3 &vec2, const Vector3 &vec3, const Vector3 &vec4, const Vector3 &vec5, const Vector3 &vec6, const Vector3 &vec7, vec_ushort8 * threeQuads );
712
-
713
- #ifdef _VECTORMATH_DEBUG
714
-
715
- // Print a 3-D vector
716
- // NOTE:
717
- // Function is only defined when _VECTORMATH_DEBUG is defined.
718
- //
719
- VECTORMATH_FORCE_INLINE void print( const Vector3 &vec );
720
-
721
- // Print a 3-D vector and an associated string identifier
722
- // NOTE:
723
- // Function is only defined when _VECTORMATH_DEBUG is defined.
724
- //
725
- VECTORMATH_FORCE_INLINE void print( const Vector3 &vec, const char * name );
726
-
727
- #endif
728
-
729
- // A 4-D vector in array-of-structures format
730
- //
731
- class Vector4
732
- {
733
- __m128 mVec128;
734
-
735
- public:
736
- // Default constructor; does no initialization
737
- //
738
- VECTORMATH_FORCE_INLINE Vector4( ) { };
739
-
740
- // Construct a 4-D vector from x, y, z, and w elements
741
- //
742
- VECTORMATH_FORCE_INLINE Vector4( float x, float y, float z, float w );
743
-
744
- // Construct a 4-D vector from x, y, z, and w elements (scalar data contained in vector data type)
745
- //
746
- VECTORMATH_FORCE_INLINE Vector4( const floatInVec &x, const floatInVec &y, const floatInVec &z, const floatInVec &w );
747
-
748
- // Construct a 4-D vector from a 3-D vector and a scalar
749
- //
750
- VECTORMATH_FORCE_INLINE Vector4( const Vector3 &xyz, float w );
751
-
752
- // Construct a 4-D vector from a 3-D vector and a scalar (scalar data contained in vector data type)
753
- //
754
- VECTORMATH_FORCE_INLINE Vector4( const Vector3 &xyz, const floatInVec &w );
755
-
756
- // Copy x, y, and z from a 3-D vector into a 4-D vector, and set w to 0
757
- //
758
- explicit VECTORMATH_FORCE_INLINE Vector4( const Vector3 &vec );
759
-
760
- // Copy x, y, and z from a 3-D point into a 4-D vector, and set w to 1
761
- //
762
- explicit VECTORMATH_FORCE_INLINE Vector4( const Point3 &pnt );
763
-
764
- // Copy elements from a quaternion into a 4-D vector
765
- //
766
- explicit VECTORMATH_FORCE_INLINE Vector4( const Quat &quat );
767
-
768
- // Set all elements of a 4-D vector to the same scalar value
769
- //
770
- explicit VECTORMATH_FORCE_INLINE Vector4( float scalar );
771
-
772
- // Set all elements of a 4-D vector to the same scalar value (scalar data contained in vector data type)
773
- //
774
- explicit VECTORMATH_FORCE_INLINE Vector4( const floatInVec &scalar );
775
-
776
- // Set vector float data in a 4-D vector
777
- //
778
- explicit VECTORMATH_FORCE_INLINE Vector4( __m128 vf4 );
779
-
780
- // Get vector float data from a 4-D vector
781
- //
782
- VECTORMATH_FORCE_INLINE __m128 get128( ) const;
783
-
784
- // Assign one 4-D vector to another
785
- //
786
- VECTORMATH_FORCE_INLINE Vector4 & operator =( const Vector4 &vec );
787
-
788
- // Set the x, y, and z elements of a 4-D vector
789
- // NOTE:
790
- // This function does not change the w element.
791
- //
792
- VECTORMATH_FORCE_INLINE Vector4 & setXYZ( const Vector3 &vec );
793
-
794
- // Get the x, y, and z elements of a 4-D vector
795
- //
796
- VECTORMATH_FORCE_INLINE const Vector3 getXYZ( ) const;
797
-
798
- // Set the x element of a 4-D vector
799
- //
800
- VECTORMATH_FORCE_INLINE Vector4 & setX( float x );
801
-
802
- // Set the y element of a 4-D vector
803
- //
804
- VECTORMATH_FORCE_INLINE Vector4 & setY( float y );
805
-
806
- // Set the z element of a 4-D vector
807
- //
808
- VECTORMATH_FORCE_INLINE Vector4 & setZ( float z );
809
-
810
- // Set the w element of a 4-D vector
811
- //
812
- VECTORMATH_FORCE_INLINE Vector4 & setW( float w );
813
-
814
- // Set the x element of a 4-D vector (scalar data contained in vector data type)
815
- //
816
- VECTORMATH_FORCE_INLINE Vector4 & setX( const floatInVec &x );
817
-
818
- // Set the y element of a 4-D vector (scalar data contained in vector data type)
819
- //
820
- VECTORMATH_FORCE_INLINE Vector4 & setY( const floatInVec &y );
821
-
822
- // Set the z element of a 4-D vector (scalar data contained in vector data type)
823
- //
824
- VECTORMATH_FORCE_INLINE Vector4 & setZ( const floatInVec &z );
825
-
826
- // Set the w element of a 4-D vector (scalar data contained in vector data type)
827
- //
828
- VECTORMATH_FORCE_INLINE Vector4 & setW( const floatInVec &w );
829
-
830
- // Get the x element of a 4-D vector
831
- //
832
- VECTORMATH_FORCE_INLINE const floatInVec getX( ) const;
833
-
834
- // Get the y element of a 4-D vector
835
- //
836
- VECTORMATH_FORCE_INLINE const floatInVec getY( ) const;
837
-
838
- // Get the z element of a 4-D vector
839
- //
840
- VECTORMATH_FORCE_INLINE const floatInVec getZ( ) const;
841
-
842
- // Get the w element of a 4-D vector
843
- //
844
- VECTORMATH_FORCE_INLINE const floatInVec getW( ) const;
845
-
846
- // Set an x, y, z, or w element of a 4-D vector by index
847
- //
848
- VECTORMATH_FORCE_INLINE Vector4 & setElem( int idx, float value );
849
-
850
- // Set an x, y, z, or w element of a 4-D vector by index (scalar data contained in vector data type)
851
- //
852
- VECTORMATH_FORCE_INLINE Vector4 & setElem( int idx, const floatInVec &value );
853
-
854
- // Get an x, y, z, or w element of a 4-D vector by index
855
- //
856
- VECTORMATH_FORCE_INLINE const floatInVec getElem( int idx ) const;
857
-
858
- // Subscripting operator to set or get an element
859
- //
860
- VECTORMATH_FORCE_INLINE VecIdx operator []( int idx );
861
-
862
- // Subscripting operator to get an element
863
- //
864
- VECTORMATH_FORCE_INLINE const floatInVec operator []( int idx ) const;
865
-
866
- // Add two 4-D vectors
867
- //
868
- VECTORMATH_FORCE_INLINE const Vector4 operator +( const Vector4 &vec ) const;
869
-
870
- // Subtract a 4-D vector from another 4-D vector
871
- //
872
- VECTORMATH_FORCE_INLINE const Vector4 operator -( const Vector4 &vec ) const;
873
-
874
- // Multiply a 4-D vector by a scalar
875
- //
876
- VECTORMATH_FORCE_INLINE const Vector4 operator *( float scalar ) const;
877
-
878
- // Divide a 4-D vector by a scalar
879
- //
880
- VECTORMATH_FORCE_INLINE const Vector4 operator /( float scalar ) const;
881
-
882
- // Multiply a 4-D vector by a scalar (scalar data contained in vector data type)
883
- //
884
- VECTORMATH_FORCE_INLINE const Vector4 operator *( const floatInVec &scalar ) const;
885
-
886
- // Divide a 4-D vector by a scalar (scalar data contained in vector data type)
887
- //
888
- VECTORMATH_FORCE_INLINE const Vector4 operator /( const floatInVec &scalar ) const;
889
-
890
- // Perform compound assignment and addition with a 4-D vector
891
- //
892
- VECTORMATH_FORCE_INLINE Vector4 & operator +=( const Vector4 &vec );
893
-
894
- // Perform compound assignment and subtraction by a 4-D vector
895
- //
896
- VECTORMATH_FORCE_INLINE Vector4 & operator -=( const Vector4 &vec );
897
-
898
- // Perform compound assignment and multiplication by a scalar
899
- //
900
- VECTORMATH_FORCE_INLINE Vector4 & operator *=( float scalar );
901
-
902
- // Perform compound assignment and division by a scalar
903
- //
904
- VECTORMATH_FORCE_INLINE Vector4 & operator /=( float scalar );
905
-
906
- // Perform compound assignment and multiplication by a scalar (scalar data contained in vector data type)
907
- //
908
- VECTORMATH_FORCE_INLINE Vector4 & operator *=( const floatInVec &scalar );
909
-
910
- // Perform compound assignment and division by a scalar (scalar data contained in vector data type)
911
- //
912
- VECTORMATH_FORCE_INLINE Vector4 & operator /=( const floatInVec &scalar );
913
-
914
- // Negate all elements of a 4-D vector
915
- //
916
- VECTORMATH_FORCE_INLINE const Vector4 operator -( ) const;
917
-
918
- // Construct x axis
919
- //
920
- static VECTORMATH_FORCE_INLINE const Vector4 xAxis( );
921
-
922
- // Construct y axis
923
- //
924
- static VECTORMATH_FORCE_INLINE const Vector4 yAxis( );
925
-
926
- // Construct z axis
927
- //
928
- static VECTORMATH_FORCE_INLINE const Vector4 zAxis( );
929
-
930
- // Construct w axis
931
- //
932
- static VECTORMATH_FORCE_INLINE const Vector4 wAxis( );
933
-
934
- };
935
-
936
- // Multiply a 4-D vector by a scalar
937
- //
938
- VECTORMATH_FORCE_INLINE const Vector4 operator *( float scalar, const Vector4 &vec );
939
-
940
- // Multiply a 4-D vector by a scalar (scalar data contained in vector data type)
941
- //
942
- VECTORMATH_FORCE_INLINE const Vector4 operator *( const floatInVec &scalar, const Vector4 &vec );
943
-
944
- // Multiply two 4-D vectors per element
945
- //
946
- VECTORMATH_FORCE_INLINE const Vector4 mulPerElem( const Vector4 &vec0, const Vector4 &vec1 );
947
-
948
- // Divide two 4-D vectors per element
949
- // NOTE:
950
- // Floating-point behavior matches standard library function divf4.
951
- //
952
- VECTORMATH_FORCE_INLINE const Vector4 divPerElem( const Vector4 &vec0, const Vector4 &vec1 );
953
-
954
- // Compute the reciprocal of a 4-D vector per element
955
- // NOTE:
956
- // Floating-point behavior matches standard library function recipf4.
957
- //
958
- VECTORMATH_FORCE_INLINE const Vector4 recipPerElem( const Vector4 &vec );
959
-
960
- // Compute the absolute value of a 4-D vector per element
961
- //
962
- VECTORMATH_FORCE_INLINE const Vector4 absPerElem( const Vector4 &vec );
963
-
964
- // Copy sign from one 4-D vector to another, per element
965
- //
966
- VECTORMATH_FORCE_INLINE const Vector4 copySignPerElem( const Vector4 &vec0, const Vector4 &vec1 );
967
-
968
- // Maximum of two 4-D vectors per element
969
- //
970
- VECTORMATH_FORCE_INLINE const Vector4 maxPerElem( const Vector4 &vec0, const Vector4 &vec1 );
971
-
972
- // Minimum of two 4-D vectors per element
973
- //
974
- VECTORMATH_FORCE_INLINE const Vector4 minPerElem( const Vector4 &vec0, const Vector4 &vec1 );
975
-
976
- // Maximum element of a 4-D vector
977
- //
978
- VECTORMATH_FORCE_INLINE const floatInVec maxElem( const Vector4 &vec );
979
-
980
- // Minimum element of a 4-D vector
981
- //
982
- VECTORMATH_FORCE_INLINE const floatInVec minElem( const Vector4 &vec );
983
-
984
- // Compute the sum of all elements of a 4-D vector
985
- //
986
- VECTORMATH_FORCE_INLINE const floatInVec sum( const Vector4 &vec );
987
-
988
- // Compute the dot product of two 4-D vectors
989
- //
990
- VECTORMATH_FORCE_INLINE const floatInVec dot( const Vector4 &vec0, const Vector4 &vec1 );
991
-
992
- // Compute the square of the length of a 4-D vector
993
- //
994
- VECTORMATH_FORCE_INLINE const floatInVec lengthSqr( const Vector4 &vec );
995
-
996
- // Compute the length of a 4-D vector
997
- //
998
- VECTORMATH_FORCE_INLINE const floatInVec length( const Vector4 &vec );
999
-
1000
- // Normalize a 4-D vector
1001
- // NOTE:
1002
- // The result is unpredictable when all elements of vec are at or near zero.
1003
- //
1004
- VECTORMATH_FORCE_INLINE const Vector4 normalize( const Vector4 &vec );
1005
-
1006
- // Outer product of two 4-D vectors
1007
- //
1008
- VECTORMATH_FORCE_INLINE const Matrix4 outer( const Vector4 &vec0, const Vector4 &vec1 );
1009
-
1010
- // Linear interpolation between two 4-D vectors
1011
- // NOTE:
1012
- // Does not clamp t between 0 and 1.
1013
- //
1014
- VECTORMATH_FORCE_INLINE const Vector4 lerp( float t, const Vector4 &vec0, const Vector4 &vec1 );
1015
-
1016
- // Linear interpolation between two 4-D vectors (scalar data contained in vector data type)
1017
- // NOTE:
1018
- // Does not clamp t between 0 and 1.
1019
- //
1020
- VECTORMATH_FORCE_INLINE const Vector4 lerp( const floatInVec &t, const Vector4 &vec0, const Vector4 &vec1 );
1021
-
1022
- // Spherical linear interpolation between two 4-D vectors
1023
- // NOTE:
1024
- // The result is unpredictable if the vectors point in opposite directions.
1025
- // Does not clamp t between 0 and 1.
1026
- //
1027
- VECTORMATH_FORCE_INLINE const Vector4 slerp( float t, const Vector4 &unitVec0, const Vector4 &unitVec1 );
1028
-
1029
- // Spherical linear interpolation between two 4-D vectors (scalar data contained in vector data type)
1030
- // NOTE:
1031
- // The result is unpredictable if the vectors point in opposite directions.
1032
- // Does not clamp t between 0 and 1.
1033
- //
1034
- VECTORMATH_FORCE_INLINE const Vector4 slerp( const floatInVec &t, const Vector4 &unitVec0, const Vector4 &unitVec1 );
1035
-
1036
- // Conditionally select between two 4-D vectors
1037
- // NOTE:
1038
- // This function uses a conditional select instruction to avoid a branch.
1039
- // However, the transfer of select1 to a VMX register may use more processing time than a branch.
1040
- // Use the boolInVec version for better performance.
1041
- //
1042
- VECTORMATH_FORCE_INLINE const Vector4 select( const Vector4 &vec0, const Vector4 &vec1, bool select1 );
1043
-
1044
- // Conditionally select between two 4-D vectors (scalar data contained in vector data type)
1045
- // NOTE:
1046
- // This function uses a conditional select instruction to avoid a branch.
1047
- //
1048
- VECTORMATH_FORCE_INLINE const Vector4 select( const Vector4 &vec0, const Vector4 &vec1, const boolInVec &select1 );
1049
-
1050
- // Store four 4-D vectors as half-floats
1051
- //
1052
- VECTORMATH_FORCE_INLINE void storeHalfFloats( const Vector4 &vec0, const Vector4 &vec1, const Vector4 &vec2, const Vector4 &vec3, vec_ushort8 * twoQuads );
1053
-
1054
- #ifdef _VECTORMATH_DEBUG
1055
-
1056
- // Print a 4-D vector
1057
- // NOTE:
1058
- // Function is only defined when _VECTORMATH_DEBUG is defined.
1059
- //
1060
- VECTORMATH_FORCE_INLINE void print( const Vector4 &vec );
1061
-
1062
- // Print a 4-D vector and an associated string identifier
1063
- // NOTE:
1064
- // Function is only defined when _VECTORMATH_DEBUG is defined.
1065
- //
1066
- VECTORMATH_FORCE_INLINE void print( const Vector4 &vec, const char * name );
1067
-
1068
- #endif
1069
-
1070
- // A 3-D point in array-of-structures format
1071
- //
1072
- class Point3
1073
- {
1074
- __m128 mVec128;
1075
-
1076
- public:
1077
- // Default constructor; does no initialization
1078
- //
1079
- VECTORMATH_FORCE_INLINE Point3( ) { };
1080
-
1081
- // Construct a 3-D point from x, y, and z elements
1082
- //
1083
- VECTORMATH_FORCE_INLINE Point3( float x, float y, float z );
1084
-
1085
- // Construct a 3-D point from x, y, and z elements (scalar data contained in vector data type)
1086
- //
1087
- VECTORMATH_FORCE_INLINE Point3( const floatInVec &x, const floatInVec &y, const floatInVec &z );
1088
-
1089
- // Copy elements from a 3-D vector into a 3-D point
1090
- //
1091
- explicit VECTORMATH_FORCE_INLINE Point3( const Vector3 &vec );
1092
-
1093
- // Set all elements of a 3-D point to the same scalar value
1094
- //
1095
- explicit VECTORMATH_FORCE_INLINE Point3( float scalar );
1096
-
1097
- // Set all elements of a 3-D point to the same scalar value (scalar data contained in vector data type)
1098
- //
1099
- explicit VECTORMATH_FORCE_INLINE Point3( const floatInVec &scalar );
1100
-
1101
- // Set vector float data in a 3-D point
1102
- //
1103
- explicit VECTORMATH_FORCE_INLINE Point3( __m128 vf4 );
1104
-
1105
- // Get vector float data from a 3-D point
1106
- //
1107
- VECTORMATH_FORCE_INLINE __m128 get128( ) const;
1108
-
1109
- // Assign one 3-D point to another
1110
- //
1111
- VECTORMATH_FORCE_INLINE Point3 & operator =( const Point3 &pnt );
1112
-
1113
- // Set the x element of a 3-D point
1114
- //
1115
- VECTORMATH_FORCE_INLINE Point3 & setX( float x );
1116
-
1117
- // Set the y element of a 3-D point
1118
- //
1119
- VECTORMATH_FORCE_INLINE Point3 & setY( float y );
1120
-
1121
- // Set the z element of a 3-D point
1122
- //
1123
- VECTORMATH_FORCE_INLINE Point3 & setZ( float z );
1124
-
1125
- // Set the x element of a 3-D point (scalar data contained in vector data type)
1126
- //
1127
- VECTORMATH_FORCE_INLINE Point3 & setX( const floatInVec &x );
1128
-
1129
- // Set the y element of a 3-D point (scalar data contained in vector data type)
1130
- //
1131
- VECTORMATH_FORCE_INLINE Point3 & setY( const floatInVec &y );
1132
-
1133
- // Set the z element of a 3-D point (scalar data contained in vector data type)
1134
- //
1135
- VECTORMATH_FORCE_INLINE Point3 & setZ( const floatInVec &z );
1136
-
1137
- // Get the x element of a 3-D point
1138
- //
1139
- VECTORMATH_FORCE_INLINE const floatInVec getX( ) const;
1140
-
1141
- // Get the y element of a 3-D point
1142
- //
1143
- VECTORMATH_FORCE_INLINE const floatInVec getY( ) const;
1144
-
1145
- // Get the z element of a 3-D point
1146
- //
1147
- VECTORMATH_FORCE_INLINE const floatInVec getZ( ) const;
1148
-
1149
- // Set an x, y, or z element of a 3-D point by index
1150
- //
1151
- VECTORMATH_FORCE_INLINE Point3 & setElem( int idx, float value );
1152
-
1153
- // Set an x, y, or z element of a 3-D point by index (scalar data contained in vector data type)
1154
- //
1155
- VECTORMATH_FORCE_INLINE Point3 & setElem( int idx, const floatInVec &value );
1156
-
1157
- // Get an x, y, or z element of a 3-D point by index
1158
- //
1159
- VECTORMATH_FORCE_INLINE const floatInVec getElem( int idx ) const;
1160
-
1161
- // Subscripting operator to set or get an element
1162
- //
1163
- VECTORMATH_FORCE_INLINE VecIdx operator []( int idx );
1164
-
1165
- // Subscripting operator to get an element
1166
- //
1167
- VECTORMATH_FORCE_INLINE const floatInVec operator []( int idx ) const;
1168
-
1169
- // Subtract a 3-D point from another 3-D point
1170
- //
1171
- VECTORMATH_FORCE_INLINE const Vector3 operator -( const Point3 &pnt ) const;
1172
-
1173
- // Add a 3-D point to a 3-D vector
1174
- //
1175
- VECTORMATH_FORCE_INLINE const Point3 operator +( const Vector3 &vec ) const;
1176
-
1177
- // Subtract a 3-D vector from a 3-D point
1178
- //
1179
- VECTORMATH_FORCE_INLINE const Point3 operator -( const Vector3 &vec ) const;
1180
-
1181
- // Perform compound assignment and addition with a 3-D vector
1182
- //
1183
- VECTORMATH_FORCE_INLINE Point3 & operator +=( const Vector3 &vec );
1184
-
1185
- // Perform compound assignment and subtraction by a 3-D vector
1186
- //
1187
- VECTORMATH_FORCE_INLINE Point3 & operator -=( const Vector3 &vec );
1188
-
1189
- };
1190
-
1191
- // Multiply two 3-D points per element
1192
- //
1193
- VECTORMATH_FORCE_INLINE const Point3 mulPerElem( const Point3 &pnt0, const Point3 &pnt1 );
1194
-
1195
- // Divide two 3-D points per element
1196
- // NOTE:
1197
- // Floating-point behavior matches standard library function divf4.
1198
- //
1199
- VECTORMATH_FORCE_INLINE const Point3 divPerElem( const Point3 &pnt0, const Point3 &pnt1 );
1200
-
1201
- // Compute the reciprocal of a 3-D point per element
1202
- // NOTE:
1203
- // Floating-point behavior matches standard library function recipf4.
1204
- //
1205
- VECTORMATH_FORCE_INLINE const Point3 recipPerElem( const Point3 &pnt );
1206
-
1207
- // Compute the absolute value of a 3-D point per element
1208
- //
1209
- VECTORMATH_FORCE_INLINE const Point3 absPerElem( const Point3 &pnt );
1210
-
1211
- // Copy sign from one 3-D point to another, per element
1212
- //
1213
- VECTORMATH_FORCE_INLINE const Point3 copySignPerElem( const Point3 &pnt0, const Point3 &pnt1 );
1214
-
1215
- // Maximum of two 3-D points per element
1216
- //
1217
- VECTORMATH_FORCE_INLINE const Point3 maxPerElem( const Point3 &pnt0, const Point3 &pnt1 );
1218
-
1219
- // Minimum of two 3-D points per element
1220
- //
1221
- VECTORMATH_FORCE_INLINE const Point3 minPerElem( const Point3 &pnt0, const Point3 &pnt1 );
1222
-
1223
- // Maximum element of a 3-D point
1224
- //
1225
- VECTORMATH_FORCE_INLINE const floatInVec maxElem( const Point3 &pnt );
1226
-
1227
- // Minimum element of a 3-D point
1228
- //
1229
- VECTORMATH_FORCE_INLINE const floatInVec minElem( const Point3 &pnt );
1230
-
1231
- // Compute the sum of all elements of a 3-D point
1232
- //
1233
- VECTORMATH_FORCE_INLINE const floatInVec sum( const Point3 &pnt );
1234
-
1235
- // Apply uniform scale to a 3-D point
1236
- //
1237
- VECTORMATH_FORCE_INLINE const Point3 scale( const Point3 &pnt, float scaleVal );
1238
-
1239
- // Apply uniform scale to a 3-D point (scalar data contained in vector data type)
1240
- //
1241
- VECTORMATH_FORCE_INLINE const Point3 scale( const Point3 &pnt, const floatInVec &scaleVal );
1242
-
1243
- // Apply non-uniform scale to a 3-D point
1244
- //
1245
- VECTORMATH_FORCE_INLINE const Point3 scale( const Point3 &pnt, const Vector3 &scaleVec );
1246
-
1247
- // Scalar projection of a 3-D point on a unit-length 3-D vector
1248
- //
1249
- VECTORMATH_FORCE_INLINE const floatInVec projection( const Point3 &pnt, const Vector3 &unitVec );
1250
-
1251
- // Compute the square of the distance of a 3-D point from the coordinate-system origin
1252
- //
1253
- VECTORMATH_FORCE_INLINE const floatInVec distSqrFromOrigin( const Point3 &pnt );
1254
-
1255
- // Compute the distance of a 3-D point from the coordinate-system origin
1256
- //
1257
- VECTORMATH_FORCE_INLINE const floatInVec distFromOrigin( const Point3 &pnt );
1258
-
1259
- // Compute the square of the distance between two 3-D points
1260
- //
1261
- VECTORMATH_FORCE_INLINE const floatInVec distSqr( const Point3 &pnt0, const Point3 &pnt1 );
1262
-
1263
- // Compute the distance between two 3-D points
1264
- //
1265
- VECTORMATH_FORCE_INLINE const floatInVec dist( const Point3 &pnt0, const Point3 &pnt1 );
1266
-
1267
- // Linear interpolation between two 3-D points
1268
- // NOTE:
1269
- // Does not clamp t between 0 and 1.
1270
- //
1271
- VECTORMATH_FORCE_INLINE const Point3 lerp( float t, const Point3 &pnt0, const Point3 &pnt1 );
1272
-
1273
- // Linear interpolation between two 3-D points (scalar data contained in vector data type)
1274
- // NOTE:
1275
- // Does not clamp t between 0 and 1.
1276
- //
1277
- VECTORMATH_FORCE_INLINE const Point3 lerp( const floatInVec &t, const Point3 &pnt0, const Point3 &pnt1 );
1278
-
1279
- // Conditionally select between two 3-D points
1280
- // NOTE:
1281
- // This function uses a conditional select instruction to avoid a branch.
1282
- // However, the transfer of select1 to a VMX register may use more processing time than a branch.
1283
- // Use the boolInVec version for better performance.
1284
- //
1285
- VECTORMATH_FORCE_INLINE const Point3 select( const Point3 &pnt0, const Point3 &pnt1, bool select1 );
1286
-
1287
- // Conditionally select between two 3-D points (scalar data contained in vector data type)
1288
- // NOTE:
1289
- // This function uses a conditional select instruction to avoid a branch.
1290
- //
1291
- VECTORMATH_FORCE_INLINE const Point3 select( const Point3 &pnt0, const Point3 &pnt1, const boolInVec &select1 );
1292
-
1293
- // Store x, y, and z elements of 3-D point in first three words of a quadword, preserving fourth word
1294
- //
1295
- VECTORMATH_FORCE_INLINE void storeXYZ( const Point3 &pnt, __m128 * quad );
1296
-
1297
- // Load four three-float 3-D points, stored in three quadwords
1298
- //
1299
- VECTORMATH_FORCE_INLINE void loadXYZArray( Point3 & pnt0, Point3 & pnt1, Point3 & pnt2, Point3 & pnt3, const __m128 * threeQuads );
1300
-
1301
- // Store four 3-D points in three quadwords
1302
- //
1303
- VECTORMATH_FORCE_INLINE void storeXYZArray( const Point3 &pnt0, const Point3 &pnt1, const Point3 &pnt2, const Point3 &pnt3, __m128 * threeQuads );
1304
-
1305
- // Store eight 3-D points as half-floats
1306
- //
1307
- VECTORMATH_FORCE_INLINE void storeHalfFloats( const Point3 &pnt0, const Point3 &pnt1, const Point3 &pnt2, const Point3 &pnt3, const Point3 &pnt4, const Point3 &pnt5, const Point3 &pnt6, const Point3 &pnt7, vec_ushort8 * threeQuads );
1308
-
1309
- #ifdef _VECTORMATH_DEBUG
1310
-
1311
- // Print a 3-D point
1312
- // NOTE:
1313
- // Function is only defined when _VECTORMATH_DEBUG is defined.
1314
- //
1315
- VECTORMATH_FORCE_INLINE void print( const Point3 &pnt );
1316
-
1317
- // Print a 3-D point and an associated string identifier
1318
- // NOTE:
1319
- // Function is only defined when _VECTORMATH_DEBUG is defined.
1320
- //
1321
- VECTORMATH_FORCE_INLINE void print( const Point3 &pnt, const char * name );
1322
-
1323
- #endif
1324
-
1325
- // A quaternion in array-of-structures format
1326
- //
1327
- class Quat
1328
- {
1329
- __m128 mVec128;
1330
-
1331
- public:
1332
- // Default constructor; does no initialization
1333
- //
1334
- VECTORMATH_FORCE_INLINE Quat( ) { };
1335
-
1336
- VECTORMATH_FORCE_INLINE Quat(const Quat& quat);
1337
-
1338
- // Construct a quaternion from x, y, z, and w elements
1339
- //
1340
- VECTORMATH_FORCE_INLINE Quat( float x, float y, float z, float w );
1341
-
1342
- // Construct a quaternion from x, y, z, and w elements (scalar data contained in vector data type)
1343
- //
1344
- VECTORMATH_FORCE_INLINE Quat( const floatInVec &x, const floatInVec &y, const floatInVec &z, const floatInVec &w );
1345
-
1346
- // Construct a quaternion from a 3-D vector and a scalar
1347
- //
1348
- VECTORMATH_FORCE_INLINE Quat( const Vector3 &xyz, float w );
1349
-
1350
- // Construct a quaternion from a 3-D vector and a scalar (scalar data contained in vector data type)
1351
- //
1352
- VECTORMATH_FORCE_INLINE Quat( const Vector3 &xyz, const floatInVec &w );
1353
-
1354
- // Copy elements from a 4-D vector into a quaternion
1355
- //
1356
- explicit VECTORMATH_FORCE_INLINE Quat( const Vector4 &vec );
1357
-
1358
- // Convert a rotation matrix to a unit-length quaternion
1359
- //
1360
- explicit VECTORMATH_FORCE_INLINE Quat( const Matrix3 & rotMat );
1361
-
1362
- // Set all elements of a quaternion to the same scalar value
1363
- //
1364
- explicit VECTORMATH_FORCE_INLINE Quat( float scalar );
1365
-
1366
- // Set all elements of a quaternion to the same scalar value (scalar data contained in vector data type)
1367
- //
1368
- explicit VECTORMATH_FORCE_INLINE Quat( const floatInVec &scalar );
1369
-
1370
- // Set vector float data in a quaternion
1371
- //
1372
- explicit VECTORMATH_FORCE_INLINE Quat( __m128 vf4 );
1373
-
1374
- // Get vector float data from a quaternion
1375
- //
1376
- VECTORMATH_FORCE_INLINE __m128 get128( ) const;
1377
-
1378
- // Set a quaterion from vector float data
1379
- //
1380
- VECTORMATH_FORCE_INLINE void set128(vec_float4 vec);
1381
-
1382
- // Assign one quaternion to another
1383
- //
1384
- VECTORMATH_FORCE_INLINE Quat & operator =( const Quat &quat );
1385
-
1386
- // Set the x, y, and z elements of a quaternion
1387
- // NOTE:
1388
- // This function does not change the w element.
1389
- //
1390
- VECTORMATH_FORCE_INLINE Quat & setXYZ( const Vector3 &vec );
1391
-
1392
- // Get the x, y, and z elements of a quaternion
1393
- //
1394
- VECTORMATH_FORCE_INLINE const Vector3 getXYZ( ) const;
1395
-
1396
- // Set the x element of a quaternion
1397
- //
1398
- VECTORMATH_FORCE_INLINE Quat & setX( float x );
1399
-
1400
- // Set the y element of a quaternion
1401
- //
1402
- VECTORMATH_FORCE_INLINE Quat & setY( float y );
1403
-
1404
- // Set the z element of a quaternion
1405
- //
1406
- VECTORMATH_FORCE_INLINE Quat & setZ( float z );
1407
-
1408
- // Set the w element of a quaternion
1409
- //
1410
- VECTORMATH_FORCE_INLINE Quat & setW( float w );
1411
-
1412
- // Set the x element of a quaternion (scalar data contained in vector data type)
1413
- //
1414
- VECTORMATH_FORCE_INLINE Quat & setX( const floatInVec &x );
1415
-
1416
- // Set the y element of a quaternion (scalar data contained in vector data type)
1417
- //
1418
- VECTORMATH_FORCE_INLINE Quat & setY( const floatInVec &y );
1419
-
1420
- // Set the z element of a quaternion (scalar data contained in vector data type)
1421
- //
1422
- VECTORMATH_FORCE_INLINE Quat & setZ( const floatInVec &z );
1423
-
1424
- // Set the w element of a quaternion (scalar data contained in vector data type)
1425
- //
1426
- VECTORMATH_FORCE_INLINE Quat & setW( const floatInVec &w );
1427
-
1428
- // Get the x element of a quaternion
1429
- //
1430
- VECTORMATH_FORCE_INLINE const floatInVec getX( ) const;
1431
-
1432
- // Get the y element of a quaternion
1433
- //
1434
- VECTORMATH_FORCE_INLINE const floatInVec getY( ) const;
1435
-
1436
- // Get the z element of a quaternion
1437
- //
1438
- VECTORMATH_FORCE_INLINE const floatInVec getZ( ) const;
1439
-
1440
- // Get the w element of a quaternion
1441
- //
1442
- VECTORMATH_FORCE_INLINE const floatInVec getW( ) const;
1443
-
1444
- // Set an x, y, z, or w element of a quaternion by index
1445
- //
1446
- VECTORMATH_FORCE_INLINE Quat & setElem( int idx, float value );
1447
-
1448
- // Set an x, y, z, or w element of a quaternion by index (scalar data contained in vector data type)
1449
- //
1450
- VECTORMATH_FORCE_INLINE Quat & setElem( int idx, const floatInVec &value );
1451
-
1452
- // Get an x, y, z, or w element of a quaternion by index
1453
- //
1454
- VECTORMATH_FORCE_INLINE const floatInVec getElem( int idx ) const;
1455
-
1456
- // Subscripting operator to set or get an element
1457
- //
1458
- VECTORMATH_FORCE_INLINE VecIdx operator []( int idx );
1459
-
1460
- // Subscripting operator to get an element
1461
- //
1462
- VECTORMATH_FORCE_INLINE const floatInVec operator []( int idx ) const;
1463
-
1464
- // Add two quaternions
1465
- //
1466
- VECTORMATH_FORCE_INLINE const Quat operator +( const Quat &quat ) const;
1467
-
1468
- // Subtract a quaternion from another quaternion
1469
- //
1470
- VECTORMATH_FORCE_INLINE const Quat operator -( const Quat &quat ) const;
1471
-
1472
- // Multiply two quaternions
1473
- //
1474
- VECTORMATH_FORCE_INLINE const Quat operator *( const Quat &quat ) const;
1475
-
1476
- // Multiply a quaternion by a scalar
1477
- //
1478
- VECTORMATH_FORCE_INLINE const Quat operator *( float scalar ) const;
1479
-
1480
- // Divide a quaternion by a scalar
1481
- //
1482
- VECTORMATH_FORCE_INLINE const Quat operator /( float scalar ) const;
1483
-
1484
- // Multiply a quaternion by a scalar (scalar data contained in vector data type)
1485
- //
1486
- VECTORMATH_FORCE_INLINE const Quat operator *( const floatInVec &scalar ) const;
1487
-
1488
- // Divide a quaternion by a scalar (scalar data contained in vector data type)
1489
- //
1490
- VECTORMATH_FORCE_INLINE const Quat operator /( const floatInVec &scalar ) const;
1491
-
1492
- // Perform compound assignment and addition with a quaternion
1493
- //
1494
- VECTORMATH_FORCE_INLINE Quat & operator +=( const Quat &quat );
1495
-
1496
- // Perform compound assignment and subtraction by a quaternion
1497
- //
1498
- VECTORMATH_FORCE_INLINE Quat & operator -=( const Quat &quat );
1499
-
1500
- // Perform compound assignment and multiplication by a quaternion
1501
- //
1502
- VECTORMATH_FORCE_INLINE Quat & operator *=( const Quat &quat );
1503
-
1504
- // Perform compound assignment and multiplication by a scalar
1505
- //
1506
- VECTORMATH_FORCE_INLINE Quat & operator *=( float scalar );
1507
-
1508
- // Perform compound assignment and division by a scalar
1509
- //
1510
- VECTORMATH_FORCE_INLINE Quat & operator /=( float scalar );
1511
-
1512
- // Perform compound assignment and multiplication by a scalar (scalar data contained in vector data type)
1513
- //
1514
- VECTORMATH_FORCE_INLINE Quat & operator *=( const floatInVec &scalar );
1515
-
1516
- // Perform compound assignment and division by a scalar (scalar data contained in vector data type)
1517
- //
1518
- VECTORMATH_FORCE_INLINE Quat & operator /=( const floatInVec &scalar );
1519
-
1520
- // Negate all elements of a quaternion
1521
- //
1522
- VECTORMATH_FORCE_INLINE const Quat operator -( ) const;
1523
-
1524
- // Construct an identity quaternion
1525
- //
1526
- static VECTORMATH_FORCE_INLINE const Quat identity( );
1527
-
1528
- // Construct a quaternion to rotate between two unit-length 3-D vectors
1529
- // NOTE:
1530
- // The result is unpredictable if unitVec0 and unitVec1 point in opposite directions.
1531
- //
1532
- static VECTORMATH_FORCE_INLINE const Quat rotation( const Vector3 &unitVec0, const Vector3 &unitVec1 );
1533
-
1534
- // Construct a quaternion to rotate around a unit-length 3-D vector
1535
- //
1536
- static VECTORMATH_FORCE_INLINE const Quat rotation( float radians, const Vector3 &unitVec );
1537
-
1538
- // Construct a quaternion to rotate around a unit-length 3-D vector (scalar data contained in vector data type)
1539
- //
1540
- static VECTORMATH_FORCE_INLINE const Quat rotation( const floatInVec &radians, const Vector3 &unitVec );
1541
-
1542
- // Construct a quaternion to rotate around the x axis
1543
- //
1544
- static VECTORMATH_FORCE_INLINE const Quat rotationX( float radians );
1545
-
1546
- // Construct a quaternion to rotate around the y axis
1547
- //
1548
- static VECTORMATH_FORCE_INLINE const Quat rotationY( float radians );
1549
-
1550
- // Construct a quaternion to rotate around the z axis
1551
- //
1552
- static VECTORMATH_FORCE_INLINE const Quat rotationZ( float radians );
1553
-
1554
- // Construct a quaternion to rotate around the x axis (scalar data contained in vector data type)
1555
- //
1556
- static VECTORMATH_FORCE_INLINE const Quat rotationX( const floatInVec &radians );
1557
-
1558
- // Construct a quaternion to rotate around the y axis (scalar data contained in vector data type)
1559
- //
1560
- static VECTORMATH_FORCE_INLINE const Quat rotationY( const floatInVec &radians );
1561
-
1562
- // Construct a quaternion to rotate around the z axis (scalar data contained in vector data type)
1563
- //
1564
- static VECTORMATH_FORCE_INLINE const Quat rotationZ( const floatInVec &radians );
1565
-
1566
- };
1567
-
1568
- // Multiply a quaternion by a scalar
1569
- //
1570
- VECTORMATH_FORCE_INLINE const Quat operator *( float scalar, const Quat &quat );
1571
-
1572
- // Multiply a quaternion by a scalar (scalar data contained in vector data type)
1573
- //
1574
- VECTORMATH_FORCE_INLINE const Quat operator *( const floatInVec &scalar, const Quat &quat );
1575
-
1576
- // Compute the conjugate of a quaternion
1577
- //
1578
- VECTORMATH_FORCE_INLINE const Quat conj( const Quat &quat );
1579
-
1580
- // Use a unit-length quaternion to rotate a 3-D vector
1581
- //
1582
- VECTORMATH_FORCE_INLINE const Vector3 rotate( const Quat &unitQuat, const Vector3 &vec );
1583
-
1584
- // Compute the dot product of two quaternions
1585
- //
1586
- VECTORMATH_FORCE_INLINE const floatInVec dot( const Quat &quat0, const Quat &quat1 );
1587
-
1588
- // Compute the norm of a quaternion
1589
- //
1590
- VECTORMATH_FORCE_INLINE const floatInVec norm( const Quat &quat );
1591
-
1592
- // Compute the length of a quaternion
1593
- //
1594
- VECTORMATH_FORCE_INLINE const floatInVec length( const Quat &quat );
1595
-
1596
- // Normalize a quaternion
1597
- // NOTE:
1598
- // The result is unpredictable when all elements of quat are at or near zero.
1599
- //
1600
- VECTORMATH_FORCE_INLINE const Quat normalize( const Quat &quat );
1601
-
1602
- // Linear interpolation between two quaternions
1603
- // NOTE:
1604
- // Does not clamp t between 0 and 1.
1605
- //
1606
- VECTORMATH_FORCE_INLINE const Quat lerp( float t, const Quat &quat0, const Quat &quat1 );
1607
-
1608
- // Linear interpolation between two quaternions (scalar data contained in vector data type)
1609
- // NOTE:
1610
- // Does not clamp t between 0 and 1.
1611
- //
1612
- VECTORMATH_FORCE_INLINE const Quat lerp( const floatInVec &t, const Quat &quat0, const Quat &quat1 );
1613
-
1614
- // Spherical linear interpolation between two quaternions
1615
- // NOTE:
1616
- // Interpolates along the shortest path between orientations.
1617
- // Does not clamp t between 0 and 1.
1618
- //
1619
- VECTORMATH_FORCE_INLINE const Quat slerp( float t, const Quat &unitQuat0, const Quat &unitQuat1 );
1620
-
1621
- // Spherical linear interpolation between two quaternions (scalar data contained in vector data type)
1622
- // NOTE:
1623
- // Interpolates along the shortest path between orientations.
1624
- // Does not clamp t between 0 and 1.
1625
- //
1626
- VECTORMATH_FORCE_INLINE const Quat slerp( const floatInVec &t, const Quat &unitQuat0, const Quat &unitQuat1 );
1627
-
1628
- // Spherical quadrangle interpolation
1629
- //
1630
- VECTORMATH_FORCE_INLINE const Quat squad( float t, const Quat &unitQuat0, const Quat &unitQuat1, const Quat &unitQuat2, const Quat &unitQuat3 );
1631
-
1632
- // Spherical quadrangle interpolation (scalar data contained in vector data type)
1633
- //
1634
- VECTORMATH_FORCE_INLINE const Quat squad( const floatInVec &t, const Quat &unitQuat0, const Quat &unitQuat1, const Quat &unitQuat2, const Quat &unitQuat3 );
1635
-
1636
- // Conditionally select between two quaternions
1637
- // NOTE:
1638
- // This function uses a conditional select instruction to avoid a branch.
1639
- // However, the transfer of select1 to a VMX register may use more processing time than a branch.
1640
- // Use the boolInVec version for better performance.
1641
- //
1642
- VECTORMATH_FORCE_INLINE const Quat select( const Quat &quat0, const Quat &quat1, bool select1 );
1643
-
1644
- // Conditionally select between two quaternions (scalar data contained in vector data type)
1645
- // NOTE:
1646
- // This function uses a conditional select instruction to avoid a branch.
1647
- //
1648
- VECTORMATH_FORCE_INLINE const Quat select( const Quat &quat0, const Quat &quat1, const boolInVec &select1 );
1649
-
1650
- #ifdef _VECTORMATH_DEBUG
1651
-
1652
- // Print a quaternion
1653
- // NOTE:
1654
- // Function is only defined when _VECTORMATH_DEBUG is defined.
1655
- //
1656
- VECTORMATH_FORCE_INLINE void print( const Quat &quat );
1657
-
1658
- // Print a quaternion and an associated string identifier
1659
- // NOTE:
1660
- // Function is only defined when _VECTORMATH_DEBUG is defined.
1661
- //
1662
- VECTORMATH_FORCE_INLINE void print( const Quat &quat, const char * name );
1663
-
1664
- #endif
1665
-
1666
- // A 3x3 matrix in array-of-structures format
1667
- //
1668
- class Matrix3
1669
- {
1670
- Vector3 mCol0;
1671
- Vector3 mCol1;
1672
- Vector3 mCol2;
1673
-
1674
- public:
1675
- // Default constructor; does no initialization
1676
- //
1677
- VECTORMATH_FORCE_INLINE Matrix3( ) { };
1678
-
1679
- // Copy a 3x3 matrix
1680
- //
1681
- VECTORMATH_FORCE_INLINE Matrix3( const Matrix3 & mat );
1682
-
1683
- // Construct a 3x3 matrix containing the specified columns
1684
- //
1685
- VECTORMATH_FORCE_INLINE Matrix3( const Vector3 &col0, const Vector3 &col1, const Vector3 &col2 );
1686
-
1687
- // Construct a 3x3 rotation matrix from a unit-length quaternion
1688
- //
1689
- explicit VECTORMATH_FORCE_INLINE Matrix3( const Quat &unitQuat );
1690
-
1691
- // Set all elements of a 3x3 matrix to the same scalar value
1692
- //
1693
- explicit VECTORMATH_FORCE_INLINE Matrix3( float scalar );
1694
-
1695
- // Set all elements of a 3x3 matrix to the same scalar value (scalar data contained in vector data type)
1696
- //
1697
- explicit VECTORMATH_FORCE_INLINE Matrix3( const floatInVec &scalar );
1698
-
1699
- // Assign one 3x3 matrix to another
1700
- //
1701
- VECTORMATH_FORCE_INLINE Matrix3 & operator =( const Matrix3 & mat );
1702
-
1703
- // Set column 0 of a 3x3 matrix
1704
- //
1705
- VECTORMATH_FORCE_INLINE Matrix3 & setCol0( const Vector3 &col0 );
1706
-
1707
- // Set column 1 of a 3x3 matrix
1708
- //
1709
- VECTORMATH_FORCE_INLINE Matrix3 & setCol1( const Vector3 &col1 );
1710
-
1711
- // Set column 2 of a 3x3 matrix
1712
- //
1713
- VECTORMATH_FORCE_INLINE Matrix3 & setCol2( const Vector3 &col2 );
1714
-
1715
- // Get column 0 of a 3x3 matrix
1716
- //
1717
- VECTORMATH_FORCE_INLINE const Vector3 getCol0( ) const;
1718
-
1719
- // Get column 1 of a 3x3 matrix
1720
- //
1721
- VECTORMATH_FORCE_INLINE const Vector3 getCol1( ) const;
1722
-
1723
- // Get column 2 of a 3x3 matrix
1724
- //
1725
- VECTORMATH_FORCE_INLINE const Vector3 getCol2( ) const;
1726
-
1727
- // Set the column of a 3x3 matrix referred to by the specified index
1728
- //
1729
- VECTORMATH_FORCE_INLINE Matrix3 & setCol( int col, const Vector3 &vec );
1730
-
1731
- // Set the row of a 3x3 matrix referred to by the specified index
1732
- //
1733
- VECTORMATH_FORCE_INLINE Matrix3 & setRow( int row, const Vector3 &vec );
1734
-
1735
- // Get the column of a 3x3 matrix referred to by the specified index
1736
- //
1737
- VECTORMATH_FORCE_INLINE const Vector3 getCol( int col ) const;
1738
-
1739
- // Get the row of a 3x3 matrix referred to by the specified index
1740
- //
1741
- VECTORMATH_FORCE_INLINE const Vector3 getRow( int row ) const;
1742
-
1743
- // Subscripting operator to set or get a column
1744
- //
1745
- VECTORMATH_FORCE_INLINE Vector3 & operator []( int col );
1746
-
1747
- // Subscripting operator to get a column
1748
- //
1749
- VECTORMATH_FORCE_INLINE const Vector3 operator []( int col ) const;
1750
-
1751
- // Set the element of a 3x3 matrix referred to by column and row indices
1752
- //
1753
- VECTORMATH_FORCE_INLINE Matrix3 & setElem( int col, int row, float val );
1754
-
1755
- // Set the element of a 3x3 matrix referred to by column and row indices (scalar data contained in vector data type)
1756
- //
1757
- VECTORMATH_FORCE_INLINE Matrix3 & setElem( int col, int row, const floatInVec &val );
1758
-
1759
- // Get the element of a 3x3 matrix referred to by column and row indices
1760
- //
1761
- VECTORMATH_FORCE_INLINE const floatInVec getElem( int col, int row ) const;
1762
-
1763
- // Add two 3x3 matrices
1764
- //
1765
- VECTORMATH_FORCE_INLINE const Matrix3 operator +( const Matrix3 & mat ) const;
1766
-
1767
- // Subtract a 3x3 matrix from another 3x3 matrix
1768
- //
1769
- VECTORMATH_FORCE_INLINE const Matrix3 operator -( const Matrix3 & mat ) const;
1770
-
1771
- // Negate all elements of a 3x3 matrix
1772
- //
1773
- VECTORMATH_FORCE_INLINE const Matrix3 operator -( ) const;
1774
-
1775
- // Multiply a 3x3 matrix by a scalar
1776
- //
1777
- VECTORMATH_FORCE_INLINE const Matrix3 operator *( float scalar ) const;
1778
-
1779
- // Multiply a 3x3 matrix by a scalar (scalar data contained in vector data type)
1780
- //
1781
- VECTORMATH_FORCE_INLINE const Matrix3 operator *( const floatInVec &scalar ) const;
1782
-
1783
- // Multiply a 3x3 matrix by a 3-D vector
1784
- //
1785
- VECTORMATH_FORCE_INLINE const Vector3 operator *( const Vector3 &vec ) const;
1786
-
1787
- // Multiply two 3x3 matrices
1788
- //
1789
- VECTORMATH_FORCE_INLINE const Matrix3 operator *( const Matrix3 & mat ) const;
1790
-
1791
- // Perform compound assignment and addition with a 3x3 matrix
1792
- //
1793
- VECTORMATH_FORCE_INLINE Matrix3 & operator +=( const Matrix3 & mat );
1794
-
1795
- // Perform compound assignment and subtraction by a 3x3 matrix
1796
- //
1797
- VECTORMATH_FORCE_INLINE Matrix3 & operator -=( const Matrix3 & mat );
1798
-
1799
- // Perform compound assignment and multiplication by a scalar
1800
- //
1801
- VECTORMATH_FORCE_INLINE Matrix3 & operator *=( float scalar );
1802
-
1803
- // Perform compound assignment and multiplication by a scalar (scalar data contained in vector data type)
1804
- //
1805
- VECTORMATH_FORCE_INLINE Matrix3 & operator *=( const floatInVec &scalar );
1806
-
1807
- // Perform compound assignment and multiplication by a 3x3 matrix
1808
- //
1809
- VECTORMATH_FORCE_INLINE Matrix3 & operator *=( const Matrix3 & mat );
1810
-
1811
- // Construct an identity 3x3 matrix
1812
- //
1813
- static VECTORMATH_FORCE_INLINE const Matrix3 identity( );
1814
-
1815
- // Construct a 3x3 matrix to rotate around the x axis
1816
- //
1817
- static VECTORMATH_FORCE_INLINE const Matrix3 rotationX( float radians );
1818
-
1819
- // Construct a 3x3 matrix to rotate around the y axis
1820
- //
1821
- static VECTORMATH_FORCE_INLINE const Matrix3 rotationY( float radians );
1822
-
1823
- // Construct a 3x3 matrix to rotate around the z axis
1824
- //
1825
- static VECTORMATH_FORCE_INLINE const Matrix3 rotationZ( float radians );
1826
-
1827
- // Construct a 3x3 matrix to rotate around the x axis (scalar data contained in vector data type)
1828
- //
1829
- static VECTORMATH_FORCE_INLINE const Matrix3 rotationX( const floatInVec &radians );
1830
-
1831
- // Construct a 3x3 matrix to rotate around the y axis (scalar data contained in vector data type)
1832
- //
1833
- static VECTORMATH_FORCE_INLINE const Matrix3 rotationY( const floatInVec &radians );
1834
-
1835
- // Construct a 3x3 matrix to rotate around the z axis (scalar data contained in vector data type)
1836
- //
1837
- static VECTORMATH_FORCE_INLINE const Matrix3 rotationZ( const floatInVec &radians );
1838
-
1839
- // Construct a 3x3 matrix to rotate around the x, y, and z axes
1840
- //
1841
- static VECTORMATH_FORCE_INLINE const Matrix3 rotationZYX( const Vector3 &radiansXYZ );
1842
-
1843
- // Construct a 3x3 matrix to rotate around a unit-length 3-D vector
1844
- //
1845
- static VECTORMATH_FORCE_INLINE const Matrix3 rotation( float radians, const Vector3 &unitVec );
1846
-
1847
- // Construct a 3x3 matrix to rotate around a unit-length 3-D vector (scalar data contained in vector data type)
1848
- //
1849
- static VECTORMATH_FORCE_INLINE const Matrix3 rotation( const floatInVec &radians, const Vector3 &unitVec );
1850
-
1851
- // Construct a rotation matrix from a unit-length quaternion
1852
- //
1853
- static VECTORMATH_FORCE_INLINE const Matrix3 rotation( const Quat &unitQuat );
1854
-
1855
- // Construct a 3x3 matrix to perform scaling
1856
- //
1857
- static VECTORMATH_FORCE_INLINE const Matrix3 scale( const Vector3 &scaleVec );
1858
-
1859
- };
1860
- // Multiply a 3x3 matrix by a scalar
1861
- //
1862
- VECTORMATH_FORCE_INLINE const Matrix3 operator *( float scalar, const Matrix3 & mat );
1863
-
1864
- // Multiply a 3x3 matrix by a scalar (scalar data contained in vector data type)
1865
- //
1866
- VECTORMATH_FORCE_INLINE const Matrix3 operator *( const floatInVec &scalar, const Matrix3 & mat );
1867
-
1868
- // Append (post-multiply) a scale transformation to a 3x3 matrix
1869
- // NOTE:
1870
- // Faster than creating and multiplying a scale transformation matrix.
1871
- //
1872
- VECTORMATH_FORCE_INLINE const Matrix3 appendScale( const Matrix3 & mat, const Vector3 &scaleVec );
1873
-
1874
- // Prepend (pre-multiply) a scale transformation to a 3x3 matrix
1875
- // NOTE:
1876
- // Faster than creating and multiplying a scale transformation matrix.
1877
- //
1878
- VECTORMATH_FORCE_INLINE const Matrix3 prependScale( const Vector3 &scaleVec, const Matrix3 & mat );
1879
-
1880
- // Multiply two 3x3 matrices per element
1881
- //
1882
- VECTORMATH_FORCE_INLINE const Matrix3 mulPerElem( const Matrix3 & mat0, const Matrix3 & mat1 );
1883
-
1884
- // Compute the absolute value of a 3x3 matrix per element
1885
- //
1886
- VECTORMATH_FORCE_INLINE const Matrix3 absPerElem( const Matrix3 & mat );
1887
-
1888
- // Transpose of a 3x3 matrix
1889
- //
1890
- VECTORMATH_FORCE_INLINE const Matrix3 transpose( const Matrix3 & mat );
1891
-
1892
- // Compute the inverse of a 3x3 matrix
1893
- // NOTE:
1894
- // Result is unpredictable when the determinant of mat is equal to or near 0.
1895
- //
1896
- VECTORMATH_FORCE_INLINE const Matrix3 inverse( const Matrix3 & mat );
1897
-
1898
- // Determinant of a 3x3 matrix
1899
- //
1900
- VECTORMATH_FORCE_INLINE const floatInVec determinant( const Matrix3 & mat );
1901
-
1902
- // Conditionally select between two 3x3 matrices
1903
- // NOTE:
1904
- // This function uses a conditional select instruction to avoid a branch.
1905
- // However, the transfer of select1 to a VMX register may use more processing time than a branch.
1906
- // Use the boolInVec version for better performance.
1907
- //
1908
- VECTORMATH_FORCE_INLINE const Matrix3 select( const Matrix3 & mat0, const Matrix3 & mat1, bool select1 );
1909
-
1910
- // Conditionally select between two 3x3 matrices (scalar data contained in vector data type)
1911
- // NOTE:
1912
- // This function uses a conditional select instruction to avoid a branch.
1913
- //
1914
- VECTORMATH_FORCE_INLINE const Matrix3 select( const Matrix3 & mat0, const Matrix3 & mat1, const boolInVec &select1 );
1915
-
1916
- #ifdef _VECTORMATH_DEBUG
1917
-
1918
- // Print a 3x3 matrix
1919
- // NOTE:
1920
- // Function is only defined when _VECTORMATH_DEBUG is defined.
1921
- //
1922
- VECTORMATH_FORCE_INLINE void print( const Matrix3 & mat );
1923
-
1924
- // Print a 3x3 matrix and an associated string identifier
1925
- // NOTE:
1926
- // Function is only defined when _VECTORMATH_DEBUG is defined.
1927
- //
1928
- VECTORMATH_FORCE_INLINE void print( const Matrix3 & mat, const char * name );
1929
-
1930
- #endif
1931
-
1932
- // A 4x4 matrix in array-of-structures format
1933
- //
1934
- class Matrix4
1935
- {
1936
- Vector4 mCol0;
1937
- Vector4 mCol1;
1938
- Vector4 mCol2;
1939
- Vector4 mCol3;
1940
-
1941
- public:
1942
- // Default constructor; does no initialization
1943
- //
1944
- VECTORMATH_FORCE_INLINE Matrix4( ) { };
1945
-
1946
- // Copy a 4x4 matrix
1947
- //
1948
- VECTORMATH_FORCE_INLINE Matrix4( const Matrix4 & mat );
1949
-
1950
- // Construct a 4x4 matrix containing the specified columns
1951
- //
1952
- VECTORMATH_FORCE_INLINE Matrix4( const Vector4 &col0, const Vector4 &col1, const Vector4 &col2, const Vector4 &col3 );
1953
-
1954
- // Construct a 4x4 matrix from a 3x4 transformation matrix
1955
- //
1956
- explicit VECTORMATH_FORCE_INLINE Matrix4( const Transform3 & mat );
1957
-
1958
- // Construct a 4x4 matrix from a 3x3 matrix and a 3-D vector
1959
- //
1960
- VECTORMATH_FORCE_INLINE Matrix4( const Matrix3 & mat, const Vector3 &translateVec );
1961
-
1962
- // Construct a 4x4 matrix from a unit-length quaternion and a 3-D vector
1963
- //
1964
- VECTORMATH_FORCE_INLINE Matrix4( const Quat &unitQuat, const Vector3 &translateVec );
1965
-
1966
- // Set all elements of a 4x4 matrix to the same scalar value
1967
- //
1968
- explicit VECTORMATH_FORCE_INLINE Matrix4( float scalar );
1969
-
1970
- // Set all elements of a 4x4 matrix to the same scalar value (scalar data contained in vector data type)
1971
- //
1972
- explicit VECTORMATH_FORCE_INLINE Matrix4( const floatInVec &scalar );
1973
-
1974
- // Assign one 4x4 matrix to another
1975
- //
1976
- VECTORMATH_FORCE_INLINE Matrix4 & operator =( const Matrix4 & mat );
1977
-
1978
- // Set the upper-left 3x3 submatrix
1979
- // NOTE:
1980
- // This function does not change the bottom row elements.
1981
- //
1982
- VECTORMATH_FORCE_INLINE Matrix4 & setUpper3x3( const Matrix3 & mat3 );
1983
-
1984
- // Get the upper-left 3x3 submatrix of a 4x4 matrix
1985
- //
1986
- VECTORMATH_FORCE_INLINE const Matrix3 getUpper3x3( ) const;
1987
-
1988
- // Set translation component
1989
- // NOTE:
1990
- // This function does not change the bottom row elements.
1991
- //
1992
- VECTORMATH_FORCE_INLINE Matrix4 & setTranslation( const Vector3 &translateVec );
1993
-
1994
- // Get the translation component of a 4x4 matrix
1995
- //
1996
- VECTORMATH_FORCE_INLINE const Vector3 getTranslation( ) const;
1997
-
1998
- // Set column 0 of a 4x4 matrix
1999
- //
2000
- VECTORMATH_FORCE_INLINE Matrix4 & setCol0( const Vector4 &col0 );
2001
-
2002
- // Set column 1 of a 4x4 matrix
2003
- //
2004
- VECTORMATH_FORCE_INLINE Matrix4 & setCol1( const Vector4 &col1 );
2005
-
2006
- // Set column 2 of a 4x4 matrix
2007
- //
2008
- VECTORMATH_FORCE_INLINE Matrix4 & setCol2( const Vector4 &col2 );
2009
-
2010
- // Set column 3 of a 4x4 matrix
2011
- //
2012
- VECTORMATH_FORCE_INLINE Matrix4 & setCol3( const Vector4 &col3 );
2013
-
2014
- // Get column 0 of a 4x4 matrix
2015
- //
2016
- VECTORMATH_FORCE_INLINE const Vector4 getCol0( ) const;
2017
-
2018
- // Get column 1 of a 4x4 matrix
2019
- //
2020
- VECTORMATH_FORCE_INLINE const Vector4 getCol1( ) const;
2021
-
2022
- // Get column 2 of a 4x4 matrix
2023
- //
2024
- VECTORMATH_FORCE_INLINE const Vector4 getCol2( ) const;
2025
-
2026
- // Get column 3 of a 4x4 matrix
2027
- //
2028
- VECTORMATH_FORCE_INLINE const Vector4 getCol3( ) const;
2029
-
2030
- // Set the column of a 4x4 matrix referred to by the specified index
2031
- //
2032
- VECTORMATH_FORCE_INLINE Matrix4 & setCol( int col, const Vector4 &vec );
2033
-
2034
- // Set the row of a 4x4 matrix referred to by the specified index
2035
- //
2036
- VECTORMATH_FORCE_INLINE Matrix4 & setRow( int row, const Vector4 &vec );
2037
-
2038
- // Get the column of a 4x4 matrix referred to by the specified index
2039
- //
2040
- VECTORMATH_FORCE_INLINE const Vector4 getCol( int col ) const;
2041
-
2042
- // Get the row of a 4x4 matrix referred to by the specified index
2043
- //
2044
- VECTORMATH_FORCE_INLINE const Vector4 getRow( int row ) const;
2045
-
2046
- // Subscripting operator to set or get a column
2047
- //
2048
- VECTORMATH_FORCE_INLINE Vector4 & operator []( int col );
2049
-
2050
- // Subscripting operator to get a column
2051
- //
2052
- VECTORMATH_FORCE_INLINE const Vector4 operator []( int col ) const;
2053
-
2054
- // Set the element of a 4x4 matrix referred to by column and row indices
2055
- //
2056
- VECTORMATH_FORCE_INLINE Matrix4 & setElem( int col, int row, float val );
2057
-
2058
- // Set the element of a 4x4 matrix referred to by column and row indices (scalar data contained in vector data type)
2059
- //
2060
- VECTORMATH_FORCE_INLINE Matrix4 & setElem( int col, int row, const floatInVec &val );
2061
-
2062
- // Get the element of a 4x4 matrix referred to by column and row indices
2063
- //
2064
- VECTORMATH_FORCE_INLINE const floatInVec getElem( int col, int row ) const;
2065
-
2066
- // Add two 4x4 matrices
2067
- //
2068
- VECTORMATH_FORCE_INLINE const Matrix4 operator +( const Matrix4 & mat ) const;
2069
-
2070
- // Subtract a 4x4 matrix from another 4x4 matrix
2071
- //
2072
- VECTORMATH_FORCE_INLINE const Matrix4 operator -( const Matrix4 & mat ) const;
2073
-
2074
- // Negate all elements of a 4x4 matrix
2075
- //
2076
- VECTORMATH_FORCE_INLINE const Matrix4 operator -( ) const;
2077
-
2078
- // Multiply a 4x4 matrix by a scalar
2079
- //
2080
- VECTORMATH_FORCE_INLINE const Matrix4 operator *( float scalar ) const;
2081
-
2082
- // Multiply a 4x4 matrix by a scalar (scalar data contained in vector data type)
2083
- //
2084
- VECTORMATH_FORCE_INLINE const Matrix4 operator *( const floatInVec &scalar ) const;
2085
-
2086
- // Multiply a 4x4 matrix by a 4-D vector
2087
- //
2088
- VECTORMATH_FORCE_INLINE const Vector4 operator *( const Vector4 &vec ) const;
2089
-
2090
- // Multiply a 4x4 matrix by a 3-D vector
2091
- //
2092
- VECTORMATH_FORCE_INLINE const Vector4 operator *( const Vector3 &vec ) const;
2093
-
2094
- // Multiply a 4x4 matrix by a 3-D point
2095
- //
2096
- VECTORMATH_FORCE_INLINE const Vector4 operator *( const Point3 &pnt ) const;
2097
-
2098
- // Multiply two 4x4 matrices
2099
- //
2100
- VECTORMATH_FORCE_INLINE const Matrix4 operator *( const Matrix4 & mat ) const;
2101
-
2102
- // Multiply a 4x4 matrix by a 3x4 transformation matrix
2103
- //
2104
- VECTORMATH_FORCE_INLINE const Matrix4 operator *( const Transform3 & tfrm ) const;
2105
-
2106
- // Perform compound assignment and addition with a 4x4 matrix
2107
- //
2108
- VECTORMATH_FORCE_INLINE Matrix4 & operator +=( const Matrix4 & mat );
2109
-
2110
- // Perform compound assignment and subtraction by a 4x4 matrix
2111
- //
2112
- VECTORMATH_FORCE_INLINE Matrix4 & operator -=( const Matrix4 & mat );
2113
-
2114
- // Perform compound assignment and multiplication by a scalar
2115
- //
2116
- VECTORMATH_FORCE_INLINE Matrix4 & operator *=( float scalar );
2117
-
2118
- // Perform compound assignment and multiplication by a scalar (scalar data contained in vector data type)
2119
- //
2120
- VECTORMATH_FORCE_INLINE Matrix4 & operator *=( const floatInVec &scalar );
2121
-
2122
- // Perform compound assignment and multiplication by a 4x4 matrix
2123
- //
2124
- VECTORMATH_FORCE_INLINE Matrix4 & operator *=( const Matrix4 & mat );
2125
-
2126
- // Perform compound assignment and multiplication by a 3x4 transformation matrix
2127
- //
2128
- VECTORMATH_FORCE_INLINE Matrix4 & operator *=( const Transform3 & tfrm );
2129
-
2130
- // Construct an identity 4x4 matrix
2131
- //
2132
- static VECTORMATH_FORCE_INLINE const Matrix4 identity( );
2133
-
2134
- // Construct a 4x4 matrix to rotate around the x axis
2135
- //
2136
- static VECTORMATH_FORCE_INLINE const Matrix4 rotationX( float radians );
2137
-
2138
- // Construct a 4x4 matrix to rotate around the y axis
2139
- //
2140
- static VECTORMATH_FORCE_INLINE const Matrix4 rotationY( float radians );
2141
-
2142
- // Construct a 4x4 matrix to rotate around the z axis
2143
- //
2144
- static VECTORMATH_FORCE_INLINE const Matrix4 rotationZ( float radians );
2145
-
2146
- // Construct a 4x4 matrix to rotate around the x axis (scalar data contained in vector data type)
2147
- //
2148
- static VECTORMATH_FORCE_INLINE const Matrix4 rotationX( const floatInVec &radians );
2149
-
2150
- // Construct a 4x4 matrix to rotate around the y axis (scalar data contained in vector data type)
2151
- //
2152
- static VECTORMATH_FORCE_INLINE const Matrix4 rotationY( const floatInVec &radians );
2153
-
2154
- // Construct a 4x4 matrix to rotate around the z axis (scalar data contained in vector data type)
2155
- //
2156
- static VECTORMATH_FORCE_INLINE const Matrix4 rotationZ( const floatInVec &radians );
2157
-
2158
- // Construct a 4x4 matrix to rotate around the x, y, and z axes
2159
- //
2160
- static VECTORMATH_FORCE_INLINE const Matrix4 rotationZYX( const Vector3 &radiansXYZ );
2161
-
2162
- // Construct a 4x4 matrix to rotate around a unit-length 3-D vector
2163
- //
2164
- static VECTORMATH_FORCE_INLINE const Matrix4 rotation( float radians, const Vector3 &unitVec );
2165
-
2166
- // Construct a 4x4 matrix to rotate around a unit-length 3-D vector (scalar data contained in vector data type)
2167
- //
2168
- static VECTORMATH_FORCE_INLINE const Matrix4 rotation( const floatInVec &radians, const Vector3 &unitVec );
2169
-
2170
- // Construct a rotation matrix from a unit-length quaternion
2171
- //
2172
- static VECTORMATH_FORCE_INLINE const Matrix4 rotation( const Quat &unitQuat );
2173
-
2174
- // Construct a 4x4 matrix to perform scaling
2175
- //
2176
- static VECTORMATH_FORCE_INLINE const Matrix4 scale( const Vector3 &scaleVec );
2177
-
2178
- // Construct a 4x4 matrix to perform translation
2179
- //
2180
- static VECTORMATH_FORCE_INLINE const Matrix4 translation( const Vector3 &translateVec );
2181
-
2182
- // Construct viewing matrix based on eye, position looked at, and up direction
2183
- //
2184
- static VECTORMATH_FORCE_INLINE const Matrix4 lookAt( const Point3 &eyePos, const Point3 &lookAtPos, const Vector3 &upVec );
2185
-
2186
- // Construct a perspective projection matrix
2187
- //
2188
- static VECTORMATH_FORCE_INLINE const Matrix4 perspective( float fovyRadians, float aspect, float zNear, float zFar );
2189
-
2190
- // Construct a perspective projection matrix based on frustum
2191
- //
2192
- static VECTORMATH_FORCE_INLINE const Matrix4 frustum( float left, float right, float bottom, float top, float zNear, float zFar );
2193
-
2194
- // Construct an orthographic projection matrix
2195
- //
2196
- static VECTORMATH_FORCE_INLINE const Matrix4 orthographic( float left, float right, float bottom, float top, float zNear, float zFar );
2197
-
2198
- };
2199
- // Multiply a 4x4 matrix by a scalar
2200
- //
2201
- VECTORMATH_FORCE_INLINE const Matrix4 operator *( float scalar, const Matrix4 & mat );
2202
-
2203
- // Multiply a 4x4 matrix by a scalar (scalar data contained in vector data type)
2204
- //
2205
- VECTORMATH_FORCE_INLINE const Matrix4 operator *( const floatInVec &scalar, const Matrix4 & mat );
2206
-
2207
- // Append (post-multiply) a scale transformation to a 4x4 matrix
2208
- // NOTE:
2209
- // Faster than creating and multiplying a scale transformation matrix.
2210
- //
2211
- VECTORMATH_FORCE_INLINE const Matrix4 appendScale( const Matrix4 & mat, const Vector3 &scaleVec );
2212
-
2213
- // Prepend (pre-multiply) a scale transformation to a 4x4 matrix
2214
- // NOTE:
2215
- // Faster than creating and multiplying a scale transformation matrix.
2216
- //
2217
- VECTORMATH_FORCE_INLINE const Matrix4 prependScale( const Vector3 &scaleVec, const Matrix4 & mat );
2218
-
2219
- // Multiply two 4x4 matrices per element
2220
- //
2221
- VECTORMATH_FORCE_INLINE const Matrix4 mulPerElem( const Matrix4 & mat0, const Matrix4 & mat1 );
2222
-
2223
- // Compute the absolute value of a 4x4 matrix per element
2224
- //
2225
- VECTORMATH_FORCE_INLINE const Matrix4 absPerElem( const Matrix4 & mat );
2226
-
2227
- // Transpose of a 4x4 matrix
2228
- //
2229
- VECTORMATH_FORCE_INLINE const Matrix4 transpose( const Matrix4 & mat );
2230
-
2231
- // Compute the inverse of a 4x4 matrix
2232
- // NOTE:
2233
- // Result is unpredictable when the determinant of mat is equal to or near 0.
2234
- //
2235
- VECTORMATH_FORCE_INLINE const Matrix4 inverse( const Matrix4 & mat );
2236
-
2237
- // Compute the inverse of a 4x4 matrix, which is expected to be an affine matrix
2238
- // NOTE:
2239
- // This can be used to achieve better performance than a general inverse when the specified 4x4 matrix meets the given restrictions. The result is unpredictable when the determinant of mat is equal to or near 0.
2240
- //
2241
- VECTORMATH_FORCE_INLINE const Matrix4 affineInverse( const Matrix4 & mat );
2242
-
2243
- // Compute the inverse of a 4x4 matrix, which is expected to be an affine matrix with an orthogonal upper-left 3x3 submatrix
2244
- // NOTE:
2245
- // This can be used to achieve better performance than a general inverse when the specified 4x4 matrix meets the given restrictions.
2246
- //
2247
- VECTORMATH_FORCE_INLINE const Matrix4 orthoInverse( const Matrix4 & mat );
2248
-
2249
- // Determinant of a 4x4 matrix
2250
- //
2251
- VECTORMATH_FORCE_INLINE const floatInVec determinant( const Matrix4 & mat );
2252
-
2253
- // Conditionally select between two 4x4 matrices
2254
- // NOTE:
2255
- // This function uses a conditional select instruction to avoid a branch.
2256
- // However, the transfer of select1 to a VMX register may use more processing time than a branch.
2257
- // Use the boolInVec version for better performance.
2258
- //
2259
- VECTORMATH_FORCE_INLINE const Matrix4 select( const Matrix4 & mat0, const Matrix4 & mat1, bool select1 );
2260
-
2261
- // Conditionally select between two 4x4 matrices (scalar data contained in vector data type)
2262
- // NOTE:
2263
- // This function uses a conditional select instruction to avoid a branch.
2264
- //
2265
- VECTORMATH_FORCE_INLINE const Matrix4 select( const Matrix4 & mat0, const Matrix4 & mat1, const boolInVec &select1 );
2266
-
2267
- #ifdef _VECTORMATH_DEBUG
2268
-
2269
- // Print a 4x4 matrix
2270
- // NOTE:
2271
- // Function is only defined when _VECTORMATH_DEBUG is defined.
2272
- //
2273
- VECTORMATH_FORCE_INLINE void print( const Matrix4 & mat );
2274
-
2275
- // Print a 4x4 matrix and an associated string identifier
2276
- // NOTE:
2277
- // Function is only defined when _VECTORMATH_DEBUG is defined.
2278
- //
2279
- VECTORMATH_FORCE_INLINE void print( const Matrix4 & mat, const char * name );
2280
-
2281
- #endif
2282
-
2283
- // A 3x4 transformation matrix in array-of-structures format
2284
- //
2285
- class Transform3
2286
- {
2287
- Vector3 mCol0;
2288
- Vector3 mCol1;
2289
- Vector3 mCol2;
2290
- Vector3 mCol3;
2291
-
2292
- public:
2293
- // Default constructor; does no initialization
2294
- //
2295
- VECTORMATH_FORCE_INLINE Transform3( ) { };
2296
-
2297
- // Copy a 3x4 transformation matrix
2298
- //
2299
- VECTORMATH_FORCE_INLINE Transform3( const Transform3 & tfrm );
2300
-
2301
- // Construct a 3x4 transformation matrix containing the specified columns
2302
- //
2303
- VECTORMATH_FORCE_INLINE Transform3( const Vector3 &col0, const Vector3 &col1, const Vector3 &col2, const Vector3 &col3 );
2304
-
2305
- // Construct a 3x4 transformation matrix from a 3x3 matrix and a 3-D vector
2306
- //
2307
- VECTORMATH_FORCE_INLINE Transform3( const Matrix3 & tfrm, const Vector3 &translateVec );
2308
-
2309
- // Construct a 3x4 transformation matrix from a unit-length quaternion and a 3-D vector
2310
- //
2311
- VECTORMATH_FORCE_INLINE Transform3( const Quat &unitQuat, const Vector3 &translateVec );
2312
-
2313
- // Set all elements of a 3x4 transformation matrix to the same scalar value
2314
- //
2315
- explicit VECTORMATH_FORCE_INLINE Transform3( float scalar );
2316
-
2317
- // Set all elements of a 3x4 transformation matrix to the same scalar value (scalar data contained in vector data type)
2318
- //
2319
- explicit VECTORMATH_FORCE_INLINE Transform3( const floatInVec &scalar );
2320
-
2321
- // Assign one 3x4 transformation matrix to another
2322
- //
2323
- VECTORMATH_FORCE_INLINE Transform3 & operator =( const Transform3 & tfrm );
2324
-
2325
- // Set the upper-left 3x3 submatrix
2326
- //
2327
- VECTORMATH_FORCE_INLINE Transform3 & setUpper3x3( const Matrix3 & mat3 );
2328
-
2329
- // Get the upper-left 3x3 submatrix of a 3x4 transformation matrix
2330
- //
2331
- VECTORMATH_FORCE_INLINE const Matrix3 getUpper3x3( ) const;
2332
-
2333
- // Set translation component
2334
- //
2335
- VECTORMATH_FORCE_INLINE Transform3 & setTranslation( const Vector3 &translateVec );
2336
-
2337
- // Get the translation component of a 3x4 transformation matrix
2338
- //
2339
- VECTORMATH_FORCE_INLINE const Vector3 getTranslation( ) const;
2340
-
2341
- // Set column 0 of a 3x4 transformation matrix
2342
- //
2343
- VECTORMATH_FORCE_INLINE Transform3 & setCol0( const Vector3 &col0 );
2344
-
2345
- // Set column 1 of a 3x4 transformation matrix
2346
- //
2347
- VECTORMATH_FORCE_INLINE Transform3 & setCol1( const Vector3 &col1 );
2348
-
2349
- // Set column 2 of a 3x4 transformation matrix
2350
- //
2351
- VECTORMATH_FORCE_INLINE Transform3 & setCol2( const Vector3 &col2 );
2352
-
2353
- // Set column 3 of a 3x4 transformation matrix
2354
- //
2355
- VECTORMATH_FORCE_INLINE Transform3 & setCol3( const Vector3 &col3 );
2356
-
2357
- // Get column 0 of a 3x4 transformation matrix
2358
- //
2359
- VECTORMATH_FORCE_INLINE const Vector3 getCol0( ) const;
2360
-
2361
- // Get column 1 of a 3x4 transformation matrix
2362
- //
2363
- VECTORMATH_FORCE_INLINE const Vector3 getCol1( ) const;
2364
-
2365
- // Get column 2 of a 3x4 transformation matrix
2366
- //
2367
- VECTORMATH_FORCE_INLINE const Vector3 getCol2( ) const;
2368
-
2369
- // Get column 3 of a 3x4 transformation matrix
2370
- //
2371
- VECTORMATH_FORCE_INLINE const Vector3 getCol3( ) const;
2372
-
2373
- // Set the column of a 3x4 transformation matrix referred to by the specified index
2374
- //
2375
- VECTORMATH_FORCE_INLINE Transform3 & setCol( int col, const Vector3 &vec );
2376
-
2377
- // Set the row of a 3x4 transformation matrix referred to by the specified index
2378
- //
2379
- VECTORMATH_FORCE_INLINE Transform3 & setRow( int row, const Vector4 &vec );
2380
-
2381
- // Get the column of a 3x4 transformation matrix referred to by the specified index
2382
- //
2383
- VECTORMATH_FORCE_INLINE const Vector3 getCol( int col ) const;
2384
-
2385
- // Get the row of a 3x4 transformation matrix referred to by the specified index
2386
- //
2387
- VECTORMATH_FORCE_INLINE const Vector4 getRow( int row ) const;
2388
-
2389
- // Subscripting operator to set or get a column
2390
- //
2391
- VECTORMATH_FORCE_INLINE Vector3 & operator []( int col );
2392
-
2393
- // Subscripting operator to get a column
2394
- //
2395
- VECTORMATH_FORCE_INLINE const Vector3 operator []( int col ) const;
2396
-
2397
- // Set the element of a 3x4 transformation matrix referred to by column and row indices
2398
- //
2399
- VECTORMATH_FORCE_INLINE Transform3 & setElem( int col, int row, float val );
2400
-
2401
- // Set the element of a 3x4 transformation matrix referred to by column and row indices (scalar data contained in vector data type)
2402
- //
2403
- VECTORMATH_FORCE_INLINE Transform3 & setElem( int col, int row, const floatInVec &val );
2404
-
2405
- // Get the element of a 3x4 transformation matrix referred to by column and row indices
2406
- //
2407
- VECTORMATH_FORCE_INLINE const floatInVec getElem( int col, int row ) const;
2408
-
2409
- // Multiply a 3x4 transformation matrix by a 3-D vector
2410
- //
2411
- VECTORMATH_FORCE_INLINE const Vector3 operator *( const Vector3 &vec ) const;
2412
-
2413
- // Multiply a 3x4 transformation matrix by a 3-D point
2414
- //
2415
- VECTORMATH_FORCE_INLINE const Point3 operator *( const Point3 &pnt ) const;
2416
-
2417
- // Multiply two 3x4 transformation matrices
2418
- //
2419
- VECTORMATH_FORCE_INLINE const Transform3 operator *( const Transform3 & tfrm ) const;
2420
-
2421
- // Perform compound assignment and multiplication by a 3x4 transformation matrix
2422
- //
2423
- VECTORMATH_FORCE_INLINE Transform3 & operator *=( const Transform3 & tfrm );
2424
-
2425
- // Construct an identity 3x4 transformation matrix
2426
- //
2427
- static VECTORMATH_FORCE_INLINE const Transform3 identity( );
2428
-
2429
- // Construct a 3x4 transformation matrix to rotate around the x axis
2430
- //
2431
- static VECTORMATH_FORCE_INLINE const Transform3 rotationX( float radians );
2432
-
2433
- // Construct a 3x4 transformation matrix to rotate around the y axis
2434
- //
2435
- static VECTORMATH_FORCE_INLINE const Transform3 rotationY( float radians );
2436
-
2437
- // Construct a 3x4 transformation matrix to rotate around the z axis
2438
- //
2439
- static VECTORMATH_FORCE_INLINE const Transform3 rotationZ( float radians );
2440
-
2441
- // Construct a 3x4 transformation matrix to rotate around the x axis (scalar data contained in vector data type)
2442
- //
2443
- static VECTORMATH_FORCE_INLINE const Transform3 rotationX( const floatInVec &radians );
2444
-
2445
- // Construct a 3x4 transformation matrix to rotate around the y axis (scalar data contained in vector data type)
2446
- //
2447
- static VECTORMATH_FORCE_INLINE const Transform3 rotationY( const floatInVec &radians );
2448
-
2449
- // Construct a 3x4 transformation matrix to rotate around the z axis (scalar data contained in vector data type)
2450
- //
2451
- static VECTORMATH_FORCE_INLINE const Transform3 rotationZ( const floatInVec &radians );
2452
-
2453
- // Construct a 3x4 transformation matrix to rotate around the x, y, and z axes
2454
- //
2455
- static VECTORMATH_FORCE_INLINE const Transform3 rotationZYX( const Vector3 &radiansXYZ );
2456
-
2457
- // Construct a 3x4 transformation matrix to rotate around a unit-length 3-D vector
2458
- //
2459
- static VECTORMATH_FORCE_INLINE const Transform3 rotation( float radians, const Vector3 &unitVec );
2460
-
2461
- // Construct a 3x4 transformation matrix to rotate around a unit-length 3-D vector (scalar data contained in vector data type)
2462
- //
2463
- static VECTORMATH_FORCE_INLINE const Transform3 rotation( const floatInVec &radians, const Vector3 &unitVec );
2464
-
2465
- // Construct a rotation matrix from a unit-length quaternion
2466
- //
2467
- static VECTORMATH_FORCE_INLINE const Transform3 rotation( const Quat &unitQuat );
2468
-
2469
- // Construct a 3x4 transformation matrix to perform scaling
2470
- //
2471
- static VECTORMATH_FORCE_INLINE const Transform3 scale( const Vector3 &scaleVec );
2472
-
2473
- // Construct a 3x4 transformation matrix to perform translation
2474
- //
2475
- static VECTORMATH_FORCE_INLINE const Transform3 translation( const Vector3 &translateVec );
2476
-
2477
- };
2478
- // Append (post-multiply) a scale transformation to a 3x4 transformation matrix
2479
- // NOTE:
2480
- // Faster than creating and multiplying a scale transformation matrix.
2481
- //
2482
- VECTORMATH_FORCE_INLINE const Transform3 appendScale( const Transform3 & tfrm, const Vector3 &scaleVec );
2483
-
2484
- // Prepend (pre-multiply) a scale transformation to a 3x4 transformation matrix
2485
- // NOTE:
2486
- // Faster than creating and multiplying a scale transformation matrix.
2487
- //
2488
- VECTORMATH_FORCE_INLINE const Transform3 prependScale( const Vector3 &scaleVec, const Transform3 & tfrm );
2489
-
2490
- // Multiply two 3x4 transformation matrices per element
2491
- //
2492
- VECTORMATH_FORCE_INLINE const Transform3 mulPerElem( const Transform3 & tfrm0, const Transform3 & tfrm1 );
2493
-
2494
- // Compute the absolute value of a 3x4 transformation matrix per element
2495
- //
2496
- VECTORMATH_FORCE_INLINE const Transform3 absPerElem( const Transform3 & tfrm );
2497
-
2498
- // Inverse of a 3x4 transformation matrix
2499
- // NOTE:
2500
- // Result is unpredictable when the determinant of the left 3x3 submatrix is equal to or near 0.
2501
- //
2502
- VECTORMATH_FORCE_INLINE const Transform3 inverse( const Transform3 & tfrm );
2503
-
2504
- // Compute the inverse of a 3x4 transformation matrix, expected to have an orthogonal upper-left 3x3 submatrix
2505
- // NOTE:
2506
- // This can be used to achieve better performance than a general inverse when the specified 3x4 transformation matrix meets the given restrictions.
2507
- //
2508
- VECTORMATH_FORCE_INLINE const Transform3 orthoInverse( const Transform3 & tfrm );
2509
-
2510
- // Conditionally select between two 3x4 transformation matrices
2511
- // NOTE:
2512
- // This function uses a conditional select instruction to avoid a branch.
2513
- // However, the transfer of select1 to a VMX register may use more processing time than a branch.
2514
- // Use the boolInVec version for better performance.
2515
- //
2516
- VECTORMATH_FORCE_INLINE const Transform3 select( const Transform3 & tfrm0, const Transform3 & tfrm1, bool select1 );
2517
-
2518
- // Conditionally select between two 3x4 transformation matrices (scalar data contained in vector data type)
2519
- // NOTE:
2520
- // This function uses a conditional select instruction to avoid a branch.
2521
- //
2522
- VECTORMATH_FORCE_INLINE const Transform3 select( const Transform3 & tfrm0, const Transform3 & tfrm1, const boolInVec &select1 );
2523
-
2524
- #ifdef _VECTORMATH_DEBUG
2525
-
2526
- // Print a 3x4 transformation matrix
2527
- // NOTE:
2528
- // Function is only defined when _VECTORMATH_DEBUG is defined.
2529
- //
2530
- VECTORMATH_FORCE_INLINE void print( const Transform3 & tfrm );
2531
-
2532
- // Print a 3x4 transformation matrix and an associated string identifier
2533
- // NOTE:
2534
- // Function is only defined when _VECTORMATH_DEBUG is defined.
2535
- //
2536
- VECTORMATH_FORCE_INLINE void print( const Transform3 & tfrm, const char * name );
2537
-
2538
- #endif
2539
-
2540
- } // namespace Aos
2541
- } // namespace Vectormath
2542
-
2543
- #include "vec_aos.h"
2544
- #include "quat_aos.h"
2545
- #include "mat_aos.h"
2546
-
2547
- #endif