feat(kotlin-compose): design system + 33 components + gallery_kt + e2e android emulator + scaffolder fixes
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Color
|
||||
lang: cpp
|
||||
domain: core
|
||||
version: "0.1.0"
|
||||
algebraic: product
|
||||
definition: "struct Color { float r, g, b, a; }"
|
||||
description: "Color RGBA en floats normalizados [0,1]. Helpers para presets (white/black/transparent), construccion desde u8 (rgba(r,g,b,a)) o desde packed hex (hex(0xRRGGBBAA))."
|
||||
tags: [gamedev, color, primitive]
|
||||
uses_types: []
|
||||
file_path: "cpp/functions/core/math2d.h"
|
||||
examples: |
|
||||
Color tint = Color::white();
|
||||
Color red = Color::rgba(255, 0, 0);
|
||||
Color cyan = Color::hex(0x00FFFFFF);
|
||||
notes: |
|
||||
- RGBA en floats por defecto — aceptado por sokol_gfx.
|
||||
- alpha default 1.0 para builders.
|
||||
- Sin gamma correction implicito; el shader decide.
|
||||
---
|
||||
|
||||
# Color
|
||||
|
||||
Color RGBA float usado por sprite_batch (tint), pass clear, debug draw.
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
name: Rect
|
||||
lang: cpp
|
||||
domain: core
|
||||
version: "0.1.0"
|
||||
algebraic: product
|
||||
definition: "struct Rect { float x, y, w, h; }"
|
||||
description: "Rectangulo axis-aligned de floats (x, y, w, h). Usado por sprite_batch, tilemap, hit-tests y AABB queries del stack gamedev (issue 0072b)."
|
||||
tags: [gamedev, math, 2d, primitive, aabb]
|
||||
uses_types:
|
||||
- Vec2_cpp_core
|
||||
file_path: "cpp/functions/core/math2d.h"
|
||||
examples: |
|
||||
Rect r{10.0f, 20.0f, 100.0f, 50.0f};
|
||||
Vec2 c = r.center();
|
||||
bool inside = r.contains({50.0f, 30.0f});
|
||||
bool hit = r.overlaps(other);
|
||||
notes: |
|
||||
- Helpers: `right()`, `bottom()`, `center()`, `min()`, `max()`.
|
||||
- `overlaps()` es AABB intersection (no-touch = no-overlap).
|
||||
- `contains()` usa half-open `[x, x+w)` como ImGui / texture coords.
|
||||
---
|
||||
|
||||
# Rect
|
||||
|
||||
Rectangulo axis-aligned usado para sprites, hit-tests, AABB queries y tilemaps.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
name: Vec2
|
||||
lang: cpp
|
||||
domain: core
|
||||
version: "0.1.0"
|
||||
algebraic: product
|
||||
definition: "struct Vec2 { float x, y; }"
|
||||
description: "Vector 2D inmutable de floats con operadores aritmeticos, length/normalize/dot/cross. Tipo base del stack gamedev (issue 0072b)."
|
||||
tags: [gamedev, math, 2d, primitive]
|
||||
uses_types: []
|
||||
file_path: "cpp/functions/core/math2d.h"
|
||||
examples: |
|
||||
Vec2 a{1.0f, 2.0f};
|
||||
Vec2 b{3.0f, 4.0f};
|
||||
Vec2 sum = a + b;
|
||||
float d = Vec2::dot(a, b);
|
||||
Vec2 n = a.normalized();
|
||||
notes: |
|
||||
- Definido en namespace `fn::math2d` junto a Rect y Color.
|
||||
- Trivial-copy, constexpr donde aplica.
|
||||
- Sin SIMD intencionado — para hot paths usar buffers planos float[2].
|
||||
---
|
||||
|
||||
# Vec2
|
||||
|
||||
Vector 2D usado por el stack gamedev: posiciones, velocidades, tamaños UV. Operadores `+ - * /` por componente, `dot`, `cross` (escalar 2D), `length`, `normalized`.
|
||||
|
||||
Vive en `cpp/functions/core/math2d.h` junto a `Rect` y `Color` para reducir overhead de includes.
|
||||
Reference in New Issue
Block a user