Commit Graph

11 Commits

Author SHA1 Message Date
Mathias Agopian
7ab25ff4a2 improve libmath benchmark 2018-12-05 17:19:47 -08:00
Philip Rideout
a7d6af8d22 filamesh: Add support for TEXCOORD_SNORM16. 2018-12-03 14:18:12 -08:00
Mathias Agopian
6d68a4a4c6 libmath benchmarks 2018-12-03 11:58:30 -08:00
Philip Rideout
91abaf575b Add tangents utility to fix #532.
I tested this by writing a quick-and-dirty Sphere demo.
2018-11-28 11:27:37 -08:00
shartte
9ab9333fa5 Fixes various MSVC issues in public headers (#523) 2018-11-26 09:17:19 -08:00
Mathias Agopian
d1b19efa55 a fast approximation of pow() and pow(x, 2.2f)
fast::pow(x, 2.2f) is about 100x faster than std::pow.
std::pow(x, 2.2f) takes roughly 1000 cycles.
2018-11-21 13:46:56 -08:00
Cory Bloor
a831c507cf Add missing include to math/mat3.h (#157)
CHAR_BIT is defined in <limits.h>
2018-08-27 14:06:32 -07:00
Romain Guy
959c21b172 mat2 and mat3 need vec2 and vec3 for scale/translate (#155) 2018-08-27 11:14:10 -07:00
Romain Guy
39ca6d146f Fix ambiguities with translate() and scale() (#154)
These two functions expect a vector of the same size as the
matrix's storage vectors (float4 for a mat4f for instance) which
has two major issues:

- The vector must end with 1 for homogeneous coordinates to work
- Passing a single scalar (mat4f::scale(0.5)) creates a matrix
  whose diagonal is set to that scalar, thus breaking homogeneous
  coordinates

With this change scale and translate expect a vector who dimensionality
is 1 less that of the matrix's underlying storage vectors. i.e. a float3
for mat4f.
2018-08-27 10:21:13 -07:00
Mathias Agopian
63e2f69c16 add more pseudo vector swizzle to lib math
vec3: yz
vec4: yz, zw, yzw
2018-08-16 22:36:30 -07:00
Romain Guy
b3d758f3b3 Initial commit 2018-08-03 10:38:22 -07:00