MCPcopy
hub / github.com/sparkjsdev/spark / constructor

Method constructor

src/dyno/util.ts:377–390  ·  view source on GitHub ↗
({ value }: { value: DynoVal<T> })

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 5

valTypeFunction · 0.90
mulFunction · 0.90
vec3Function · 0.90
dynoConstFunction · 0.90
hash3Function · 0.85

Tested by

no test coverage detected