This commit is contained in:
luboslenco
2024-03-07 20:37:30 +01:00
parent d99181b2a5
commit 705045dfd4
122 changed files with 9681 additions and 9690 deletions
+7 -7
View File
@@ -1,16 +1,16 @@
class VectorNode extends LogicNode {
value = vec4_create();
value: vec4_t = vec4_create();
image: image_t = null;
constructor(x: Null<f32> = null, y: Null<f32> = null, z: Null<f32> = null) {
super();
if (x != null) {
this.addInput(new FloatNode(x), 0);
this.addInput(new FloatNode(y), 0);
this.addInput(new FloatNode(z), 0);
this.add_input(new FloatNode(x), 0);
this.add_input(new FloatNode(y), 0);
this.add_input(new FloatNode(z), 0);
}
}
@@ -27,13 +27,13 @@ class VectorNode extends LogicNode {
});
}
override getAsImage = (from: i32, done: (img: image_t)=>void) => {
override get_as_image = (from: i32, done: (img: image_t)=>void) => {
this.inputs[0].get((x: f32) => {
this.inputs[1].get((y: f32) => {
this.inputs[2].get((z: f32) => {
if (this.image != null) image_unload(this.image);
let b = new ArrayBuffer(16);
let v = new DataView(b);
let b: ArrayBuffer = new ArrayBuffer(16);
let v: DataView = new DataView(b);
v.setFloat32(0, (this.inputs[0].node as any).value, true);
v.setFloat32(4, (this.inputs[1].node as any).value, true);
v.setFloat32(8, (this.inputs[2].node as any).value, true);