Files Classes Functions Hierarchy
#include <spring1.h>
Public Member Functions | |
| spring1 () | |
| void | init (uintc sample_, doublec h, doublec t0, doublec x00, doublec x10, doublec kval=0.1, doublec len=1.0, doublec radius=0.2) |
| void | idle () |
| void | draw () |
Public Attributes | |
| DEsys< double, 2, 1 > | de |
| RK< double, F > | fi |
| gspring | spr |
| bool | drawenabled |
| uint | sample |
| double | lennatural |
Definition at line 69 of file spring1.h.
| void spring1< F >::draw | ( | ) | [inline] |
Definition at line 111 of file spring1.h.
References spring1< F >::drawenabled, and spring1< F >::spr.
00112 { 00113 if (drawenabled) 00114 { 00115 glPushMatrix(); 00116 00117 spr.draw(); 00118 00119 glPopMatrix(); 00120 } 00121 }
| void spring1< F >::idle | ( | ) | [inline] |
Definition at line 124 of file spring1.h.
References spring1< F >::de, spring1< F >::lennatural, spring1< F >::sample, and spring1< F >::spr.
00125 { 00126 de(); 00127 00128 static uint counter; 00129 00130 ++counter; 00131 if ((counter % sample)==0) 00132 { 00133 spr.h.len = lennatural+de.y[0][0]; 00134 00135 glutPostRedisplay(); 00136 counter=0; 00137 } 00138 }
| void spring1< F >::init | ( | uintc | sample_, | |
| doublec | h, | |||
| doublec | t0, | |||
| doublec | x00, | |||
| doublec | x10, | |||
| doublec | kval = 0.1, |
|||
| doublec | len = 1.0, |
|||
| doublec | radius = 0.2 | |||
| ) | [inline] |
Definition at line 143 of file spring1.h.
00153 { 00154 de.h[0]=h; 00155 00156 de.xval = t0; 00157 de.yi[0] = x00; 00158 de.yi[1] = x10; 00159 00160 fi.Dy.kval = kval; 00161 fi.Dy.x = & (de.y[0][0]); 00162 00163 de.fi[0] = & fi; 00164 00165 lennatural = len; 00166 00167 spr = gspring 00168 ( 00169 helix(len+x00,10,0.2,200, 0.2,0.8,0.17), 00170 mysphere 00171 ( 00172 radius, 00173 0.1,0.6,0.77, 00174 0.0,0.0,0.0 00175 ) 00176 ); 00177 00178 sample=sample_; 00179 00180 drawenabled=true; 00181 }
| bool spring1< F >::drawenabled |
| double spring1< F >::lennatural |
Definition at line 76 of file spring1.h.
Referenced by spring1< F >::draw(), and spring1< F >::idle().
1.5.8