|
|
|
@ -112,14 +112,11 @@ namespace MWRender{
|
|
|
|
|
|
|
|
|
|
Nif::NiTriShapeCopy& copy = *allshapesiter;
|
|
|
|
|
std::vector<Ogre::Vector3>* allvertices = ©.vertices;
|
|
|
|
|
std::vector<Ogre::Vector3>* allnormals = ©.normals;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//std::set<unsigned int> vertices;
|
|
|
|
|
//std::set<unsigned int> normals;
|
|
|
|
|
//std::vector<Nif::NiSkinData::BoneInfoCopy> boneinfovector = copy.boneinfo;
|
|
|
|
|
std::map<int, std::vector<Nif::NiSkinData::IndividualWeight>>* verticesToChange = ©.vertsToWeights;
|
|
|
|
|
std::map<int, std::vector<Nif::NiSkinData::IndividualWeight> >* verticesToChange = ©.vertsToWeights;
|
|
|
|
|
|
|
|
|
|
//std::cout << "Name " << copy.sname << "\n";
|
|
|
|
|
Ogre::HardwareVertexBufferSharedPtr vbuf = creaturemodel->getMesh()->getSubMesh(copy.sname)->vertexData->vertexBufferBinding->getBuffer(0);
|
|
|
|
@ -135,7 +132,7 @@ namespace MWRender{
|
|
|
|
|
if(copy.vertices.size() == initialVertices.size())
|
|
|
|
|
{
|
|
|
|
|
//Create if it doesn't already exist
|
|
|
|
|
if(shapeIndexI.size() == shapeNumber)
|
|
|
|
|
if(shapeIndexI.size() == static_cast<std::size_t> (shapeNumber))
|
|
|
|
|
{
|
|
|
|
|
std::vector<int> vec;
|
|
|
|
|
shapeIndexI.push_back(vec);
|
|
|
|
@ -178,7 +175,7 @@ namespace MWRender{
|
|
|
|
|
|
|
|
|
|
if(verticesToChange->size() > 0){
|
|
|
|
|
|
|
|
|
|
for(std::map<int, std::vector<Nif::NiSkinData::IndividualWeight>>::iterator iter = verticesToChange->begin();
|
|
|
|
|
for(std::map<int, std::vector<Nif::NiSkinData::IndividualWeight> >::iterator iter = verticesToChange->begin();
|
|
|
|
|
iter != verticesToChange->end(); iter++)
|
|
|
|
|
{
|
|
|
|
|
std::vector<Nif::NiSkinData::IndividualWeight> inds = iter->second;
|
|
|
|
@ -217,7 +214,7 @@ namespace MWRender{
|
|
|
|
|
Ogre::Vector3 absVertPos = (vecPos + vecRot * currentVertex) * inds[0].weight;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i = 1; i < inds.size(); i++){
|
|
|
|
|
for(std::size_t i = 1; i < inds.size(); i++){
|
|
|
|
|
boneinfocopy = &(allshapesiter->boneinfo[inds[i].boneinfocopyindex]);
|
|
|
|
|
if(useHandles)
|
|
|
|
|
bonePtr = skel->getBone(boneinfocopy->bonehandle);
|
|
|
|
@ -253,7 +250,8 @@ namespace MWRender{
|
|
|
|
|
*(addr+2) = absVertPos.z;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*for (unsigned int i = 0; i < boneinfovector.size(); i++)
|
|
|
|
|
#if 0
|
|
|
|
|
for (unsigned int i = 0; i < boneinfovector.size(); i++)
|
|
|
|
|
{
|
|
|
|
|
Nif::NiSkinData::BoneInfoCopy boneinfo = boneinfovector[i];
|
|
|
|
|
if(skel->hasBone(boneinfo.bonename)){
|
|
|
|
@ -292,7 +290,7 @@ namespace MWRender{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*if(normals.find(verIndex) == normals.end())
|
|
|
|
|
if(normals.find(verIndex) == normals.end())
|
|
|
|
|
{
|
|
|
|
|
Ogre::Vector3 absNormalsPos = vecRot * allnormals[verIndex];
|
|
|
|
|
absNormalsPos = absNormalsPos * boneinfo.weights[j].weight;
|
|
|
|
@ -314,8 +312,8 @@ namespace MWRender{
|
|
|
|
|
*(addr+1) = absNormalsPos.y;
|
|
|
|
|
*(addr+2) = absNormalsPos.z;
|
|
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
//}
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
@ -546,7 +544,7 @@ namespace MWRender{
|
|
|
|
|
//base->_updateAnimation();
|
|
|
|
|
base->_notifyMoved();
|
|
|
|
|
}
|
|
|
|
|
for(int i = 0; i < entityparts.size(); i++){
|
|
|
|
|
for(std::size_t i = 0; i < entityparts.size(); i++){
|
|
|
|
|
skel = entityparts[i]->getSkeleton();
|
|
|
|
|
if(skel->hasBone(iter->getBonename())){
|
|
|
|
|
Ogre::Bone* bone = skel->getBone(iter->getBonename());
|
|
|
|
|