(t: TransformData)
| 166 | // imported from `./loader.ts`) to keep the dependency graph flat — prefab is |
| 167 | // used *by* the loader, not the other way around. |
| 168 | function trsToMat4(t: TransformData): Mat4 { |
| 169 | const pos: Vec3 = { x: t.position[0], y: t.position[1], z: t.position[2] }; |
| 170 | const scl: Vec3 = { x: t.scale[0], y: t.scale[1], z: t.scale[2] }; |
| 171 | |
| 172 | let m = mat4Identity(); |
| 173 | m = mat4Translate(m, pos); |
| 174 | m = mat4RotateZ(m, t.rotation[2]); |
| 175 | m = mat4RotateY(m, t.rotation[1]); |
| 176 | m = mat4RotateX(m, t.rotation[0]); |
| 177 | m = mat4Scale(m, scl); |
| 178 | return m; |
| 179 | } |
| 180 | |
| 181 | function mergeTags(parent: ReadonlyArray<string>, child: ReadonlyArray<string>): string[] { |
| 182 | if (parent.length === 0) return [...child]; |
no test coverage detected