Commit graph

3262 commits

Author SHA1 Message Date
Om Prakaash
c1abc7a06f
math: add fromInt constructor helper for vectors (#1061) 2023-10-16 19:35:45 -07:00
Joel
fde4f820d7
math: Add Matrix multiplication tests (#1066)
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-16 19:32:20 -07:00
Dustin Taylor
6d825284f7
engine: release encoder properly (#1068) 2023-10-16 19:27:39 -07:00
Stephen Gutekanst
c03673ff05 math: zig fmt
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-13 19:27:29 -07:00
Stephen Gutekanst
e1ce5c5662 gfx: individual styles for text segments
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-13 19:27:29 -07:00
Joel D. Schüller
fc4c3d06a3 math: Improve triangleIntersect doc comment 2023-10-10 20:31:47 -07:00
Joel D. Schüller
efe9d3d5d2 math: Add more precise triangleIntersect tests 2023-10-10 20:31:47 -07:00
Joel D. Schüller
8ddb9ade70 math: Fix Ray and Ray.Hit type adaptations 2023-10-10 20:31:47 -07:00
Joel D. Schüller
1c32ae83a7 math: Move maxDim function inside Ray struct 2023-10-10 20:31:47 -07:00
Joel D. Schüller
e7c95b8ce9 math: Replace floatFallbackPrecision function with switch expression 2023-10-10 20:31:47 -07:00
Om Prakaash
7bd2bc8d24 Add mulVec function for vectors.
Add function to allow a matrix to be left multiplied by a vector.
2023-10-06 20:18:17 -07:00
Stephen Gutekanst
1c16060eaa update dependencies
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:40 -07:00
Stephen Gutekanst
1f8962408c gfx: integrate new font stack into Text module
Helps hexops/mach#877

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:36 -07:00
Stephen Gutekanst
34259ed1b8 gfx: font: account for glyph bearings
Helps hexops/mach#877

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:33 -07:00
Stephen Gutekanst
dfbf3e3603 gfx: font: add glyph rendering functionality
Helps hexops/mach#877

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:30 -07:00
Stephen Gutekanst
87c3de78f5 gfx: font: begin adding text shaping via harfbuzz
Helps hexops/mach#877

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-05 20:35:13 -07:00
Stephen Gutekanst
3bcbdc4682 move mach.Atlas -> mach.gfx.Atlas
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-03 22:36:44 -07:00
Stephen Gutekanst
a20b2ddd0d update freetype (@abs / latest zig)
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-03 21:08:44 -07:00
Stephen Gutekanst
e12fb0d8c0 update dependencies
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-10-03 20:55:52 -07:00
Wrench[bot]
f0d4441af7 all: update Zig to version 0.12.0-dev.706+62a0fbdae
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-10-03 20:50:55 -07:00
Stephen Gutekanst
3b4f811529 minor cleanup 2023-10-03 19:50:52 -07:00
Joel D. Schüller
c03c627780 math: Have Ray return fitting subtype, scale precision automatically 2023-10-03 19:50:52 -07:00
Joel D. Schüller
0273e12902 math: Implement function to determine Ray hit fallback precision 2023-10-03 19:50:52 -07:00
Joel D. Schüller
4d6b3e200f math: Declare Ray, Rayh, and Rayd types 2023-10-03 19:50:52 -07:00
Joel D. Schüller
24b9a415b3 math: Add Ray type and ray methods to test runner 2023-10-03 19:50:52 -07:00
Joel D. Schüller
9399cda75c math: Implement ray-triangle intersection 2023-10-03 19:50:52 -07:00
Jeremia Dominguez
06f66d7a32 text: Fixed atlas finding glyphs of wrong size
Signed-off-by: Jeremia Dominguez <me@jeremia.dev>
2023-10-03 19:46:52 -07:00
Stephen Gutekanst
e661dcaf0a cleanup 2023-10-03 10:28:34 -07:00
Stephen Gutekanst
f0bb14524b cleanup 2023-10-03 10:28:34 -07:00
Om Prakaash
3527937086 Added mulVec function for matrices
Added function to multiply a matrix with a vector (Matrix* Vec).
2023-10-03 10:28:34 -07:00
Joel D. Schüller
a3671ab0ef math: Implement Vec swizzle method 2023-10-01 10:06:42 -07:00
Joel D. Schüller
f6213a4237 math: Add enum for Vector components 2023-10-01 10:06:42 -07:00
Stephen Gutekanst
c77619045f build: fix transitive resolution of mach_core
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-24 18:40:22 -07:00
Stephen Gutekanst
4e091f1cb8 replace module() helper; remove invalid re-exports;
Fixes hexops/mach#1041
Helps hexops/mach#1038

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-24 17:20:40 -07:00
Joel D. Schüller
2615afaaed math: Overhaul old Vec tests
Old tests were not in accordance to the testing style guide
2023-09-23 04:19:18 -07:00
Joel D. Schüller
0bd8690ee1 math: Fix Vec cross method calculation arguments 2023-09-23 04:19:18 -07:00
Joel D. Schüller
085974a4b2 math: Fix Vec swizzling method component calls 2023-09-23 04:19:18 -07:00
Joel D. Schüller
8613ba9b17 math: Add tests for basic Vec operations
Tests for add, sub, div, mul, addScalar, subScalar, divScalar, mulScalar
2023-09-23 04:19:18 -07:00
Olle Lukowski
45b23264da math: add perspective camera matrix 2023-09-22 16:40:57 -07:00
Joel D. Schüller
b6e0539c52 math: Add tests for new Vec operations
Tests for max, min, inverse, negate, maxScalar, minScalar
2023-09-22 09:51:55 -07:00
Joel D. Schüller
7597f03b71 math: Implement more Vec operations
max, min, inverse, negate, maxScalar, minScalar
2023-09-22 09:51:55 -07:00
Stephen Gutekanst
c16cddd250 all: refactor: cleanup module structure
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-22 08:24:16 -07:00
Stephen Gutekanst
52c4eb5d74 all: canonicalize import paths with mach- prefix
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-21 14:36:21 -07:00
Stephen Gutekanst
26a9392188 build: remove earcut dependency
Related to hexops/mach#967

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-21 14:10:22 -07:00
Stephen Gutekanst
4d18ef54df build: link freetype+harfbuzz
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-21 14:09:32 -07:00
Stephen Gutekanst
aaac8ebbfd build: refactor test code
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-21 11:24:33 -07:00
Stephen Gutekanst
164e52cd85 editor: move to github.com/hexops/mach-editor
Fixes hexops/mach#1018

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-21 11:00:21 -07:00
Stephen Gutekanst
8a57ea059c gfx2d: add initial text rendering ECS module
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-21 07:27:28 -07:00
Stephen Gutekanst
0803e71a0e gfx2d: cleanup sprite2d in prep for text2d
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-09-18 08:43:21 -07:00
Wrench[bot]
3d04466546 all: update Zig to version 0.12.0-dev.389+61b70778b
Signed-off-by: Wrench[bot] <wrench@hexops.com>
2023-09-17 18:13:59 -07:00