- float angle = rods[rod.pivot_index].angle;
- float c = cos(angle);
- float s = sin(angle);
- const Point &pos = rods[rod.pivot_index].position;
- const Point &off = rod.pivot_point;
- rods[i].position = Point(pos.x+off.x*c-off.z*s, pos.y+off.y, pos.z+off.z*c+off.x*s);
+ const Rod &prod = get_rod(i->type->pivot_index);
+ float c = cos(prod.angle);
+ float s = sin(prod.angle);
+ const Vector &pos = prod.position;
+ const Vector &off = i->type->pivot_point;
+ i->position = Vector(pos.x+off.x*c-off.z*s, pos.y+off.y, pos.z+off.z*c+off.x*s);