mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-20 12:50:57 +00:00
further sse simd additions
avx2 float3 added added normalize_magnitude added divide fast to float3 may copy to float4 move static spheremesh to drawSphere (initialize on first use) so platform has a chance to load the math backend
This commit is contained in:
parent
2559145c06
commit
18d0aa0418
16 changed files with 337 additions and 77 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#include "math/public/float4_dispatch.h"
|
||||
#include "math/mConstants.h"
|
||||
#include <math.h>
|
||||
#include <cmath> // for sqrtf, etc.
|
||||
|
||||
namespace math_backend::float4::dispatch
|
||||
{
|
||||
|
|
@ -27,7 +27,8 @@ namespace math_backend::float4::dispatch
|
|||
};
|
||||
|
||||
gFloat4.div_scalar = [](const float* a, float s, float* r) {
|
||||
for (int i = 0; i < 4; i++) r[i] = a[i] / s;
|
||||
float denom = 1.0f / s;
|
||||
for (int i = 0; i < 4; i++) r[i] = a[i] * denom;
|
||||
};
|
||||
|
||||
gFloat4.dot = [](const float* a, const float* b) {
|
||||
|
|
@ -39,7 +40,7 @@ namespace math_backend::float4::dispatch
|
|||
gFloat4.length = [](const float* a) {
|
||||
float sum = 0.f;
|
||||
for (int i = 0; i < 4; i++) sum += a[i] * a[i];
|
||||
return sqrtf(sum);
|
||||
return std::sqrt(sum);
|
||||
};
|
||||
|
||||
gFloat4.lengthSquared = [](const float* a) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue