Lines Matching refs:torus
38 Torus *torus; local
52 torus = (Torus *)share_malloc(sizeof(Torus));
58 torus->a = a;
59 torus->b = b;
60 torus->aa = a*a;
61 torus->bb = b*b;
62 CoordSysTransform(pos, &tmpnrm, 1., 1., &torus->trans);
64 return torus;
71 TorusIntersect(torus, inray, mindist, maxdist) in TorusIntersect() argument
72 Torus *torus; in TorusIntersect()
87 distfactor = RayTransform(&tmpray, &torus->trans.itrans);
147 as = torus->aa;
148 bs = torus->bb;
193 TorusNormal(torus, rawpos, nrm, gnrm) in TorusNormal() argument
194 Torus *torus; in TorusNormal()
202 PointTransform(&pos, &torus->trans.itrans);
236 xm = torus->a * posx / dist;
237 ym = torus->a * posy / dist;
251 NormalTransform(nrm, &torus->trans.itrans);
257 TorusUV(torus, pos, norm, uv, dpdu, dpdv) in TorusUV() argument
258 Torus *torus; in TorusUV()
266 PointTransform(&npos, &torus->trans.itrans);
285 VecTransform(dpdu, &torus->trans.trans);
294 cosphi = -(rad - torus->a) / torus->b;
308 VecTransform(dpdv, &torus->trans.trans);
317 TorusBounds(torus, bounds) in TorusBounds() argument
318 Torus *torus; in TorusBounds()
321 bounds[LOW][X] = bounds[LOW][Y] = -(torus->a+torus->b);
322 bounds[HIGH][X] = bounds[HIGH][Y] = torus->a+torus->b;
323 bounds[LOW][Z] = -torus->b;
324 bounds[HIGH][Z] = torus->b;
328 BoundsTransform(&torus->trans.trans, bounds);