(a: Vec3)
| 36 | const scale = (a: Vec3, factor: number): Vec3 => ({ x: a.x * factor, y: a.y * factor, z: a.z * factor }); |
| 37 | const add = (...vectors: Vec3[]): Vec3 => vectors.reduce((sum, value) => ({ x: sum.x + value.x, y: sum.y + value.y, z: sum.z + value.z }), { x: 0, y: 0, z: 0 }); |
| 38 | const unit = (a: Vec3): Vec3 => { const length = Math.hypot(a.x, a.y, a.z) || 1; return scale(a, 1 / length); }; |
| 39 | |
| 40 | /** |
| 41 | * Das Kameraziel fuer einen Pfad. |