mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Merge remote-tracking branch 'cc9cii/branch_0_29_fixes' into openmw-29
This commit is contained in:
commit
0926501717
3 changed files with 9 additions and 11 deletions
|
@ -980,13 +980,11 @@ void RenderingManager::screenshot(Image &image, int w, int h)
|
|||
|
||||
Ogre::PixelFormat pf = rt->suggestPixelFormat();
|
||||
|
||||
std::vector<Ogre::uchar> data;
|
||||
data.resize(w * h * Ogre::PixelUtil::getNumElemBytes(pf));
|
||||
|
||||
Ogre::PixelBox pb(w, h, 1, pf, &data[0]);
|
||||
rt->copyContentsToMemory(pb);
|
||||
|
||||
image.loadDynamicImage(&data[0], w, h, pf);
|
||||
image.loadDynamicImage(
|
||||
OGRE_ALLOC_T(Ogre::uchar, w * h * Ogre::PixelUtil::getNumElemBytes(pf), Ogre::MEMCATEGORY_GENERAL),
|
||||
w, h, 1, pf, true // autoDelete=true, frees memory we allocate
|
||||
);
|
||||
rt->copyContentsToMemory(image.getPixelBox()); // getPixelBox returns a box sharing the same memory as the image
|
||||
|
||||
Ogre::TextureManager::getSingleton().remove(tempName);
|
||||
mRendering.getCamera()->setAspectRatio(oldAspect);
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Physic
|
|||
mBody = mEngine->createAndAdjustRigidBody(mMesh, mName, scale, position, rotation, &mBoxScaledTranslation, &mBoxRotation);
|
||||
mRaycastingBody = mEngine->createAndAdjustRigidBody(mMesh, mName, scale, position, rotation, &mBoxScaledTranslation, &mBoxRotation, true);
|
||||
Ogre::Quaternion inverse = mBoxRotation.Inverse();
|
||||
mBoxRotationInverse = btQuaternion(inverse.x, inverse.y, inverse.z,inverse.w);
|
||||
mBoxRotationInverse = Ogre::Quaternion(inverse.w, inverse.x, inverse.y,inverse.z);
|
||||
mEngine->addRigidBody(mBody, false, mRaycastingBody,true); //Add rigid body to dynamics world, but do not add to object map
|
||||
}
|
||||
|
||||
|
@ -85,8 +85,8 @@ namespace Physic
|
|||
Ogre::Quaternion PhysicActor::getRotation()
|
||||
{
|
||||
assert(mBody);
|
||||
btQuaternion quat = mBody->getWorldTransform().getRotation() * mBoxRotationInverse;
|
||||
return Ogre::Quaternion(quat.getW(), quat.getX(), quat.getY(), quat.getZ());
|
||||
btQuaternion quat = mBody->getWorldTransform().getRotation();
|
||||
return Ogre::Quaternion(quat.getW(), quat.getX(), quat.getY(), quat.getZ()) * mBoxRotationInverse;
|
||||
}
|
||||
|
||||
void PhysicActor::setScale(float scale){
|
||||
|
|
|
@ -162,7 +162,7 @@ namespace Physic
|
|||
|
||||
Ogre::Vector3 mBoxScaledTranslation;
|
||||
Ogre::Quaternion mBoxRotation;
|
||||
btQuaternion mBoxRotationInverse;
|
||||
Ogre::Quaternion mBoxRotationInverse;
|
||||
|
||||
Ogre::Vector3 mForce;
|
||||
bool mOnGround;
|
||||
|
|
Loading…
Reference in a new issue