From 5572323a3a4070a32ca82cf018ea312208730d5b Mon Sep 17 00:00:00 2001 From: Jiri Hnidek Date: Mon, 8 Sep 2003 12:13:54 +0000 Subject: - added czech translation (cs.po) - changed function drawcircball() in source/blender/src/drawobject.c. Circle is computed faster (no 32 calls of sin() and cos() each time witch same results). --- source/blender/src/drawobject.c | 82 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 10 deletions(-) (limited to 'source') diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index 908ff9f45bb..0fbe2aa89df 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -3022,24 +3022,86 @@ static void tekentextcurs(void) void drawcircball(float *cent, float rad, float tmat[][4]) { - float si, co, phi, dphi, vec[3], vx[3], vy[3]; + float vec[3], vx[3], vy[3]; int a, tot=32; + + /* 32 values of sin function (still same result!) */ + static float si[32] = {0.00000000, + 0.20129852, + 0.39435585, + 0.57126821, + 0.72479278, + 0.84864425, + 0.93775213, + 0.98846832, + 0.99871650, + 0.96807711, + 0.89780453, + 0.79077573, + 0.65137248, + 0.48530196, + 0.29936312, + 0.10116832, + -0.10116832, + -0.29936312, + -0.48530196, + -0.65137248, + -0.79077573, + -0.89780453, + -0.96807711, + -0.99871650, + -0.98846832, + -0.93775213, + -0.84864425, + -0.72479278, + -0.57126821, + -0.39435585, + -0.20129852, + 0.00000000}; + /* 32 values of cos function (still same result!) */ + static float co[32] ={1.00000000, + 0.97952994, + 0.91895781, + 0.82076344, + 0.68896691, + 0.52896401, + 0.34730525, + 0.15142777, + -0.05064916, + -0.25065253, + -0.44039415, + -0.61210598, + -0.75875812, + -0.87434661, + -0.95413925, + -0.99486932, + -0.99486932, + -0.95413925, + -0.87434661, + -0.75875812, + -0.61210598, + -0.44039415, + -0.25065253, + -0.05064916, + 0.15142777, + 0.34730525, + 0.52896401, + 0.68896691, + 0.82076344, + 0.91895781, + 0.97952994, + 1.00000000}; VECCOPY(vx, tmat[0]); VECCOPY(vy, tmat[1]); VecMulf(vx, rad); VecMulf(vy, rad); - dphi= 2.0*M_PI/tot; - phi= 0.0; - glBegin(GL_LINE_LOOP); - for(a=0; a