mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 04:15:31 +00:00
Animation with physics attempt
This commit is contained in:
parent
45c57721ff
commit
c2fa82326d
3 changed files with 13 additions and 7 deletions
|
@ -411,10 +411,7 @@ namespace MWRender{
|
|||
if(bQuats)
|
||||
bone->setOrientation(r);
|
||||
|
||||
if(iter == transformations->begin()){
|
||||
trans = bone->getPosition();
|
||||
rotate = bone->getOrientation();
|
||||
}
|
||||
|
||||
skel->getManualBonesDirty();
|
||||
skel->_updateTransforms();
|
||||
skel->_notifyManualBonesDirty();
|
||||
|
|
|
@ -20,8 +20,9 @@ class Animation{
|
|||
OEngine::Render::OgreRenderer &mRend;
|
||||
MWWorld::Environment& mEnvironment;
|
||||
static std::map<std::string, int> mUniqueIDs;
|
||||
Ogre::Quaternion rotate;
|
||||
Ogre::Vector3 trans;
|
||||
|
||||
Ogre::Vector3 originalpos;
|
||||
Ogre::Vector3 originalscenenode;
|
||||
std::vector<std::vector<Nif::NiTriShapeCopy>* > shapeparts; //All the NiTriShape data that we need for animating an npc
|
||||
|
||||
float time;
|
||||
|
|
|
@ -214,6 +214,8 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, MWWorld::Environment& _env,O
|
|||
insertFreePart("meshes\\" + feet->model,"><", insert);
|
||||
insertFreePart("meshes\\" + feet->model,">:", insert);
|
||||
}
|
||||
originalpos = insert->_getWorldAABB().getCenter();
|
||||
originalscenenode = insert->getPosition();
|
||||
}
|
||||
|
||||
Ogre::Entity* NpcAnimation::insertBoundedPart(const std::string &mesh, std::string bonename){
|
||||
|
@ -259,7 +261,13 @@ void NpcAnimation::runAnimation(float timepassed){
|
|||
}
|
||||
|
||||
handleAnimationTransforms();
|
||||
//mEnvironment.mWorld->
|
||||
Ogre::Vector3 current = insert->_getWorldAABB().getCenter();
|
||||
|
||||
//This is the attempt at npc physics
|
||||
//mEnvironment.mWorld->setObjectPhysicsPosition(insert->getName(), current);
|
||||
|
||||
|
||||
|
||||
/*if(base->hasSkeleton())
|
||||
{
|
||||
|
||||
|
|
Loading…
Reference in a new issue