X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=antikythera;a=blobdiff_plain;f=src%2Fgear.cc;fp=src%2Fgear.cc;h=44c04d3a02ced0833793fad28f702c620a2ae1a5;hp=c00b411221545d6b708da2a7ea1a4f17ae7edc59;hb=b27d1ee9fe9f75f2af783e4f9574366879f5e849;hpb=ffda3e942f7a41a9ac348cfe60ae27e211545ba3 diff --git a/src/gear.cc b/src/gear.cc index c00b411..44c04d3 100644 --- a/src/gear.cc +++ b/src/gear.cc @@ -8,14 +8,14 @@ Gear::Gear() { pdist = 0; angle = 0; - nteeth = 42; - radius = 80; teeth_length = 5; thickness = 5; bevel = 1.5; init_angle = 0; xform_valid = false; + set_teeth(42, 10); + supergear = 0; mesh = 0; @@ -78,6 +78,11 @@ float Gear::get_angular_offset() const void Gear::set_teeth(int nt, float tooth_pitch) { + if(tooth_pitch <= 0) { + tooth_pitch = this->tooth_pitch; + } else { + this->tooth_pitch = tooth_pitch; + } float circ = tooth_pitch * nt; radius = circ / (2.0 * M_PI); nteeth = nt;