@@ -288,29 +288,29 @@ function shadergen(p5, fn) {
288
288
289
289
// I am interested in the 'prop' value of get and set then
290
290
291
- const VectorNodeHandler = {
292
- swizzles : [
293
- [ 'x' , 'y' , 'z' , 'w' ] ,
294
- [ 'r' , 'b' , 'g' , 'a' ] ,
295
- [ 's' , 't' , 'p' , 'q' ] ,
296
- ] ,
297
- get ( target , prop , receiver ) {
298
- if ( prop in target ) {
299
- return Reflect . get ( target , prop , receiver ) ;
300
- } else {
301
- console . log ( prop ) ;
302
- }
303
- let modifiedProp ;
304
- return Reflect . get ( target , modifiedProp , receiver ) ;
305
- } ,
306
- set ( obj , prop , receiver ) {
307
- console . log ( "OBJect:" , obj , "PROPERTY" , prop , "RECEIVER" , receiver ) ;
308
-
309
- if ( prop in obj ) { return Reflect . set ( ...arguments ) ; }
310
- let modifiedProp ;
311
- return Reflect . set ( obj , modifiedProp , receiver ) ;
312
- }
313
- }
291
+ // const VectorNodeHandler = {
292
+ // swizzles: [
293
+ // ['x', 'y', 'z', 'w'],
294
+ // ['r', 'b', 'g', 'a'],
295
+ // ['s', 't', 'p', 'q'],
296
+ // ],
297
+ // get(target, prop, receiver) {
298
+ // if (prop in target) {
299
+ // return Reflect.get(target, prop, receiver);
300
+ // } else {
301
+ // console.log(prop);
302
+ // }
303
+ // let modifiedProp;
304
+ // return Reflect.get(target, modifiedProp, receiver);
305
+ // },
306
+ // set(obj, prop, receiver) {
307
+ // console.log("OBJect:",obj,"PROPERTY", prop, "RECEIVER", receiver);
308
+
309
+ // if (prop in obj) { return Reflect.set(...arguments); }
310
+ // let modifiedProp;
311
+ // return Reflect.set(obj, modifiedProp, receiver);
312
+ // }
313
+ // }
314
314
315
315
class VectorNode extends BaseNode {
316
316
constructor ( values , type , isInternal = false ) {
@@ -631,16 +631,17 @@ function shadergen(p5, fn) {
631
631
}
632
632
633
633
fn . createVector2 = function ( x , y ) {
634
- return new Proxy ( new VectorNode ( [ x , y ] , 'vec2' ) , VectorNodeHandler ) ;
634
+ // return new Proxy(new VectorNode([x, y], 'vec2'), VectorNodeHandler);
635
+ return new VectorNode ( [ x , y ] , 'vec2' ) ;
635
636
}
636
637
637
638
fn . createVector3 = function ( x , y , z ) {
638
- return new Proxy ( new VectorNode ( [ x , y , z ] , 'vec3' ) , VectorNodeHandler ) ;
639
+ // return new Proxy(new VectorNode([x, y, z], 'vec3'), VectorNodeHandler);
639
640
return new VectorNode ( [ x , y , z ] , 'vec3' ) ;
640
641
}
641
642
642
643
fn . createVector4 = function ( x , y , z , w ) {
643
- return new Proxy ( new VectorNode ( [ x , y , z , w ] , 'vec4' ) , VectorNodeHandler ) ;
644
+ // return new Proxy(new VectorNode([x, y, z, w], 'vec4'), VectorNodeHandler);
644
645
return new VectorNode ( [ x , y , z , w ] , 'vec4' ) ;
645
646
}
646
647
0 commit comments