({ value }: { value: DynoVal<T> })
| 375 | implements HasDynoOut<"vec3"> |
| 376 | { |
| 377 | constructor({ value }: { value: DynoVal<T> }) { |
| 378 | super({ |
| 379 | inTypes: { value: valType(value) }, |
| 380 | outTypes: { hash: "vec3" }, |
| 381 | inputs: { value }, |
| 382 | construct: ({ value }) => { |
| 383 | if (!value) { |
| 384 | throw new Error("value is required"); |
| 385 | } |
| 386 | const words = hash3(value); |
| 387 | return { hash: mul(vec3(words), dynoConst("float", 1 / 2 ** 32)) }; |
| 388 | }, |
| 389 | }); |
| 390 | } |
| 391 | dynoOut(): DynoValue<"vec3"> { |
| 392 | return new DynoOutput(this, "hash"); |
| 393 | } |