passed by constructor.

This commit is contained in:
jaynus
2015-05-15 22:56:43 -07:00
parent 1b93c89c28
commit 18b77cd003
3 changed files with 3 additions and 5 deletions

View File

@ -387,7 +387,7 @@ ace::simulation::object::object()
{ {
} }
ace::simulation::object::object(const ace::p3d::model_p model) : reversed(false) ace::simulation::object::object(const ace::p3d::model_p model, bool reverse_ = false) : reversed(reverse_)
{ {
for (ace::p3d::lod_p p3d_lod : model->lods) { for (ace::p3d::lod_p p3d_lod : model->lods) {
lod_p new_lod = std::make_shared<lod>(p3d_lod, model); lod_p new_lod = std::make_shared<lod>(p3d_lod, model);

View File

@ -202,7 +202,7 @@ namespace ace {
class object { class object {
public: public:
object(); object();
object(const ace::p3d::model_p); object(const ace::p3d::model_p, bool reversed);
~object(); ~object();
bool reversed; bool reversed;

View File

@ -110,12 +110,10 @@ namespace ace {
} }
if (ace::model_collection::get().load_model(model_str)) { if (ace::model_collection::get().load_model(model_str)) {
std::shared_ptr<ace::simulation::object> _object = std::make_shared<ace::simulation::object>(model_collection::get().models[model_str].model); std::shared_ptr<ace::simulation::object> _object = std::make_shared<ace::simulation::object>(model_collection::get().models[model_str].model, (static_cast<int>(_args[2]) != 0 ? true : false));
vehicle_p _vehicle = std::make_shared<vehicle>(static_cast<uint32_t>(_args[1]), _object, _args[2]); vehicle_p _vehicle = std::make_shared<vehicle>(static_cast<uint32_t>(_args[1]), _object, _args[2]);
vehicles[static_cast<uint32_t>(_args[1])] = _vehicle; vehicles[static_cast<uint32_t>(_args[1])] = _vehicle;
_vehicle->object->reversed = (static_cast<int>(_args[2]) != 0 ? true : false);
// For results on a valid vehicle registration, we return its animation names for that given vehicle // For results on a valid vehicle registration, we return its animation names for that given vehicle
std::stringstream _animationNames; std::stringstream _animationNames;
_animationNames << _vehicle->id; _animationNames << _vehicle->id;