({ value }: { value: DynoVal<T> })
| 398 | implements HasDynoOut<"vec4"> |
| 399 | { |
| 400 | constructor({ value }: { value: DynoVal<T> }) { |
| 401 | super({ |
| 402 | inTypes: { value: valType(value) }, |
| 403 | outTypes: { hash: "vec4" }, |
| 404 | inputs: { value }, |
| 405 | construct: ({ value }) => { |
| 406 | if (!value) { |
| 407 | throw new Error("value is required"); |
| 408 | } |
| 409 | const words = hash4(value); |
| 410 | return { hash: mul(vec4(words), dynoConst("float", 1 / 2 ** 32)) }; |
| 411 | }, |
| 412 | }); |
| 413 | } |
| 414 | dynoOut(): DynoValue<"vec4"> { |
| 415 | return new DynoOutput(this, "hash"); |
| 416 | } |