projects
/
antikythera
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move gears along their axis with the mousewheel
[antikythera]
/
src
/
gear.cc
diff --git
a/src/gear.cc
b/src/gear.cc
index
10e8bc8
..
c916e76
100644
(file)
--- a/
src/gear.cc
+++ b/
src/gear.cc
@@
-24,6
+24,17
@@
Gear::~Gear()
delete mesh;
}
delete mesh;
}
+void Gear::set_angular_offset(float offs)
+{
+ init_angle = offs;
+ xform_valid = false;
+}
+
+float Gear::get_angular_offset() const
+{
+ return init_angle;
+}
+
void Gear::set_teeth(int nt, float tooth_pitch)
{
float circ = tooth_pitch * nt;
void Gear::set_teeth(int nt, float tooth_pitch)
{
float circ = tooth_pitch * nt;
@@
-37,6
+48,11
@@
void Gear::set_axis(const Vec3 &axis)
xform_valid = false;
}
xform_valid = false;
}
+const Vec3 &Gear::get_axis() const
+{
+ return axis;
+}
+
void Gear::set_position(const Vec3 &pos)
{
this->pos = pos;
void Gear::set_position(const Vec3 &pos)
{
this->pos = pos;