GL::Matrix matrix;
const Vector &pos = vehicle.get_position();
matrix.translate(pos.x, pos.y, pos.z);
- matrix.rotate(vehicle.get_direction(), 0, 0, 1);
+ float dir = vehicle.get_direction();
+ if(vehicle.get_type().get_rotate_object())
+ dir += M_PI;
+ matrix.rotate(dir, 0, 0, 1);
renderer.matrix_stack() *= matrix;
}
swap_direction(false),
length(0),
width(0),
- height(0)
+ height(0),
+ rotate_object(false)
{ }
unsigned VehicleType::get_max_function() const
add("name", &VehicleType::name);
add("object", &VehicleType::object);
add("rod", &Loader::rod);
+ add("rotate_object", &VehicleType::rotate_object);
add("swap_direction", &VehicleType::swap_direction);
add("width", &Loader::width);
}
BogieArray bogies;
RodArray rods;
std::string object;
+ bool rotate_object;
public:
VehicleType(const ArticleNumber &);
float get_front_axle_offset() const;
float get_back_axle_offset() const;
const std::string &get_object() const { return object; }
+ bool get_rotate_object() const { return rotate_object; }
};
} // namespace R2C2