diff options
author | Stijn Buys <ingar@osirion.org> | 2011-03-30 16:39:27 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-03-30 16:39:27 +0000 |
commit | 2aea4a37f8007d429132b9b83da3dda7482be67e (patch) | |
tree | aec6ed7261759ec32b478d23fb7c77299f9e2e1b /src/model | |
parent | 4f5aa3b27c358815f2574ff65871e7ab291be597 (diff) |
Corrected func_move submodel instancing.
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/mapfile.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc index 8f8e87c..20d4c5c 100644 --- a/src/model/mapfile.cc +++ b/src/model/mapfile.cc @@ -1172,7 +1172,7 @@ void MapFile::load_fragmentgroup(Model *model, const FragmentGroup::Type class_t group->set_type(class_type); // these fragmentgroups are on the same level as worldspawn (no submodels) - // their axis is always the default + // their rotation axis is always identity switch (class_type) { case FragmentGroup::None: @@ -1805,16 +1805,17 @@ Model * MapFile::load(std::string const &name) for (Model::Groups::iterator git = submodel_model->groups().begin(); git != submodel_model->groups().end(); git++) { FragmentGroup *groupsrc = (*git); FragmentGroup *groupdst = new FragmentGroup(); - - groupdst->set_movement(groupsrc->movement()); + groupdst->set_type(groupsrc->type()); groupdst->set_scale(groupsrc->scale() * tag_submodel->scale()); groupdst->set_engine(groupsrc->engine()); groupdst->set_speed(groupsrc->speed()); - + groupdst->set_movement(groupsrc->movement()); + groupdst->set_distance(groupsrc->distance()); + groupdst->set_location(tag_submodel->location() + tag_submodel->axis() * (groupsrc->location() - submodel_model->origin()) * tag_submodel->scale()); groupdst->set_axis(tag_submodel->axis() * groupsrc->axis()); - + // copy fragments, this only copies the original fragment's pointer into the vertex array for (FragmentGroup::Fragments::const_iterator fit = groupsrc->fragments().begin(); fit != groupsrc->fragments().end(); fit++) { @@ -1933,6 +1934,9 @@ Model * MapFile::load(std::string const &name) Triangle *triangle = (*it); collisionmesh->add_triangle(triangle->v0() - map_center, triangle->v1() - map_center, triangle->v2() - map_center); } + + // TODO merge submodel collision meshes + // seperate collision meshes for movers // register the mesh CollisionMesh::add(collisionmesh); |