MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / _rect

Function _rect

libraries/p5.js:34986–35003  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34984 var detailY = args[5] || 16;
34985 if(!this.geometryInHash(gId)){
34986 var _rect = function(){
34987 var u,v,p;
34988 for (var i = 0; i <= this.detailY; i++){
34989 v = i / this.detailY;
34990 for (var j = 0; j <= this.detailX; j++){
34991 u = j / this.detailX;
34992 // var _x = x-width/2;
34993 // var _y = y-height/2;
34994 p = new p5.Vector(
34995 x + (width*u),
34996 y + (height*v),
34997 0
34998 );
34999 this.vertices.push(p);
35000 this.uvs.push([u,v]);
35001 }
35002 }
35003 };
35004 var rectGeom = new p5.Geometry(detailX,detailY,_rect);
35005 rectGeom
35006 .computeFaces()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected