()
| 34861 | |
| 34862 | if(!this._renderer.geometryInHash(gId)){ |
| 34863 | var _torus = function(){ |
| 34864 | var u,v,p; |
| 34865 | for (var i = 0; i <= this.detailY; i++){ |
| 34866 | v = i / this.detailY; |
| 34867 | for (var j = 0; j <= this.detailX; j++){ |
| 34868 | u = j / this.detailX; |
| 34869 | var theta = 2 * Math.PI * u; |
| 34870 | var phi = 2 * Math.PI * v; |
| 34871 | p = new p5.Vector( |
| 34872 | (radius + tubeRadius * Math.cos(phi)) * Math.cos(theta), |
| 34873 | (radius + tubeRadius * Math.cos(phi)) * Math.sin(theta), |
| 34874 | tubeRadius * Math.sin(phi)); |
| 34875 | this.vertices.push(p); |
| 34876 | this.uvs.push([u,v]); |
| 34877 | } |
| 34878 | } |
| 34879 | }; |
| 34880 | var torusGeom = new p5.Geometry(detailX, detailY, _torus); |
| 34881 | torusGeom |
| 34882 | .computeFaces() |
nothing calls this directly
no outgoing calls
no test coverage detected