forked from teamnwah/openmw-tes3coop
Warning and different physics
This commit is contained in:
parent
295eb27c2d
commit
a615369189
4 changed files with 32 additions and 9 deletions
|
@ -47,7 +47,7 @@ namespace MWClass
|
||||||
const std::string &model = ref->base->model;
|
const std::string &model = ref->base->model;
|
||||||
assert (ref->base != NULL);
|
assert (ref->base != NULL);
|
||||||
if(!model.empty()){
|
if(!model.empty()){
|
||||||
physics.insertActorPhysics(ptr, "meshes\\" + model);
|
physics.insertObjectPhysics(ptr, "meshes\\" + model);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ namespace MWClass
|
||||||
std::string smodel = "meshes\\base_anim.nif";
|
std::string smodel = "meshes\\base_anim.nif";
|
||||||
if(beast)
|
if(beast)
|
||||||
smodel = "meshes\\base_animkna.nif";
|
smodel = "meshes\\base_animkna.nif";
|
||||||
physics.insertActorPhysics(ptr, smodel);
|
physics.insertObjectPhysics(ptr, smodel);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,15 +35,39 @@ namespace MWRender{
|
||||||
}
|
}
|
||||||
else if(textmappings){
|
else if(textmappings){
|
||||||
|
|
||||||
std::string startName = groupname + ": start";
|
std::string startName = groupname + ": loop start";
|
||||||
std::string stopName = groupname + ": stop";
|
std::string stopName = groupname + ": loop stop";
|
||||||
|
|
||||||
|
bool first = false;
|
||||||
|
|
||||||
if(loops > 1){
|
if(loops > 1){
|
||||||
startName = groupname + ": loop start";
|
startName = groupname + ": loop start";
|
||||||
std::string stopName = groupname + ": loop stop";
|
stopName = groupname + ": loop stop";
|
||||||
|
|
||||||
|
for(std::map<std::string, float>::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){
|
||||||
|
|
||||||
|
std::string current = iter->first.substr(0, startName.size());
|
||||||
|
std::transform(current.begin(), current.end(), current.begin(), ::tolower);
|
||||||
|
std::string current2 = iter->first.substr(0, stopName.size());
|
||||||
|
std::transform(current2.begin(), current2.end(), current2.begin(), ::tolower);
|
||||||
|
|
||||||
|
if(current == startName){
|
||||||
|
startTime = iter->second;
|
||||||
|
animate = loops;
|
||||||
|
time = startTime;
|
||||||
|
first = true;
|
||||||
|
}
|
||||||
|
if(current2 == stopName){
|
||||||
|
stopTime = iter->second;
|
||||||
|
if(first)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::cout << "StartName:" << startName << "\n";
|
if(!first){
|
||||||
bool first = false;
|
startName = groupname + ": start";
|
||||||
|
stopName = groupname + ": stop";
|
||||||
|
|
||||||
for(std::map<std::string, float>::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){
|
for(std::map<std::string, float>::iterator iter = textmappings->begin(); iter != textmappings->end(); iter++){
|
||||||
|
|
||||||
std::string current = iter->first.substr(0, startName.size());
|
std::string current = iter->first.substr(0, startName.size());
|
||||||
|
@ -63,6 +87,7 @@ namespace MWRender{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <openengine/bullet/physic.hpp>
|
#include <openengine/bullet/physic.hpp>
|
||||||
|
|
||||||
using namespace boost::algorithm;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue