(RFC) deprecate `scale` etc.

Abierto
#3,164 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
62/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start by locating the definitions of std.scale4, std.rotate4/rotate3 and std.translate4 in the typegpu package (search for gpuScaling4 and the std export surface), plus their tests and docs pages. Read the single existing comment to see whether the maintainer has settled on plain deprecation vs. removal, then add @deprecated JSDoc pointing users at d.mat4x4f.scaling/rotation/translation with explicit matrix multiplication. Done means the functions still work, every call site in docs/examples that used them is updated, and the test suite passes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

stability

We support both d.mat4x4f.scaling, which returns a scaling matrix, as well as std.scale, which takes in a matrix and scales it.
The issue I see is that std.scale imposes a convention, it multiplies by the scaling matrix from the left: (${gpuScaling4(ctx, [vector])} * ${matrix}).
This may be unintuitive when applying some transformations manually, especially since wgpu-matrix uses the opposite order.

import { tgpu, d, std } from 'typegpu';
import * as m from 'wgpu-matrix';

const mat = d.mat4x4f(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
console.log(std.scale4(mat, d.vec3f(1, 2, 3)));
console.log(m.mat4.scale(mat, d.vec3f(1, 2, 3))); // different from previous log

I'd suggest we deprecate scale4, rotate?4 and translate4.
People can multiply scaling/rotation/translation matrices themself insead.

Lenguaje dominante
TypeScript
Estrellas
3.3k
Forks
143
Merge medio
3 d 12 h
PR fusionados (30 d)
68

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de software-mansion/TypeGPU

Todos los issues de software-mansion/TypeGPU

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.