mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 00:36:46 +00:00
Various npc heights
This commit is contained in:
parent
f7d26b2695
commit
289b8f667e
1 changed files with 23 additions and 9 deletions
|
@ -35,15 +35,25 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,O
|
||||||
// vector = Ogre::Vector3(1,1,-1);
|
// vector = Ogre::Vector3(1,1,-1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string hairID = ref->base->hair;
|
std::string hairID = ref->base->hair;
|
||||||
std::string headID = ref->base->head;
|
std::string headID = ref->base->head;
|
||||||
std::string npcName = ref->base->name;
|
std::string npcName = ref->base->name;
|
||||||
|
//ESMStore::Races r =
|
||||||
|
const ESM::Race* race = mEnvironment.mWorld->getStore().races.find(ref->base->race);
|
||||||
|
|
||||||
|
|
||||||
std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4);
|
std::string bodyRaceID = headID.substr(0, headID.find_last_of("head_") - 4);
|
||||||
char secondtolast = bodyRaceID.at(bodyRaceID.length() - 2);
|
char secondtolast = bodyRaceID.at(bodyRaceID.length() - 2);
|
||||||
bool female = tolower(secondtolast) == 'f';
|
bool female = tolower(secondtolast) == 'f';
|
||||||
bool beast = bodyRaceID == "b_n_khajiit_m_" || bodyRaceID == "b_n_khajiit_f_" || bodyRaceID == "b_n_argonian_m_" || bodyRaceID == "b_n_argonian_f_";
|
bool beast = bodyRaceID == "b_n_khajiit_m_" || bodyRaceID == "b_n_khajiit_f_" || bodyRaceID == "b_n_argonian_m_" || bodyRaceID == "b_n_argonian_f_";
|
||||||
|
std::cout << "Race: " << ref->base->race ;
|
||||||
|
if(female){
|
||||||
|
std::cout << " Sex: Female" << " Height: " << race->data.height.female << "\n";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
std::cout << " Sex: Male" << " Height: " << race->data.height.male << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::string smodel = "meshes\\base_anim.nif";
|
std::string smodel = "meshes\\base_anim.nif";
|
||||||
|
@ -76,8 +86,10 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,O
|
||||||
}
|
}
|
||||||
insert->attachObject(base);
|
insert->attachObject(base);
|
||||||
|
|
||||||
if(bodyRaceID == "b_n_wood elf_f_" || bodyRaceID == "b_n_wood elf_m_")
|
if(female)
|
||||||
insert->scale(.9,.9,.9);
|
insert->scale(race->data.height.female, race->data.height.female, race->data.height.female);
|
||||||
|
else
|
||||||
|
insert->scale(race->data.height.male, race->data.height.male, race->data.height.male);
|
||||||
std::string headModel = "meshes\\" +
|
std::string headModel = "meshes\\" +
|
||||||
mEnvironment.mWorld->getStore().bodyParts.find(headID)->model;
|
mEnvironment.mWorld->getStore().bodyParts.find(headID)->model;
|
||||||
|
|
||||||
|
@ -108,6 +120,8 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,O
|
||||||
const ESM::BodyPart* forearmr = forearml;
|
const ESM::BodyPart* forearmr = forearml;
|
||||||
const ESM::BodyPart* wristr = wristl;
|
const ESM::BodyPart* wristr = wristl;
|
||||||
const ESM::BodyPart* armr = arml;
|
const ESM::BodyPart* armr = arml;
|
||||||
|
|
||||||
|
|
||||||
if(upperleg){
|
if(upperleg){
|
||||||
insertBoundedPart("meshes\\" + upperleg->model + "*|", "Left Upper Leg");
|
insertBoundedPart("meshes\\" + upperleg->model + "*|", "Left Upper Leg");
|
||||||
insertBoundedPart("meshes\\" + upperleg->model, "Right Upper Leg");
|
insertBoundedPart("meshes\\" + upperleg->model, "Right Upper Leg");
|
||||||
|
@ -248,7 +262,7 @@ void NpcAnimation::runAnimation(float timepassed){
|
||||||
// handleAnimationTransforms(base);
|
// handleAnimationTransforms(base);
|
||||||
//handleAnimationTransforms(hand);
|
//handleAnimationTransforms(hand);
|
||||||
//
|
//
|
||||||
std::vector<std::vector<Nif::NiTriShapeCopy>*>::iterator shapepartsiter = shapeparts.begin();
|
/*std::vector<std::vector<Nif::NiTriShapeCopy>*>::iterator shapepartsiter = shapeparts.begin();
|
||||||
std::vector<Ogre::Entity*>::iterator entitypartsiter = entityparts.begin();
|
std::vector<Ogre::Entity*>::iterator entitypartsiter = entityparts.begin();
|
||||||
//int i = 0;
|
//int i = 0;
|
||||||
while(shapepartsiter != shapeparts.end())
|
while(shapepartsiter != shapeparts.end())
|
||||||
|
@ -263,7 +277,7 @@ void NpcAnimation::runAnimation(float timepassed){
|
||||||
//std::cout << "Shape part size" << shapes->size() << "\n";
|
//std::cout << "Shape part size" << shapes->size() << "\n";
|
||||||
shapepartsiter++;
|
shapepartsiter++;
|
||||||
entitypartsiter++;
|
entitypartsiter++;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue