diff --git a/3rdparty/bullet3/src/BulletCollision/BroadphaseCollision/btDbvt.cpp b/3rdparty/bullet3/src/BulletCollision/BroadphaseCollision/btDbvt.cpp index ae087c8b53..7faf81e4e4 100644 --- a/3rdparty/bullet3/src/BulletCollision/BroadphaseCollision/btDbvt.cpp +++ b/3rdparty/bullet3/src/BulletCollision/BroadphaseCollision/btDbvt.cpp @@ -829,7 +829,7 @@ struct btDbvtBenchmark static btTransform RandTransform(btScalar cs) { btTransform t; - t.setOrigin(RandVector3(cs)); + t.m_origin = (RandVector3(cs)); t.setRotation(btQuaternion(RandUnit() * SIMD_PI * 2, RandUnit() * SIMD_PI * 2, RandUnit() * SIMD_PI * 2).normalized()); return (t); } diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp index 57152105fd..1089ebd931 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -38,18 +38,18 @@ void SphereTriangleDetector::getClosestPoints(const ClosestPointInput& input, Re //move sphere into triangle space btTransform sphereInTr = transformB.inverseTimes(transformA); - if (collide(sphereInTr.getOrigin(), point, normal, depth, timeOfImpact, m_contactBreakingThreshold)) + if (collide(sphereInTr.m_origin, point, normal, depth, timeOfImpact, m_contactBreakingThreshold)) { if (swapResults) { - btVector3 normalOnB = transformB.getBasis() * normal; + btVector3 normalOnB = transformB.m_basis * normal; btVector3 normalOnA = -normalOnB; btVector3 pointOnA = transformB * point + normalOnB * depth; output.addContactPoint(normalOnA, pointOnA, depth); } else { - output.addContactPoint(transformB.getBasis() * normal, transformB * point, depth); + output.addContactPoint(transformB.m_basis * normal, transformB * point, depth); } } } diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp index 6873a95d90..6861b3be1e 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp @@ -4,8 +4,8 @@ Bullet Continuous Collision Detection and Physics Library This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -138,8 +138,8 @@ static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1 btAssert(0 <= edge1 && edge1 < poly1->getVertexCount()); // Convert normal from poly1's frame into poly2's frame. - btVector3 normal1World = b2Mul(xf1.getBasis(), normals1[edge1]); - btVector3 normal1 = b2MulT(xf2.getBasis(), normal1World); + btVector3 normal1World = b2Mul(xf1.m_basis, normals1[edge1]); + btVector3 normal1 = b2MulT(xf2.m_basis, normal1World); // Find support vertex on poly2 for -normal. int index = 0; @@ -164,7 +164,7 @@ static btScalar FindMaxSeparation(int* edgeIndex, // Vector pointing from the centroid of poly1 to the centroid of poly2. btVector3 d = b2Mul(xf2, poly2->getCentroid()) - b2Mul(xf1, poly1->getCentroid()); - btVector3 dLocal1 = b2MulT(xf1.getBasis(), d); + btVector3 dLocal1 = b2MulT(xf1.m_basis, d); // Find edge normal on poly1 that has the largest projection onto d. int edge = 0; @@ -259,7 +259,7 @@ static void FindIncidentEdge(ClipVertex c[2], btAssert(0 <= edge1 && edge1 < poly1->getVertexCount()); // Get the normal of the reference edge in poly2's frame. - btVector3 normal1 = b2MulT(xf2.getBasis(), b2Mul(xf1.getBasis(), normals1[edge1])); + btVector3 normal1 = b2MulT(xf2.m_basis, b2Mul(xf1.m_basis, normals1[edge1])); // Find the incident edge on poly2. int index = 0; @@ -348,7 +348,7 @@ void b2CollidePolygons(btManifoldResult* manifold, btVector3 v12 = edge1 + 1 < count1 ? vertices1[edge1 + 1] : vertices1[0]; //btVector3 dv = v12 - v11; - btVector3 sideNormal = b2Mul(xf1.getBasis(), v12 - v11); + btVector3 sideNormal = b2Mul(xf1.m_basis, v12 - v11); sideNormal.normalize(); btVector3 frontNormal = btCrossS(sideNormal, 1.0f); diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp index 4b516463e2..c09539f42b 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp @@ -7,8 +7,8 @@ This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -740,14 +740,14 @@ void btBoxBoxDetector::getClosestPoints(const ClosestPointInput& input, Result& for (int j = 0; j < 3; j++) { - R1[0 + 4 * j] = transformA.getBasis()[j].x(); - R2[0 + 4 * j] = transformB.getBasis()[j].x(); + R1[0 + 4 * j] = transformA.m_basis[j].x(); + R2[0 + 4 * j] = transformB.m_basis[j].x(); - R1[1 + 4 * j] = transformA.getBasis()[j].y(); - R2[1 + 4 * j] = transformB.getBasis()[j].y(); + R1[1 + 4 * j] = transformA.m_basis[j].y(); + R2[1 + 4 * j] = transformB.m_basis[j].y(); - R1[2 + 4 * j] = transformA.getBasis()[j].z(); - R2[2 + 4 * j] = transformB.getBasis()[j].z(); + R1[2 + 4 * j] = transformA.m_basis[j].z(); + R2[2 + 4 * j] = transformB.m_basis[j].z(); } btVector3 normal; @@ -755,10 +755,10 @@ void btBoxBoxDetector::getClosestPoints(const ClosestPointInput& input, Result& int return_code; int maxc = 4; - dBoxBox2(transformA.getOrigin(), + dBoxBox2(transformA.m_origin, R1, 2.f * m_box1->getHalfExtentsWithMargin(), - transformB.getOrigin(), + transformB.m_origin, R2, 2.f * m_box2->getHalfExtentsWithMargin(), normal, &depth, &return_code, diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp index 15940f5b6d..4232b486e0 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp @@ -323,10 +323,10 @@ void btCollisionWorld::rayTestSingleInternal(const btTransform& rayFromTrans, co { if (castResult.m_fraction < resultCallback.m_closestHitFraction) { - //todo: figure out what this is about. When is rayFromTest.getBasis() not identity? + //todo: figure out what this is about. When is rayFromTest.m_basis not identity? #ifdef USE_SUBSIMPLEX_CONVEX_CAST //rotate normal into worldspace - castResult.m_normal = rayFromTrans.getBasis() * castResult.m_normal; + castResult.m_normal = rayFromTrans.m_basis * castResult.m_normal; #endif //USE_SUBSIMPLEX_CONVEX_CAST castResult.m_normal.normalize(); @@ -371,7 +371,7 @@ void btCollisionWorld::rayTestSingleInternal(const btTransform& rayFromTrans, co shapeInfo.m_shapePart = partId; shapeInfo.m_triangleIndex = triangleIndex; - btVector3 hitNormalWorld = m_colObjWorldTransform.getBasis() * hitNormalLocal; + btVector3 hitNormalWorld = m_colObjWorldTransform.m_basis * hitNormalLocal; btCollisionWorld::LocalRayResult rayResult(m_collisionObject, &shapeInfo, @@ -384,8 +384,8 @@ void btCollisionWorld::rayTestSingleInternal(const btTransform& rayFromTrans, co }; btTransform worldTocollisionObject = colObjWorldTransform.inverse(); - btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin(); - btVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin(); + btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.m_origin; + btVector3 rayToLocal = worldTocollisionObject * rayToTrans.m_origin; // BT_PROFILE("rayTestConcave"); if (collisionShape->getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE) @@ -413,15 +413,15 @@ void btCollisionWorld::rayTestSingleInternal(const btTransform& rayFromTrans, co rcb.m_hitFraction = resultCallback.m_closestHitFraction; triangleMesh->performRaycast(&rcb, rayFromLocalScaled, rayToLocalScaled); } - else if (((resultCallback.m_flags&btTriangleRaycastCallback::kF_DisableHeightfieldAccelerator)==0) - && collisionShape->getShapeType() == TERRAIN_SHAPE_PROXYTYPE + else if (((resultCallback.m_flags&btTriangleRaycastCallback::kF_DisableHeightfieldAccelerator)==0) + && collisionShape->getShapeType() == TERRAIN_SHAPE_PROXYTYPE ) { ///optimized version for btHeightfieldTerrainShape btHeightfieldTerrainShape* heightField = (btHeightfieldTerrainShape*)collisionShape; btTransform worldTocollisionObject = colObjWorldTransform.inverse(); - btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin(); - btVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin(); + btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.m_origin; + btVector3 rayToLocal = worldTocollisionObject * rayToTrans.m_origin; BridgeTriangleRaycastCallback rcb(rayFromLocal, rayToLocal, &resultCallback, collisionObjectWrap->getCollisionObject(), heightField, colObjWorldTransform); rcb.m_hitFraction = resultCallback.m_closestHitFraction; @@ -434,8 +434,8 @@ void btCollisionWorld::rayTestSingleInternal(const btTransform& rayFromTrans, co btTransform worldTocollisionObject = colObjWorldTransform.inverse(); - btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin(); - btVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin(); + btVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.m_origin; + btVector3 rayToLocal = worldTocollisionObject * rayToTrans.m_origin; //ConvexCast::CastResult @@ -463,7 +463,7 @@ void btCollisionWorld::rayTestSingleInternal(const btTransform& rayFromTrans, co shapeInfo.m_shapePart = partId; shapeInfo.m_triangleIndex = triangleIndex; - btVector3 hitNormalWorld = m_colObjWorldTransform.getBasis() * hitNormalLocal; + btVector3 hitNormalWorld = m_colObjWorldTransform.m_basis * hitNormalLocal; btCollisionWorld::LocalRayResult rayResult(m_collisionObject, &shapeInfo, @@ -581,8 +581,8 @@ void btCollisionWorld::rayTestSingleInternal(const btTransform& rayFromTrans, co #ifndef DISABLE_DBVT_COMPOUNDSHAPE_RAYCAST_ACCELERATION if (dbvt) { - btVector3 localRayFrom = colObjWorldTransform.inverseTimes(rayFromTrans).getOrigin(); - btVector3 localRayTo = colObjWorldTransform.inverseTimes(rayToTrans).getOrigin(); + btVector3 localRayFrom = colObjWorldTransform.inverseTimes(rayFromTrans).m_origin; + btVector3 localRayTo = colObjWorldTransform.inverseTimes(rayToTrans).m_origin; btDbvt::rayTest(dbvt->m_root, localRayFrom, localRayTo, rayCB); } else @@ -662,10 +662,10 @@ void btCollisionWorld::objectQuerySingleInternal(const btConvexShape* castShape, //BT_PROFILE("convexSweepbtBvhTriangleMesh"); btBvhTriangleMeshShape* triangleMesh = (btBvhTriangleMeshShape*)collisionShape; btTransform worldTocollisionObject = colObjWorldTransform.inverse(); - btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.getOrigin(); - btVector3 convexToLocal = worldTocollisionObject * convexToTrans.getOrigin(); + btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.m_origin; + btVector3 convexToLocal = worldTocollisionObject * convexToTrans.m_origin; // rotation of box in local mesh space = MeshRotation^-1 * ConvexToRotation - btTransform rotationXform = btTransform(worldTocollisionObject.getBasis() * convexToTrans.getBasis()); + btTransform rotationXform = btTransform(worldTocollisionObject.m_basis * convexToTrans.m_basis); //ConvexCast::CastResult struct BridgeTriangleConvexcastCallback : public btTriangleConvexcastCallback @@ -747,10 +747,10 @@ void btCollisionWorld::objectQuerySingleInternal(const btConvexShape* castShape, //BT_PROFILE("convexSweepConcave"); btConcaveShape* concaveShape = (btConcaveShape*)collisionShape; btTransform worldTocollisionObject = colObjWorldTransform.inverse(); - btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.getOrigin(); - btVector3 convexToLocal = worldTocollisionObject * convexToTrans.getOrigin(); + btVector3 convexFromLocal = worldTocollisionObject * convexFromTrans.m_origin; + btVector3 convexToLocal = worldTocollisionObject * convexToTrans.m_origin; // rotation of box in local mesh space = MeshRotation^-1 * ConvexToRotation - btTransform rotationXform = btTransform(worldTocollisionObject.getBasis() * convexToTrans.getBasis()); + btTransform rotationXform = btTransform(worldTocollisionObject.m_basis * convexToTrans.m_basis); //ConvexCast::CastResult struct BridgeTriangleConvexcastCallback : public btTriangleConvexcastCallback @@ -944,9 +944,9 @@ struct btSingleRayCallback : public btBroadphaseRayCallback m_resultCallback(resultCallback) { m_rayFromTrans.setIdentity(); - m_rayFromTrans.setOrigin(m_rayFromWorld); + m_rayFromTrans.m_origin = m_rayFromWorld; m_rayToTrans.setIdentity(); - m_rayToTrans.setOrigin(m_rayToWorld); + m_rayToTrans.m_origin = m_rayToWorld; btVector3 rayDir = (rayToWorld - rayFromWorld); @@ -1035,7 +1035,7 @@ struct btSingleSweepCallback : public btBroadphaseRayCallback m_allowedCcdPenetration(allowedPenetration), m_castShape(castShape) { - btVector3 unnormalizedRayDir = (m_convexToTrans.getOrigin() - m_convexFromTrans.getOrigin()); + btVector3 unnormalizedRayDir = (m_convexToTrans.m_origin - m_convexFromTrans.m_origin); btVector3 rayDir = unnormalizedRayDir.fuzzyZero() ? btVector3(btScalar(0.0), btScalar(0.0), btScalar(0.0)) : unnormalizedRayDir.normalized(); ///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT m_rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0]; @@ -1099,7 +1099,7 @@ void btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btT btSingleSweepCallback convexCB(castShape, convexFromWorld, convexToWorld, this, resultCallback, allowedCcdPenetration); - m_broadphasePairCache->rayTest(convexFromTrans.getOrigin(), convexToTrans.getOrigin(), convexCB, castShapeAabbMin, castShapeAabbMax); + m_broadphasePairCache->rayTest(convexFromTrans.m_origin, convexToTrans.m_origin, convexCB, castShapeAabbMin, castShapeAabbMax); #else /// go over all objects, and if the ray intersects their aabb + cast shape aabb, @@ -1117,7 +1117,7 @@ void btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btT AabbExpand(collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax); btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing btVector3 hitNormal; - if (btRayAabb(convexFromWorld.getOrigin(), convexToWorld.getOrigin(), collisionObjectAabbMin, collisionObjectAabbMax, hitLambda, hitNormal)) + if (btRayAabb(convexFromWorld.m_origin, convexToWorld.m_origin, collisionObjectAabbMin, collisionObjectAabbMax, hitLambda, hitNormal)) { objectQuerySingle(castShape, convexFromTrans, convexToTrans, collisionObject, @@ -1344,7 +1344,7 @@ void btCollisionWorld::debugDrawObject(const btTransform& worldTransform, const for (int i = multiSphereShape->getSphereCount() - 1; i >= 0; i--) { - childTransform.setOrigin(multiSphereShape->getSpherePosition(i)); + childTransform.m_origin = multiSphereShape->getSpherePosition(i); getDebugDrawer()->drawSphere(multiSphereShape->getSphereRadius(i), worldTransform * childTransform, color); } diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btCollisionWorld.h index fd0e5b9bbd..b8b5fb51b0 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btCollisionWorld.h +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btCollisionWorld.h @@ -4,8 +4,8 @@ Copyright (c) 2003-2013 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -26,18 +26,18 @@ subject to the following restrictions: * @section install_sec Installation * * @subsection step1 Step 1: Download - * You can download the Bullet Physics Library from the github repository: https://github.com/bulletphysics/bullet3/releases + * You can download the Bullet Physics Library from the github repository: https://github.com/bulletphysics/bullet3/releases * * @subsection step2 Step 2: Building * Bullet has multiple build systems, including premake, cmake and autotools. Premake and cmake support all platforms. - * Premake is included in the Bullet/build folder for Windows, Mac OSX and Linux. - * Under Windows you can click on Bullet/build/vs2010.bat to create Microsoft Visual Studio projects. + * Premake is included in the Bullet/build folder for Windows, Mac OSX and Linux. + * Under Windows you can click on Bullet/build/vs2010.bat to create Microsoft Visual Studio projects. * On Mac OSX and Linux you can open a terminal and generate Makefile, codeblocks or Xcode4 projects: * cd Bullet/build * ./premake4_osx gmake or ./premake4_linux gmake or ./premake4_linux64 gmake or (for Mac) ./premake4_osx xcode4 * cd Bullet/build/gmake * make - * + * * An alternative to premake is cmake. You can download cmake from http://www.cmake.org * cmake can autogenerate projectfiles for Microsoft Visual Studio, Apple Xcode, KDevelop and Unix Makefiles. * The easiest is to run the CMake cmake-gui graphical user interface and choose the options and generate projectfiles. @@ -46,12 +46,12 @@ subject to the following restrictions: * cmake . -G Xcode * cmake . -G "Unix Makefiles" * Although cmake is recommended, you can also use autotools for UNIX: ./autogen.sh ./configure to create a Makefile and then run make. - * + * * @subsection step3 Step 3: Testing demos * Try to run and experiment with BasicDemo executable as a starting point. * Bullet can be used in several ways, as Full Rigid Body simulation, as Collision Detector Library or Low Level / Snippets like the GJK Closest Point calculation. * The Dependencies can be seen in this documentation under Directories - * + * * @subsection step4 Step 4: Integrating in your application, full Rigid Body and Soft Body simulation * Check out BasicDemo how to create a btDynamicsWorld, btRigidBody and btCollisionShape, Stepping the simulation and synchronizing your graphics object transform. * Check out SoftDemo how to use soft body dynamics, using btSoftRigidDynamicsWorld. @@ -63,7 +63,7 @@ subject to the following restrictions: * * @section copyright Copyright * For up-to-data information and copyright and contributors list check out the Bullet_User_Manual.pdf - * + * */ #ifndef BT_COLLISION_WORLD_H @@ -257,7 +257,7 @@ class btCollisionWorld else { ///need to transform normal into worldspace - m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis() * rayResult.m_hitNormalLocal; + m_hitNormalWorld = m_collisionObject->getWorldTransform().m_basis * rayResult.m_hitNormalLocal; } m_hitPointWorld.setInterpolate3(m_rayFromWorld, m_rayToWorld, rayResult.m_hitFraction); return rayResult.m_hitFraction; @@ -293,7 +293,7 @@ class btCollisionWorld else { ///need to transform normal into worldspace - hitNormalWorld = m_collisionObject->getWorldTransform().getBasis() * rayResult.m_hitNormalLocal; + hitNormalWorld = m_collisionObject->getWorldTransform().m_basis * rayResult.m_hitNormalLocal; } m_hitNormalWorld.push_back(hitNormalWorld); btVector3 hitPointWorld; @@ -389,7 +389,7 @@ class btCollisionWorld else { ///need to transform normal into worldspace - m_hitNormalWorld = m_hitCollisionObject->getWorldTransform().getBasis() * convexResult.m_hitNormalLocal; + m_hitNormalWorld = m_hitCollisionObject->getWorldTransform().m_basis * convexResult.m_hitNormalLocal; } m_hitPointWorld = convexResult.m_hitPointLocal; return convexResult.m_hitFraction; diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp index f9dfc0a34a..99cb6e8a45 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -140,8 +140,8 @@ btScalar btConvex2dConvex2dAlgorithm::calculateTimeOfImpact(btCollisionObject* c ///col0->m_worldTransform, btScalar resultFraction = btScalar(1.); - btScalar squareMot0 = (col0->getInterpolationWorldTransform().getOrigin() - col0->getWorldTransform().getOrigin()).length2(); - btScalar squareMot1 = (col1->getInterpolationWorldTransform().getOrigin() - col1->getWorldTransform().getOrigin()).length2(); + btScalar squareMot0 = (col0->getInterpolationWorldTransform().m_origin - col0->getWorldTransform().m_origin).length2(); + btScalar squareMot1 = (col1->getInterpolationWorldTransform().m_origin - col1->getWorldTransform().m_origin).length2(); if (squareMot0 < col0->getCcdSquareMotionThreshold() && squareMot1 < col1->getCcdSquareMotionThreshold()) diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp index 95bce9e7c0..0f7bbfcd69 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -87,8 +87,8 @@ void btConvexTriangleCallback::processTriangle(btVector3* triangle, int partId, btCollisionAlgorithmConstructionInfo ci; ci.m_dispatcher1 = m_dispatcher; -#if 0 - +#if 0 + ///debug drawing of the overlapping triangles if (m_dispatchInfoPtr && m_dispatchInfoPtr->m_debugDraw && (m_dispatchInfoPtr->m_debugDraw->getDebugMode() &btIDebugDraw::DBG_DrawWireframe )) { @@ -116,8 +116,8 @@ void btConvexTriangleCallback::processTriangle(btVector3* triangle, int partId, triangle_normal_world.normalize(); btConvexShape* convex = (btConvexShape*)m_convexBodyWrap->getCollisionShape(); - - btVector3 localPt = convex->localGetSupportingVertex(m_convexBodyWrap->getWorldTransform().getBasis().inverse()*triangle_normal_world); + + btVector3 localPt = convex->localGetSupportingVertex(m_convexBodyWrap->getWorldTransform().m_basis.inverse()*triangle_normal_world); btVector3 worldPt = m_convexBodyWrap->getWorldTransform()*localPt; //now check if this is fully on one side of the triangle btScalar proj_distPt = triangle_normal_world.dot(worldPt); @@ -130,12 +130,12 @@ void btConvexTriangleCallback::processTriangle(btVector3* triangle, int partId, //also check the other side of the triangle triangle_normal_world*=-1; - localPt = convex->localGetSupportingVertex(m_convexBodyWrap->getWorldTransform().getBasis().inverse()*triangle_normal_world); + localPt = convex->localGetSupportingVertex(m_convexBodyWrap->getWorldTransform().m_basis.inverse()*triangle_normal_world); worldPt = m_convexBodyWrap->getWorldTransform()*localPt; //now check if this is fully on one side of the triangle proj_distPt = triangle_normal_world.dot(worldPt); proj_distTr = triangle_normal_world.dot(v0); - + dist = proj_distTr - proj_distPt; if (dist > contact_threshold) return; @@ -272,7 +272,7 @@ void btConvexConcaveCollisionAlgorithm::processCollision(const btCollisionObject if (dist <= maxDist) { normalLocal.safeNormalize(); - btVector3 normal = triBodyWrap->getWorldTransform().getBasis() * normalLocal; + btVector3 normal = triBodyWrap->getWorldTransform().m_basis * normalLocal; if (convex->getShapeType() == SPHERE_SHAPE_PROXYTYPE) { @@ -322,14 +322,14 @@ btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObj //only perform CCD above a certain threshold, this prevents blocking on the long run //because object in a blocked ccd state (hitfraction<1) get their linear velocity halved each frame... - btScalar squareMot0 = (convexbody->getInterpolationWorldTransform().getOrigin() - convexbody->getWorldTransform().getOrigin()).length2(); + btScalar squareMot0 = (convexbody->getInterpolationWorldTransform().m_origin - convexbody->getWorldTransform().m_origin).length2(); if (squareMot0 < convexbody->getCcdSquareMotionThreshold()) { return btScalar(1.); } - //const btVector3& from = convexbody->m_worldTransform.getOrigin(); - //btVector3 to = convexbody->m_interpolationWorldTransform.getOrigin(); + //const btVector3& from = convexbody->m_worldTransform.m_origin; + //btVector3 to = convexbody->m_interpolationWorldTransform.m_origin; //todo: only do if the motion exceeds the 'radius' btTransform triInv = triBody->getWorldTransform().inverse(); @@ -382,10 +382,10 @@ btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObj if (triBody->getCollisionShape()->isConcave()) { - btVector3 rayAabbMin = convexFromLocal.getOrigin(); - rayAabbMin.setMin(convexToLocal.getOrigin()); - btVector3 rayAabbMax = convexFromLocal.getOrigin(); - rayAabbMax.setMax(convexToLocal.getOrigin()); + btVector3 rayAabbMin = convexFromLocal.m_origin; + rayAabbMin.setMin(convexToLocal.m_origin); + btVector3 rayAabbMax = convexFromLocal.m_origin; + rayAabbMax.setMax(convexToLocal.m_origin); btScalar ccdRadius0 = convexbody->getCcdSweptSphereRadius(); rayAabbMin -= btVector3(ccdRadius0, ccdRadius0, ccdRadius0); rayAabbMax += btVector3(ccdRadius0, ccdRadius0, ccdRadius0); diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp index 8031c950b4..5c274ee605 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -127,10 +127,10 @@ static SIMD_FORCE_INLINE btScalar capsuleCapsuleDistance( const btTransform& transformB, btScalar distanceThreshold) { - btVector3 directionA = transformA.getBasis().getColumn(capsuleAxisA); - btVector3 translationA = transformA.getOrigin(); - btVector3 directionB = transformB.getBasis().getColumn(capsuleAxisB); - btVector3 translationB = transformB.getOrigin(); + btVector3 directionA = transformA.m_basis.getColumn(capsuleAxisA); + btVector3 translationA = transformA.m_origin; + btVector3 directionB = transformB.m_basis.getColumn(capsuleAxisB); + btVector3 translationB = transformB.m_origin; // translation between centers @@ -163,7 +163,7 @@ static SIMD_FORCE_INLINE btScalar capsuleCapsuleDistance( // compute the contact normal normalOnB = ptsVector * -btRecipSqrt(lenSqr); } - pointOnB = transformB.getOrigin() + offsetB + normalOnB * capsuleRadiusB; + pointOnB = transformB.m_origin + offsetB + normalOnB * capsuleRadiusB; return distance; } @@ -752,7 +752,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper* if (perturbeA) { - input.m_transformA.setBasis(btMatrix3x3(rotq.inverse() * perturbeRot * rotq) * body0Wrap->getWorldTransform().getBasis()); + input.m_transformA.m_basis = btMatrix3x3(rotq.inverse() * perturbeRot * rotq) * body0Wrap->getWorldTransform().m_basis; input.m_transformB = body1Wrap->getWorldTransform(); #ifdef DEBUG_CONTACTS dispatchInfo.m_debugDraw->drawTransform(input.m_transformA, 10.0); @@ -761,7 +761,7 @@ void btConvexConvexAlgorithm ::processCollision(const btCollisionObjectWrapper* else { input.m_transformA = body0Wrap->getWorldTransform(); - input.m_transformB.setBasis(btMatrix3x3(rotq.inverse() * perturbeRot * rotq) * body1Wrap->getWorldTransform().getBasis()); + input.m_transformB.m_basis = btMatrix3x3(rotq.inverse() * perturbeRot * rotq) * body1Wrap->getWorldTransform().m_basis; #ifdef DEBUG_CONTACTS dispatchInfo.m_debugDraw->drawTransform(input.m_transformB, 10.0); #endif @@ -799,8 +799,8 @@ btScalar btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0, ///col0->m_worldTransform, btScalar resultFraction = btScalar(1.); - btScalar squareMot0 = (col0->getInterpolationWorldTransform().getOrigin() - col0->getWorldTransform().getOrigin()).length2(); - btScalar squareMot1 = (col1->getInterpolationWorldTransform().getOrigin() - col1->getWorldTransform().getOrigin()).length2(); + btScalar squareMot0 = (col0->getInterpolationWorldTransform().m_origin - col0->getWorldTransform().m_origin).length2(); + btScalar squareMot1 = (col1->getInterpolationWorldTransform().m_origin - col1->getWorldTransform().m_origin).length2(); if (squareMot0 < col0->getCcdSquareMotionThreshold() && squareMot1 < col1->getCcdSquareMotionThreshold()) diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp index d91d9c9768..37838fa1a3 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp @@ -66,11 +66,11 @@ void btConvexPlaneCollisionAlgorithm::collideSingleContact(const btQuaternion& p btTransform convexInPlaneTrans; convexInPlaneTrans = planeObjWrap->getWorldTransform().inverse() * convexWorldTransform; //now perturbe the convex-world transform - convexWorldTransform.getBasis() *= btMatrix3x3(perturbeRot); + convexWorldTransform.m_basis *= btMatrix3x3(perturbeRot); btTransform planeInConvex; planeInConvex = convexWorldTransform.inverse() * planeObjWrap->getWorldTransform(); - btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis() * -planeNormal); + btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.m_basis * -planeNormal); btVector3 vtxInPlane = convexInPlaneTrans(vtx); btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant); @@ -83,7 +83,7 @@ void btConvexPlaneCollisionAlgorithm::collideSingleContact(const btQuaternion& p if (hasCollision) { /// report a contact. internally this will be kept persistent, and contact reduction is done - btVector3 normalOnSurfaceB = planeObjWrap->getWorldTransform().getBasis() * planeNormal; + btVector3 normalOnSurfaceB = planeObjWrap->getWorldTransform().m_basis * planeNormal; btVector3 pOnB = vtxInPlaneWorld; resultOut->addContactPoint(normalOnSurfaceB, pOnB, distance); } @@ -109,7 +109,7 @@ void btConvexPlaneCollisionAlgorithm::processCollision(const btCollisionObjectWr btTransform convexInPlaneTrans; convexInPlaneTrans = planeObjWrap->getWorldTransform().inverse() * convexObjWrap->getWorldTransform(); - btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis() * -planeNormal); + btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.m_basis * -planeNormal); btVector3 vtxInPlane = convexInPlaneTrans(vtx); btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant); @@ -121,7 +121,7 @@ void btConvexPlaneCollisionAlgorithm::processCollision(const btCollisionObjectWr if (hasCollision) { /// report a contact. internally this will be kept persistent, and contact reduction is done - btVector3 normalOnSurfaceB = planeObjWrap->getWorldTransform().getBasis() * planeNormal; + btVector3 normalOnSurfaceB = planeObjWrap->getWorldTransform().m_basis * planeNormal; btVector3 pOnB = vtxInPlaneWorld; resultOut->addContactPoint(normalOnSurfaceB, pOnB, distance); } diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btGhostObject.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btGhostObject.cpp index 00f16fd0a8..9c938b4e5e 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btGhostObject.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btGhostObject.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2008 Erwin Coumans http://bulletphysics.com This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -127,7 +127,7 @@ void btGhostObject::convexSweepTest(const btConvexShape* castShape, const btTran AabbExpand(collisionObjectAabbMin, collisionObjectAabbMax, castShapeAabbMin, castShapeAabbMax); btScalar hitLambda = btScalar(1.); //could use resultCallback.m_closestHitFraction, but needs testing btVector3 hitNormal; - if (btRayAabb(convexFromWorld.getOrigin(), convexToWorld.getOrigin(), collisionObjectAabbMin, collisionObjectAabbMax, hitLambda, hitNormal)) + if (btRayAabb(convexFromWorld.m_origin, convexToWorld.m_origin, collisionObjectAabbMin, collisionObjectAabbMax, hitLambda, hitNormal)) { btCollisionWorld::objectQuerySingle(castShape, convexFromTrans, convexToTrans, collisionObject, @@ -144,10 +144,10 @@ void btGhostObject::rayTest(const btVector3& rayFromWorld, const btVector3& rayT { btTransform rayFromTrans; rayFromTrans.setIdentity(); - rayFromTrans.setOrigin(rayFromWorld); + rayFromTrans.m_origin = rayFromWorld; btTransform rayToTrans; rayToTrans.setIdentity(); - rayToTrans.setOrigin(rayToWorld); + rayToTrans.m_origin = rayToWorld; int i; for (i = 0; i < m_overlappingObjects.size(); i++) diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp index a71700f58a..1e1fb53501 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp @@ -298,7 +298,7 @@ struct b3ProcessAllTrianglesHeightfield: public btTriangleCallback { btHeightfieldTerrainShape* m_heightfieldShape; btTriangleInfoMap* m_triangleInfoMap; - + b3ProcessAllTrianglesHeightfield(btHeightfieldTerrainShape* heightFieldShape, btTriangleInfoMap* triangleInfoMap) :m_heightfieldShape(heightFieldShape), @@ -489,7 +489,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr if (colObj0Wrap->getCollisionShape()->getShapeType() != TRIANGLE_SHAPE_PROXYTYPE) return; - + btTriangleInfoMap* triangleInfoMapPtr = 0; if (colObj0Wrap->getCollisionObject()->getCollisionShape()->getShapeType() == TERRAIN_SHAPE_PROXYTYPE) @@ -532,8 +532,8 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr { triangleInfoMapPtr = (btTriangleInfoMap*)trimesh->getTriangleInfoMap(); } - - + + if (!triangleInfoMapPtr) return; @@ -572,7 +572,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr int numConcaveEdgeHits = 0; int numConvexEdgeHits = 0; - btVector3 localContactNormalOnB = colObj0Wrap->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB; + btVector3 localContactNormalOnB = colObj0Wrap->getWorldTransform().m_basis.transpose() * cp.m_normalWorldOnB; localContactNormalOnB.normalize(); //is this necessary? // Get closest edge @@ -661,7 +661,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr #ifdef DEBUG_INTERNAL_EDGE { - btDebugDrawLine(cp.getPositionWorldOnB(), cp.getPositionWorldOnB() + tr.getBasis() * (nB * 20), red); + btDebugDrawLine(cp.getPositionWorldOnB(), cp.getPositionWorldOnB() + tr.m_basis * (nB * 20), red); } #endif //DEBUG_INTERNAL_EDGE @@ -678,7 +678,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr { if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED) != 0) || (clampedLocalNormal.dot(frontFacing * tri_normal) > 0)) { - btVector3 newNormal = colObj0Wrap->getWorldTransform().getBasis() * clampedLocalNormal; + btVector3 newNormal = colObj0Wrap->getWorldTransform().m_basis * clampedLocalNormal; // cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB); cp.m_normalWorldOnB = newNormal; // Reproject collision point along normal. (what about cp.m_distance1?) @@ -741,7 +741,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr #ifdef DEBUG_INTERNAL_EDGE { - btDebugDrawLine(cp.getPositionWorldOnB(), cp.getPositionWorldOnB() + tr.getBasis() * (nB * 20), red); + btDebugDrawLine(cp.getPositionWorldOnB(), cp.getPositionWorldOnB() + tr.m_basis * (nB * 20), red); } #endif //DEBUG_INTERNAL_EDGE @@ -756,14 +756,14 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr else { numConvexEdgeHits++; - btVector3 localContactNormalOnB = colObj0Wrap->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB; + btVector3 localContactNormalOnB = colObj0Wrap->getWorldTransform().m_basis.transpose() * cp.m_normalWorldOnB; btVector3 clampedLocalNormal; bool isClamped = btClampNormal(edge, swapFactor * tri_normal, localContactNormalOnB, info->m_edgeV1V2Angle, clampedLocalNormal); if (isClamped) { if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED) != 0) || (clampedLocalNormal.dot(frontFacing * tri_normal) > 0)) { - btVector3 newNormal = colObj0Wrap->getWorldTransform().getBasis() * clampedLocalNormal; + btVector3 newNormal = colObj0Wrap->getWorldTransform().m_basis * clampedLocalNormal; // cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB); cp.m_normalWorldOnB = newNormal; // Reproject collision point along normal. @@ -822,7 +822,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr #ifdef DEBUG_INTERNAL_EDGE { - btDebugDrawLine(cp.getPositionWorldOnB(), cp.getPositionWorldOnB() + tr.getBasis() * (nB * 20), red); + btDebugDrawLine(cp.getPositionWorldOnB(), cp.getPositionWorldOnB() + tr.m_basis * (nB * 20), red); } #endif //DEBUG_INTERNAL_EDGE @@ -839,14 +839,14 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr numConvexEdgeHits++; // printf("hitting convex edge\n"); - btVector3 localContactNormalOnB = colObj0Wrap->getWorldTransform().getBasis().transpose() * cp.m_normalWorldOnB; + btVector3 localContactNormalOnB = colObj0Wrap->getWorldTransform().m_basis.transpose() * cp.m_normalWorldOnB; btVector3 clampedLocalNormal; bool isClamped = btClampNormal(edge, swapFactor * tri_normal, localContactNormalOnB, info->m_edgeV2V0Angle, clampedLocalNormal); if (isClamped) { if (((normalAdjustFlags & BT_TRIANGLE_CONVEX_DOUBLE_SIDED) != 0) || (clampedLocalNormal.dot(frontFacing * tri_normal) > 0)) { - btVector3 newNormal = colObj0Wrap->getWorldTransform().getBasis() * clampedLocalNormal; + btVector3 newNormal = colObj0Wrap->getWorldTransform().m_basis * clampedLocalNormal; // cp.m_distance1 = cp.m_distance1 * newNormal.dot(cp.m_normalWorldOnB); cp.m_normalWorldOnB = newNormal; // Reproject collision point along normal. @@ -877,7 +877,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr { tri_normal *= -1; } - cp.m_normalWorldOnB = colObj0Wrap->getWorldTransform().getBasis() * tri_normal; + cp.m_normalWorldOnB = colObj0Wrap->getWorldTransform().m_basis * tri_normal; } else { @@ -889,7 +889,7 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr return; } //modify the normal to be the triangle normal (or backfacing normal) - cp.m_normalWorldOnB = colObj0Wrap->getWorldTransform().getBasis() * newNormal; + cp.m_normalWorldOnB = colObj0Wrap->getWorldTransform().m_basis * newNormal; } // Reproject collision point along normal. diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp index 5ab26f5083..05ee159099 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -60,7 +60,7 @@ void btSphereBoxCollisionAlgorithm::processCollision(const btCollisionObjectWrap btVector3 normalOnSurfaceB; btScalar penetrationDepth; - btVector3 sphereCenter = sphereObjWrap->getWorldTransform().getOrigin(); + btVector3 sphereCenter = sphereObjWrap->getWorldTransform().m_origin; const btSphereShape* sphere0 = (const btSphereShape*)sphereObjWrap->getCollisionShape(); btScalar radius = sphere0->getRadius(); btScalar maxContactDistance = m_manifoldPtr->getContactBreakingThreshold(); @@ -146,7 +146,7 @@ bool btSphereBoxCollisionAlgorithm::getSphereDistance(const btCollisionObjectWra pointOnBox = tmp; // tmp = m44T(v3PointOnSphere); // v3PointOnSphere = tmp; - tmp = m44T.getBasis() * normal; + tmp = m44T.m_basis * normal; normal = tmp; return true; diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp index 9c35565e5b..0425f26ec5 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -53,7 +53,7 @@ void btSphereSphereCollisionAlgorithm::processCollision(const btCollisionObjectW btSphereShape* sphere0 = (btSphereShape*)col0Wrap->getCollisionShape(); btSphereShape* sphere1 = (btSphereShape*)col1Wrap->getCollisionShape(); - btVector3 diff = col0Wrap->getWorldTransform().getOrigin() - col1Wrap->getWorldTransform().getOrigin(); + btVector3 diff = col0Wrap->getWorldTransform().m_origin - col1Wrap->getWorldTransform().m_origin; btScalar len = diff.length(); btScalar radius0 = sphere0->getRadius(); btScalar radius1 = sphere1->getRadius(); @@ -80,9 +80,9 @@ void btSphereSphereCollisionAlgorithm::processCollision(const btCollisionObjectW } ///point on A (worldspace) - ///btVector3 pos0 = col0->getWorldTransform().getOrigin() - radius0 * normalOnSurfaceB; + ///btVector3 pos0 = col0->getWorldTransform().m_origin - radius0 * normalOnSurfaceB; ///point on B (worldspace) - btVector3 pos1 = col1Wrap->getWorldTransform().getOrigin() + radius1 * normalOnSurfaceB; + btVector3 pos1 = col1Wrap->getWorldTransform().m_origin + radius1 * normalOnSurfaceB; /// report a contact. internally this will be kept persistent, and contact reduction is done diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btCapsuleShape.h b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btCapsuleShape.h index 138d0c0f7c..7c5ef1e806 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btCapsuleShape.h +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btCapsuleShape.h @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -55,8 +55,8 @@ btCapsuleShape : public btConvexInternalShape { btVector3 halfExtents(getRadius(), getRadius(), getRadius()); halfExtents[m_upAxis] = getRadius() + getHalfHeight(); - btMatrix3x3 abs_b = t.getBasis().absolute(); - btVector3 center = t.getOrigin(); + btMatrix3x3 abs_b = t.m_basis.absolute(); + btVector3 center = t.m_origin; btVector3 extent = halfExtents.dot3(abs_b[0], abs_b[1], abs_b[2]); aabbMin = center - extent; diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btCompoundShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btCompoundShape.cpp index fd7828b104..524f83f0f9 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btCompoundShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btCompoundShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -171,7 +171,7 @@ void btCompoundShape::getAabb(const btTransform& trans, btVector3& aabbMin, btVe } localHalfExtents += btVector3(getMargin(), getMargin(), getMargin()); - btMatrix3x3 abs_b = trans.getBasis().absolute(); + btMatrix3x3 abs_b = trans.m_basis.absolute(); btVector3 center = trans(localCenter); @@ -210,14 +210,14 @@ void btCompoundShape::calculatePrincipalAxisTransform(const btScalar* masses, bt for (k = 0; k < n; k++) { btAssert(masses[k] > 0); - center += m_children[k].m_transform.getOrigin() * masses[k]; + center += m_children[k].m_transform.m_origin * masses[k]; totalMass += masses[k]; } btAssert(totalMass > 0); center /= totalMass; - principal.setOrigin(center); + principal.m_origin = center; btMatrix3x3 tensor(0, 0, 0, 0, 0, 0, 0, 0, 0); for (k = 0; k < n; k++) @@ -226,14 +226,14 @@ void btCompoundShape::calculatePrincipalAxisTransform(const btScalar* masses, bt m_children[k].m_childShape->calculateLocalInertia(masses[k], i); const btTransform& t = m_children[k].m_transform; - btVector3 o = t.getOrigin() - center; + btVector3 o = t.m_origin - center; //compute inertia tensor in coordinate system of compound shape - btMatrix3x3 j = t.getBasis().transpose(); + btMatrix3x3 j = t.m_basis.transpose(); j[0] *= i[0]; j[1] *= i[1]; j[2] *= i[2]; - j = t.getBasis() * j; + j = t.m_basis * j; //add inertia tensor tensor[0] += j[0]; @@ -255,7 +255,7 @@ void btCompoundShape::calculatePrincipalAxisTransform(const btScalar* masses, bt tensor[2] += masses[k] * j[2]; } - tensor.diagonalize(principal.getBasis(), btScalar(0.00001), 20); + tensor.diagonalize(principal.m_basis, btScalar(0.00001), 20); inertia.setValue(tensor[0][0], tensor[1][1], tensor[2][2]); } @@ -265,10 +265,10 @@ void btCompoundShape::setLocalScaling(const btVector3& scaling) { btTransform childTrans = getChildTransform(i); btVector3 childScale = m_children[i].m_childShape->getLocalScaling(); - // childScale = childScale * (childTrans.getBasis() * scaling); + // childScale = childScale * (childTrans.m_basis * scaling); childScale = childScale * scaling / m_localScaling; m_children[i].m_childShape->setLocalScaling(childScale); - childTrans.setOrigin((childTrans.getOrigin()) * scaling / m_localScaling); + childTrans.m_origin = (childTrans.m_origin) * scaling / m_localScaling; updateChildTransform(i, childTrans, false); } diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp index 703de45922..e2b0b5048d 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp @@ -228,7 +228,7 @@ void btConvexHullShape::project(const btTransform& trans, const btVector3& dir, } } #else - btVector3 localAxis = dir * trans.getBasis(); + btVector3 localAxis = dir * trans.m_basis; witnesPtMin = trans(localGetSupportingVertex(localAxis)); witnesPtMax = trans(localGetSupportingVertex(-localAxis)); diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp index 4d598b1aa2..af1b7f364f 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -36,12 +36,12 @@ void btConvexInternalShape::getAabbSlow(const btTransform& trans, btVector3& min btVector3 vec(btScalar(0.), btScalar(0.), btScalar(0.)); vec[i] = btScalar(1.); - btVector3 sv = localGetSupportingVertex(vec * trans.getBasis()); + btVector3 sv = localGetSupportingVertex(vec * trans.m_basis); btVector3 tmp = trans(sv); maxAabb[i] = tmp[i] + margin; vec[i] = btScalar(-1.); - tmp = trans(localGetSupportingVertex(vec * trans.getBasis())); + tmp = trans(localGetSupportingVertex(vec * trans.m_basis)); minAabb[i] = tmp[i] - margin; } #endif diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexShape.cpp index f8fb0aa9fd..e8257cab29 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -48,7 +48,7 @@ btConvexShape::~btConvexShape() void btConvexShape::project(const btTransform& trans, const btVector3& dir, btScalar& min, btScalar& max, btVector3& witnesPtMin, btVector3& witnesPtMax) const { - btVector3 localAxis = dir * trans.getBasis(); + btVector3 localAxis = dir * trans.m_basis; btVector3 vtx1 = trans(localGetSupportingVertex(localAxis)); btVector3 vtx2 = trans(localGetSupportingVertex(-localAxis)); @@ -380,7 +380,7 @@ void btConvexShape::getAabbNonVirtual(const btTransform& t, btVector3& aabbMin, btSphereShape* sphereShape = (btSphereShape*)this; btScalar radius = sphereShape->getImplicitShapeDimensions().getX(); // * convexShape->getLocalScaling().getX(); btScalar margin = radius + sphereShape->getMarginNonVirtual(); - const btVector3& center = t.getOrigin(); + const btVector3& center = t.m_origin; btVector3 extent(margin, margin, margin); aabbMin = center - extent; aabbMax = center + extent; @@ -394,8 +394,8 @@ void btConvexShape::getAabbNonVirtual(const btTransform& t, btVector3& aabbMin, btScalar margin = convexShape->getMarginNonVirtual(); btVector3 halfExtents = convexShape->getImplicitShapeDimensions(); halfExtents += btVector3(margin, margin, margin); - btMatrix3x3 abs_b = t.getBasis().absolute(); - btVector3 center = t.getOrigin(); + btMatrix3x3 abs_b = t.m_basis.absolute(); + btVector3 center = t.m_origin; btVector3 extent = halfExtents.dot3(abs_b[0], abs_b[1], abs_b[2]); aabbMin = center - extent; @@ -411,12 +411,12 @@ void btConvexShape::getAabbNonVirtual(const btTransform& t, btVector3& aabbMin, btVector3 vec(btScalar(0.), btScalar(0.), btScalar(0.)); vec[i] = btScalar(1.); - btVector3 sv = localGetSupportVertexWithoutMarginNonVirtual(vec * t.getBasis()); + btVector3 sv = localGetSupportVertexWithoutMarginNonVirtual(vec * t.m_basis); btVector3 tmp = t(sv); aabbMax[i] = tmp[i] + margin; vec[i] = btScalar(-1.); - tmp = t(localGetSupportVertexWithoutMarginNonVirtual(vec * t.getBasis())); + tmp = t(localGetSupportVertexWithoutMarginNonVirtual(vec * t.m_basis)); aabbMin[i] = tmp[i] - margin; } } @@ -427,8 +427,8 @@ void btConvexShape::getAabbNonVirtual(const btTransform& t, btVector3& aabbMin, btVector3 halfExtents(capsuleShape->getRadius(), capsuleShape->getRadius(), capsuleShape->getRadius()); int m_upAxis = capsuleShape->getUpAxis(); halfExtents[m_upAxis] = capsuleShape->getRadius() + capsuleShape->getHalfHeight(); - btMatrix3x3 abs_b = t.getBasis().absolute(); - btVector3 center = t.getOrigin(); + btMatrix3x3 abs_b = t.m_basis.absolute(); + btVector3 center = t.m_origin; btVector3 extent = halfExtents.dot3(abs_b[0], abs_b[1], abs_b[2]); aabbMin = center - extent; aabbMax = center + extent; diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp index f6987cc760..c976544a4e 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -270,14 +270,14 @@ void btConvexTriangleMeshShape::calculatePrincipalAxisTransform(btTransform& pri btVector3 aabbMax(btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT), btScalar(BT_LARGE_FLOAT)); m_stridingMesh->InternalProcessAllTriangles(¢erCallback, -aabbMax, aabbMax); btVector3 center = centerCallback.getCenter(); - principal.setOrigin(center); + principal.m_origin = center; volume = centerCallback.getVolume(); InertiaCallback inertiaCallback(center); m_stridingMesh->InternalProcessAllTriangles(&inertiaCallback, -aabbMax, aabbMax); btMatrix3x3& i = inertiaCallback.getInertia(); - i.diagonalize(principal.getBasis(), btScalar(0.00001), 20); + i.diagonalize(principal.m_basis, btScalar(0.00001), 20); inertia.setValue(i[0][0], i[1][1], i[2][2]); inertia /= volume; } diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btEmptyShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btEmptyShape.cpp index 4699555bd8..b55eb678a6 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btEmptyShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btEmptyShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -31,9 +31,9 @@ void btEmptyShape::getAabb(const btTransform& t, btVector3& aabbMin, btVector3& { btVector3 margin(getMargin(), getMargin(), getMargin()); - aabbMin = t.getOrigin() - margin; + aabbMin = t.m_origin - margin; - aabbMax = t.getOrigin() + margin; + aabbMax = t.m_origin + margin; } void btEmptyShape::calculateLocalInertia(btScalar, btVector3&) const diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp index 5b1c23d6ff..362ddd3eed 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -126,7 +126,7 @@ void btHeightfieldTerrainShape::initialize( m_flipTriangleWinding = false; m_upAxis = upAxis; m_localScaling.setValue(btScalar(1.), btScalar(1.), btScalar(1.)); - + m_vboundsChunkSize = 0; m_vboundsGridWidth = 0; m_vboundsGridLength = 0; @@ -176,8 +176,8 @@ void btHeightfieldTerrainShape::getAabb(const btTransform& t, btVector3& aabbMin localOrigin[m_upAxis] = (m_minHeight + m_maxHeight) * btScalar(0.5); localOrigin *= m_localScaling; - btMatrix3x3 abs_b = t.getBasis().absolute(); - btVector3 center = t.getOrigin(); + btMatrix3x3 abs_b = t.m_basis.absolute(); + btVector3 center = t.m_origin; btVector3 extent = halfExtents.dot3(abs_b[0], abs_b[1], abs_b[2]); extent += btVector3(getMargin(), getMargin(), getMargin()); @@ -412,7 +412,7 @@ void btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback } // TODO If m_vboundsGrid is available, use it to determine if we really need to process this area - + const Range aabbUpRange(aabbMin[m_upAxis], aabbMax[m_upAxis]); for (int j = startJ; j < endJ; j++) { @@ -437,7 +437,7 @@ void btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback if (upRange.overlaps(aabbUpRange)) callback->processTriangle(vertices, 2 * x, j); - + // already set: getVertex(x, j, vertices[indices[0]]) // equivalent to: getVertex(x + 1, j + 1, vertices[indices[1]]); @@ -523,7 +523,7 @@ void gridRaycast(Action_T& quadAction, const btVector3& beginPos, const btVector // Consider the ray is too small to hit anything return; } - + btScalar rayDirectionFlatX = endPos[indices[0]] - beginPos[indices[0]]; btScalar rayDirectionFlatZ = endPos[indices[2]] - beginPos[indices[2]]; @@ -813,7 +813,7 @@ void btHeightfieldTerrainShape::performRaycast(btTriangleCallback* callback, con return; } - + if (m_vboundsGrid.size()==0) { @@ -882,7 +882,7 @@ void btHeightfieldTerrainShape::buildAccelerator(int chunkSize) // This data structure is only reallocated if the required size changed m_vboundsGrid.resize(nChunksX * nChunksZ); - + // Compute min and max height for all chunks for (int cz = 0; cz < nChunksZ; ++cz) { diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp index d4b6a651de..f3df966615 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -27,8 +27,8 @@ btMinkowskiSumShape::btMinkowskiSumShape(const btConvexShape* shapeA, const btCo btVector3 btMinkowskiSumShape::localGetSupportingVertexWithoutMargin(const btVector3& vec) const { - btVector3 supVertexA = m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(vec * m_transA.getBasis())); - btVector3 supVertexB = m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(-vec * m_transB.getBasis())); + btVector3 supVertexA = m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(vec * m_transA.m_basis)); + btVector3 supVertexB = m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(-vec * m_transB.m_basis)); return supVertexA - supVertexB; } diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp index f427319974..d7a6b912e8 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -89,7 +89,7 @@ void btScaledBvhTriangleMeshShape::getAabb(const btTransform& trans, btVector3& localHalfExtents += btVector3(margin, margin, margin); btVector3 localCenter = btScalar(0.5) * (localAabbMax + localAabbMin); - btMatrix3x3 abs_b = trans.getBasis().absolute(); + btMatrix3x3 abs_b = trans.m_basis.absolute(); btVector3 center = trans(localCenter); diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btSphereShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btSphereShape.cpp index 027db2e104..63fc860747 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btSphereShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btSphereShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -52,7 +52,7 @@ btVector3 btSphereShape::localGetSupportingVertex(const btVector3& vec) const //broken due to scaling void btSphereShape::getAabb(const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const { - const btVector3& center = t.getOrigin(); + const btVector3& center = t.m_origin; btVector3 extent(getMargin(), getMargin(), getMargin()); aabbMin = center - extent; aabbMax = center + extent; diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp index aec239063c..239a02fd88 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -44,7 +44,7 @@ void btTriangleMeshShape::getAabb(const btTransform& trans, btVector3& aabbMin, localHalfExtents += btVector3(getMargin(), getMargin(), getMargin()); btVector3 localCenter = btScalar(0.5) * (m_localAabbMax + m_localAabbMin); - btMatrix3x3 abs_b = trans.getBasis().absolute(); + btMatrix3x3 abs_b = trans.m_basis.absolute(); btVector3 center = trans(localCenter); @@ -80,7 +80,7 @@ class SupportVertexCallback : public btTriangleCallback : m_supportVertexLocal(btScalar(0.), btScalar(0.), btScalar(0.)), m_worldTrans(trans), m_maxDot(btScalar(-BT_LARGE_FLOAT)) { - m_supportVecLocal = supportVecWorld * m_worldTrans.getBasis(); + m_supportVecLocal = supportVecWorld * m_worldTrans.m_basis; } virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex) diff --git a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp index ed3cd2d259..64b00f92b2 100644 --- a/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp +++ b/3rdparty/bullet3/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -85,7 +85,7 @@ void btUniformScalingShape::getAabbSlow(const btTransform& t, btVector3& aabbMin for (int i = 0; i < 6; i++) { - _directions[i] = _directions[i] * t.getBasis(); + _directions[i] = _directions[i] * t.m_basis; } batchedUnitVectorGetSupportingVertexWithoutMargin(_directions, _supporting, 6); @@ -108,11 +108,11 @@ void btUniformScalingShape::getAabbSlow(const btTransform& t, btVector3& aabbMin { btVector3 vec(btScalar(0.), btScalar(0.), btScalar(0.)); vec[i] = btScalar(1.); - btVector3 sv = localGetSupportingVertex(vec * t.getBasis()); + btVector3 sv = localGetSupportingVertex(vec * t.m_basis); btVector3 tmp = t(sv); aabbMax[i] = tmp[i] + margin; vec[i] = btScalar(-1.); - sv = localGetSupportingVertex(vec * t.getBasis()); + sv = localGetSupportingVertex(vec * t.m_basis); tmp = t(sv); aabbMin[i] = tmp[i] - margin; } diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btComputeGjkEpaPenetration.h b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btComputeGjkEpaPenetration.h index 3c82133037..2100e24750 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btComputeGjkEpaPenetration.h +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btComputeGjkEpaPenetration.h @@ -30,7 +30,7 @@ bool btGjkEpaCalcPenDepth(const btConvexTemplate& a, const btConvexTemplate& b, // const btScalar radialmargin(btScalar(0.)); - btVector3 guessVector(b.getWorldTransform().getOrigin() - a.getWorldTransform().getOrigin()); //?? why not use the GJK input? + btVector3 guessVector(b.getWorldTransform().m_origin - a.getWorldTransform().m_origin); //?? why not use the GJK input? btGjkEpaSolver3::sResults results; @@ -95,8 +95,8 @@ int btComputeGjkEpaPenetration(const btConvexTemplate& a, const btConvexTemplate for (;;) //while (true) { - btVector3 separatingAxisInA = (-m_cachedSeparatingAxis) * localTransA.getBasis(); - btVector3 separatingAxisInB = m_cachedSeparatingAxis * localTransB.getBasis(); + btVector3 separatingAxisInA = (-m_cachedSeparatingAxis) * localTransA.m_basis; + btVector3 separatingAxisInB = m_cachedSeparatingAxis * localTransB.m_basis; btVector3 pInA = a.getLocalSupportWithoutMargin(separatingAxisInA); btVector3 qInB = b.getLocalSupportWithoutMargin(separatingAxisInB); diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp index 623c58fc83..8953049b9c 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -71,14 +71,14 @@ void btContinuousConvexCollision::computeClosestPoints(const btTransform& transA btTransform planeInConvex; planeInConvex = convexWorldTransform.inverse() * transB; - btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.getBasis() * -planeNormal); + btVector3 vtx = convexShape->localGetSupportingVertex(planeInConvex.m_basis * -planeNormal); btVector3 vtxInPlane = convexInPlaneTrans(vtx); btScalar distance = (planeNormal.dot(vtxInPlane) - planeConstant); btVector3 vtxInPlaneProjected = vtxInPlane - distance * planeNormal; btVector3 vtxInPlaneWorld = transB * vtxInPlaneProjected; - btVector3 normalOnSurfaceB = transB.getBasis() * planeNormal; + btVector3 normalOnSurfaceB = transB.m_basis * planeNormal; pointCollector.addContactPoint( normalOnSurfaceB, @@ -184,7 +184,7 @@ bool btContinuousConvexCollision::calcTimeOfImpact( if (result.m_debugDrawer) { - result.m_debugDrawer->drawSphere(interpolatedTransA.getOrigin(), 0.2f, btVector3(1, 0, 0)); + result.m_debugDrawer->drawSphere(interpolatedTransA.m_origin, 0.2f, btVector3(1, 0, 0)); } result.DebugDraw(lambda); diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp index 41da699863..5c75ce6ca7 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -44,8 +44,8 @@ bool btGjkConvexCast::calcTimeOfImpact( /// compute linear velocity for this interval, to interpolate //assume no rotation/angular velocity, assert here? btVector3 linVelA, linVelB; - linVelA = toA.getOrigin() - fromA.getOrigin(); - linVelB = toB.getOrigin() - fromB.getOrigin(); + linVelA = toA.m_origin - fromA.m_origin; + linVelB = toB.m_origin - fromB.m_origin; btScalar radius = btScalar(0.001); btScalar lambda = btScalar(0.); @@ -124,8 +124,8 @@ bool btGjkConvexCast::calcTimeOfImpact( //interpolate to next lambda result.DebugDraw(lambda); - input.m_transformA.getOrigin().setInterpolate3(fromA.getOrigin(), toA.getOrigin(), lambda); - input.m_transformB.getOrigin().setInterpolate3(fromB.getOrigin(), toB.getOrigin(), lambda); + input.m_transformA.m_origin.setInterpolate3(fromA.m_origin, toA.m_origin, lambda); + input.m_transformB.m_origin.setInterpolate3(fromB.m_origin, toB.m_origin, lambda); gjk.getClosestPoints(input, pointCollector, 0); if (pointCollector.m_hasResult) diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp index 228860477e..72b261ee28 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp @@ -914,7 +914,7 @@ static void Initialize(const btConvexShape* shape0, const btTransform& wtrs0, /* Shape */ shape.m_shapes[0] = shape0; shape.m_shapes[1] = shape1; - shape.m_toshape1 = wtrs1.getBasis().transposeTimes(wtrs0.getBasis()); + shape.m_toshape1 = wtrs1.m_basis.transposeTimes(wtrs0.m_basis); shape.m_toshape0 = wtrs0.inverseTimes(wtrs1); shape.EnableMargin(withmargins); } diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpa3.h b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpa3.h index fd67c3759f..a8a1e62033 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpa3.h +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpa3.h @@ -885,7 +885,7 @@ static void Initialize(const btConvexTemplate& a, const btConvexTemplate& b, results.status = btGjkEpaSolver3::sResults::Separated; /* Shape */ - shape.m_toshape1 = b.getWorldTransform().getBasis().transposeTimes(a.getWorldTransform().getBasis()); + shape.m_toshape1 = b.getWorldTransform().m_basis.transposeTimes(a.getWorldTransform().m_basis); shape.m_toshape0 = a.getWorldTransform().inverseTimes(b.getWorldTransform()); } diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp index 3b79ddf8a5..d032074c36 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp @@ -6,8 +6,8 @@ EPA Copyright (c) Ricardo Padrela 2006 This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -31,8 +31,8 @@ bool btGjkEpaPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& simp (void)simplexSolver; btVector3 guessVectors[] = { - btVector3(transformB.getOrigin() - transformA.getOrigin()).safeNormalize(), - btVector3(transformA.getOrigin() - transformB.getOrigin()).safeNormalize(), + btVector3(transformB.m_origin - transformA.m_origin).safeNormalize(), + btVector3(transformA.m_origin - transformB.m_origin).safeNormalize(), btVector3(0, 0, 1), btVector3(0, 1, 0), btVector3(1, 0, 0), diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp index bee8c330d2..570540e24d 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp @@ -79,8 +79,8 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput &input, Result static void btComputeSupport(const btConvexShape *convexA, const btTransform &localTransA, const btConvexShape *convexB, const btTransform &localTransB, const btVector3 &dir, bool check2d, btVector3 &supAworld, btVector3 &supBworld, btVector3 &aMinb) { - btVector3 separatingAxisInA = (dir)*localTransA.getBasis(); - btVector3 separatingAxisInB = (-dir) * localTransB.getBasis(); + btVector3 separatingAxisInA = (dir)*localTransA.m_basis; + btVector3 separatingAxisInB = (-dir) * localTransB.m_basis; btVector3 pInANoMargin = convexA->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInA); btVector3 qInBNoMargin = convexB->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInB); @@ -696,9 +696,9 @@ void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput &inpu btVector3 pointOnA, pointOnB; btTransform localTransA = input.m_transformA; btTransform localTransB = input.m_transformB; - btVector3 positionOffset = (localTransA.getOrigin() + localTransB.getOrigin()) * btScalar(0.5); - localTransA.getOrigin() -= positionOffset; - localTransB.getOrigin() -= positionOffset; + btVector3 positionOffset = (localTransA.m_origin + localTransB.m_origin) * btScalar(0.5); + localTransA.m_origin -= positionOffset; + localTransB.m_origin -= positionOffset; bool check2d = m_minkowskiA->isConvex2d() && m_minkowskiB->isConvex2d(); @@ -839,8 +839,8 @@ void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput &inpu for (;;) //while (true) { - btVector3 separatingAxisInA = (-m_cachedSeparatingAxis) * localTransA.getBasis(); - btVector3 separatingAxisInB = m_cachedSeparatingAxis * localTransB.getBasis(); + btVector3 separatingAxisInA = (-m_cachedSeparatingAxis) * localTransA.m_basis; + btVector3 separatingAxisInB = m_cachedSeparatingAxis * localTransB.m_basis; btVector3 pInA = m_minkowskiA->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInA); btVector3 qInB = m_minkowskiB->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInB); @@ -1116,8 +1116,8 @@ void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput &inpu btScalar d2 = 0.f; { - btVector3 separatingAxisInA = (-orgNormalInB) * localTransA.getBasis(); - btVector3 separatingAxisInB = orgNormalInB * localTransB.getBasis(); + btVector3 separatingAxisInA = (-orgNormalInB) * localTransA.m_basis; + btVector3 separatingAxisInB = orgNormalInB * localTransB.m_basis; btVector3 pInA = m_minkowskiA->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInA); btVector3 qInB = m_minkowskiB->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInB); @@ -1130,8 +1130,8 @@ void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput &inpu btScalar d1 = 0; { - btVector3 separatingAxisInA = (normalInB)*localTransA.getBasis(); - btVector3 separatingAxisInB = -normalInB * localTransB.getBasis(); + btVector3 separatingAxisInA = (normalInB)*localTransA.m_basis; + btVector3 separatingAxisInB = -normalInB * localTransB.m_basis; btVector3 pInA = m_minkowskiA->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInA); btVector3 qInB = m_minkowskiB->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInB); @@ -1143,8 +1143,8 @@ void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput &inpu } btScalar d0 = 0.f; { - btVector3 separatingAxisInA = (-normalInB) * input.m_transformA.getBasis(); - btVector3 separatingAxisInB = normalInB * input.m_transformB.getBasis(); + btVector3 separatingAxisInA = (-normalInB) * input.m_transformA.m_basis; + btVector3 separatingAxisInB = normalInB * input.m_transformB.m_basis; btVector3 pInA = m_minkowskiA->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInA); btVector3 qInB = m_minkowskiB->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInB); diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp index dcb29808cb..7da0de4411 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp @@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -84,8 +84,8 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s for (i = 0; i < numSampleDirections; i++) { btVector3 norm = getPenetrationDirections()[i]; - separatingAxisInABatch[i] = (-norm) * transA.getBasis(); - separatingAxisInBBatch[i] = norm * transB.getBasis(); + separatingAxisInABatch[i] = (-norm) * transA.m_basis; + separatingAxisInBBatch[i] = norm * transB.m_basis; } { @@ -96,10 +96,10 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s { btVector3 norm; convexA->getPreferredPenetrationDirection(i, norm); - norm = transA.getBasis() * norm; + norm = transA.m_basis * norm; getPenetrationDirections()[numSampleDirections] = norm; - separatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis(); - separatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis(); + separatingAxisInABatch[numSampleDirections] = (-norm) * transA.m_basis; + separatingAxisInBBatch[numSampleDirections] = norm * transB.m_basis; numSampleDirections++; } } @@ -113,10 +113,10 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s { btVector3 norm; convexB->getPreferredPenetrationDirection(i, norm); - norm = transB.getBasis() * norm; + norm = transB.m_basis * norm; getPenetrationDirections()[numSampleDirections] = norm; - separatingAxisInABatch[numSampleDirections] = (-norm) * transA.getBasis(); - separatingAxisInBBatch[numSampleDirections] = norm * transB.getBasis(); + separatingAxisInABatch[numSampleDirections] = (-norm) * transA.m_basis; + separatingAxisInBBatch[numSampleDirections] = norm * transB.m_basis; numSampleDirections++; } } @@ -173,7 +173,7 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s { btVector3 norm; convexA->getPreferredPenetrationDirection(i, norm); - norm = transA.getBasis() * norm; + norm = transA.m_basis * norm; getPenetrationDirections()[numSampleDirections] = norm; numSampleDirections++; } @@ -188,7 +188,7 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s { btVector3 norm; convexB->getPreferredPenetrationDirection(i, norm); - norm = transB.getBasis() * norm; + norm = transB.m_basis * norm; getPenetrationDirections()[numSampleDirections] = norm; numSampleDirections++; } @@ -199,8 +199,8 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s for (int i = 0; i < numSampleDirections; i++) { const btVector3& norm = getPenetrationDirections()[i]; - separatingAxisInA = (-norm) * transA.getBasis(); - separatingAxisInB = norm * transB.getBasis(); + separatingAxisInA = (-norm) * transA.m_basis; + separatingAxisInB = norm * transB.m_basis; pInA = convexA->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInA); qInB = convexB->localGetSupportVertexWithoutMarginNonVirtual(separatingAxisInB); pWorld = transA(pInA); @@ -249,10 +249,10 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s btGjkPairDetector::ClosestPointInput input; - btVector3 newOrg = transA.getOrigin() + offset; + btVector3 newOrg = transA.m_origin + offset; btTransform displacedTrans = transA; - displacedTrans.setOrigin(newOrg); + displacedTrans.m_origin = newOrg; input.m_transformA = displacedTrans; input.m_transformB = transB; diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btMprPenetration.h b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btMprPenetration.h index 534a66d3fa..dfd4d27365 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btMprPenetration.h +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btMprPenetration.h @@ -309,8 +309,8 @@ inline void btMprSupport(const btConvexTemplate &a, const btConvexTemplate &b, const btMprCollisionDescription &colDesc, const btVector3 &dir, btMprSupport_t *supp) { - btVector3 separatingAxisInA = dir * a.getWorldTransform().getBasis(); - btVector3 separatingAxisInB = -dir * b.getWorldTransform().getBasis(); + btVector3 separatingAxisInA = dir * a.getWorldTransform().m_basis; + btVector3 separatingAxisInB = -dir * b.getWorldTransform().m_basis; btVector3 pInA = a.getLocalSupportWithMargin(separatingAxisInA); btVector3 qInB = b.getLocalSupportWithMargin(separatingAxisInB); diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp index 366cf155ca..5cb5ef4686 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp @@ -249,12 +249,12 @@ void btPersistentManifold::refreshContactPoints(const btTransform& trA, const bt int i; #ifdef DEBUG_PERSISTENCY printf("refreshContactPoints posA = (%f,%f,%f) posB = (%f,%f,%f)\n", - trA.getOrigin().getX(), - trA.getOrigin().getY(), - trA.getOrigin().getZ(), - trB.getOrigin().getX(), - trB.getOrigin().getY(), - trB.getOrigin().getZ()); + trA.m_origin.getX(), + trA.m_origin.getY(), + trA.m_origin.getZ(), + trB.m_origin.getX(), + trB.m_origin.getY(), + trB.m_origin.getZ()); #endif //DEBUG_PERSISTENCY /// first refresh worldspace positions and distance for (i = getNumContacts() - 1; i >= 0; i--) diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp index 9d1836037d..603bcb44e3 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp @@ -129,7 +129,7 @@ inline void BoxSupport(const btScalar extents[3], const btScalar sv[3], btScalar void InverseTransformPoint3x3(btVector3& out, const btVector3& in, const btTransform& tr) { - const btMatrix3x3& rot = tr.getBasis(); + const btMatrix3x3& rot = tr.m_basis; const btVector3& r0 = rot[0]; const btVector3& r1 = rot[1]; const btVector3& r2 = rot[2]; @@ -251,7 +251,7 @@ bool btPolyhedralContactClipping::findSeparatingAxis(const btConvexPolyhedron& h for (int i = 0; i < numFacesA; i++) { const btVector3 Normal(hullA.m_faces[i].m_plane[0], hullA.m_faces[i].m_plane[1], hullA.m_faces[i].m_plane[2]); - btVector3 faceANormalWS = transA.getBasis() * Normal; + btVector3 faceANormalWS = transA.m_basis * Normal; if (DeltaC2.dot(faceANormalWS) < 0) faceANormalWS *= -1.f; @@ -280,7 +280,7 @@ bool btPolyhedralContactClipping::findSeparatingAxis(const btConvexPolyhedron& h for (int i = 0; i < numFacesB; i++) { const btVector3 Normal(hullB.m_faces[i].m_plane[0], hullB.m_faces[i].m_plane[1], hullB.m_faces[i].m_plane[2]); - btVector3 WorldNormal = transB.getBasis() * Normal; + btVector3 WorldNormal = transB.m_basis * Normal; if (DeltaC2.dot(WorldNormal) < 0) WorldNormal *= -1.f; @@ -316,11 +316,11 @@ bool btPolyhedralContactClipping::findSeparatingAxis(const btConvexPolyhedron& h for (int e0 = 0; e0 < hullA.m_uniqueEdges.size(); e0++) { const btVector3 edge0 = hullA.m_uniqueEdges[e0]; - const btVector3 WorldEdge0 = transA.getBasis() * edge0; + const btVector3 WorldEdge0 = transA.m_basis * edge0; for (int e1 = 0; e1 < hullB.m_uniqueEdges.size(); e1++) { const btVector3 edge1 = hullB.m_uniqueEdges[e1]; - const btVector3 WorldEdge1 = transB.getBasis() * edge1; + const btVector3 WorldEdge1 = transB.m_basis * edge1; btVector3 Cross = WorldEdge0.cross(WorldEdge1); curEdgeEdge++; @@ -415,7 +415,7 @@ void btPolyhedralContactClipping::clipFaceAgainstHull(const btVector3& separatin for (int face = 0; face < hullA.m_faces.size(); face++) { const btVector3 Normal(hullA.m_faces[face].m_plane[0], hullA.m_faces[face].m_plane[1], hullA.m_faces[face].m_plane[2]); - const btVector3 faceANormalWS = transA.getBasis() * Normal; + const btVector3 faceANormalWS = transA.m_basis * Normal; btScalar d = faceANormalWS.dot(separatingNormal); if (d < dmin) @@ -437,8 +437,8 @@ void btPolyhedralContactClipping::clipFaceAgainstHull(const btVector3& separatin const btVector3& a = hullA.m_vertices[polyA.m_indices[e0]]; const btVector3& b = hullA.m_vertices[polyA.m_indices[(e0 + 1) % numVerticesA]]; const btVector3 edge0 = a - b; - const btVector3 WorldEdge0 = transA.getBasis() * edge0; - btVector3 worldPlaneAnormal1 = transA.getBasis() * btVector3(polyA.m_plane[0], polyA.m_plane[1], polyA.m_plane[2]); + const btVector3 WorldEdge0 = transA.m_basis * edge0; + btVector3 worldPlaneAnormal1 = transA.m_basis * btVector3(polyA.m_plane[0], polyA.m_plane[1], polyA.m_plane[2]); btVector3 planeNormalWS1 = -WorldEdge0.cross(worldPlaneAnormal1); //.cross(WorldEdge0); btVector3 worldA1 = transA * a; @@ -450,8 +450,8 @@ void btPolyhedralContactClipping::clipFaceAgainstHull(const btVector3& separatin btVector3 localPlaneNormal(hullA.m_faces[otherFace].m_plane[0], hullA.m_faces[otherFace].m_plane[1], hullA.m_faces[otherFace].m_plane[2]); btScalar localPlaneEq = hullA.m_faces[otherFace].m_plane[3]; - btVector3 planeNormalWS = transA.getBasis() * localPlaneNormal; - btScalar planeEqWS = localPlaneEq - planeNormalWS.dot(transA.getOrigin()); + btVector3 planeNormalWS = transA.m_basis * localPlaneNormal; + btScalar planeEqWS = localPlaneEq - planeNormalWS.dot(transA.m_origin); #else btVector3 planeNormalWS = planeNormalWS1; btScalar planeEqWS = planeEqWS1; @@ -472,8 +472,8 @@ void btPolyhedralContactClipping::clipFaceAgainstHull(const btVector3& separatin { btVector3 localPlaneNormal(polyA.m_plane[0], polyA.m_plane[1], polyA.m_plane[2]); btScalar localPlaneEq = polyA.m_plane[3]; - btVector3 planeNormalWS = transA.getBasis() * localPlaneNormal; - btScalar planeEqWS = localPlaneEq - planeNormalWS.dot(transA.getOrigin()); + btVector3 planeNormalWS = transA.m_basis * localPlaneNormal; + btScalar planeEqWS = localPlaneEq - planeNormalWS.dot(transA.m_origin); for (int i = 0; i < pVtxIn->size(); i++) { btVector3 vtx = pVtxIn->at(i); @@ -523,7 +523,7 @@ void btPolyhedralContactClipping::clipHullAgainstHull(const btVector3& separatin for (int face = 0; face < hullB.m_faces.size(); face++) { const btVector3 Normal(hullB.m_faces[face].m_plane[0], hullB.m_faces[face].m_plane[1], hullB.m_faces[face].m_plane[2]); - const btVector3 WorldNormal = transB.getBasis() * Normal; + const btVector3 WorldNormal = transB.m_basis * Normal; btScalar d = WorldNormal.dot(separatingNormal); if (d > dmax) { diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp index f2de4e9018..92cad11b33 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp @@ -159,7 +159,7 @@ void btTriangleConvexcastCallback::processTriangle(btVector3* triangle, int part /* #ifdef USE_SUBSIMPLEX_CONVEX_CAST //rotate normal into worldspace - castResult.m_normal = m_convexShapeFrom.getBasis() * castResult.m_normal; + castResult.m_normal = m_convexShapeFrom.m_basis * castResult.m_normal; #endif //USE_SUBSIMPLEX_CONVEX_CAST */ castResult.m_normal.normalize(); diff --git a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp index 8b011a8228..662b68d6b8 100644 --- a/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp +++ b/3rdparty/bullet3/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp @@ -39,8 +39,8 @@ bool btSubsimplexConvexCast::calcTimeOfImpact( m_simplexSolver->reset(); btVector3 linVelA, linVelB; - linVelA = toA.getOrigin() - fromA.getOrigin(); - linVelB = toB.getOrigin() - fromB.getOrigin(); + linVelA = toA.m_origin - fromA.m_origin; + linVelB = toB.m_origin - fromB.m_origin; btScalar lambda = btScalar(0.); @@ -51,8 +51,8 @@ bool btSubsimplexConvexCast::calcTimeOfImpact( btVector3 r = (linVelA - linVelB); btVector3 v; - btVector3 supVertexA = fromA(m_convexA->localGetSupportingVertex(-r * fromA.getBasis())); - btVector3 supVertexB = fromB(m_convexB->localGetSupportingVertex(r * fromB.getBasis())); + btVector3 supVertexA = fromA(m_convexA->localGetSupportingVertex(-r * fromA.m_basis)); + btVector3 supVertexB = fromB(m_convexB->localGetSupportingVertex(r * fromB.m_basis)); v = supVertexA - supVertexB; int maxIter = result.m_subSimplexCastMaxIterations; @@ -70,8 +70,8 @@ bool btSubsimplexConvexCast::calcTimeOfImpact( while ((dist2 > result.m_subSimplexCastEpsilon) && maxIter--) { - supVertexA = interpolatedTransA(m_convexA->localGetSupportingVertex(-v * interpolatedTransA.getBasis())); - supVertexB = interpolatedTransB(m_convexB->localGetSupportingVertex(v * interpolatedTransB.getBasis())); + supVertexA = interpolatedTransA(m_convexA->localGetSupportingVertex(-v * interpolatedTransA.m_basis)); + supVertexB = interpolatedTransB(m_convexB->localGetSupportingVertex(v * interpolatedTransB.m_basis)); w = supVertexA - supVertexB; btScalar VdotW = v.dot(w); @@ -92,8 +92,8 @@ bool btSubsimplexConvexCast::calcTimeOfImpact( lambda = lambda - VdotW / VdotR; //interpolate to next lambda // x = s + lambda * r; - interpolatedTransA.getOrigin().setInterpolate3(fromA.getOrigin(), toA.getOrigin(), lambda); - interpolatedTransB.getOrigin().setInterpolate3(fromB.getOrigin(), toB.getOrigin(), lambda); + interpolatedTransA.m_origin.setInterpolate3(fromA.m_origin, toA.m_origin, lambda); + interpolatedTransB.m_origin.setInterpolate3(fromB.m_origin, toB.m_origin, lambda); //m_simplexSolver->reset(); //check next line w = supVertexA - supVertexB; diff --git a/3rdparty/bullet3/src/BulletDynamics/Character/btKinematicCharacterController.cpp b/3rdparty/bullet3/src/BulletDynamics/Character/btKinematicCharacterController.cpp index 2bbccb291c..e008713d87 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Character/btKinematicCharacterController.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Character/btKinematicCharacterController.cpp @@ -86,7 +86,7 @@ class btKinematicClosestNotMeConvexResultCallback : public btCollisionWorld::Clo else { ///need to transform normal into worldspace - hitNormalWorld = convexResult.m_hitCollisionObject->getWorldTransform().getBasis() * convexResult.m_hitNormalLocal; + hitNormalWorld = convexResult.m_hitCollisionObject->getWorldTransform().m_basis * convexResult.m_hitNormalLocal; } btScalar dotUp = m_up.dot(hitNormalWorld); @@ -195,7 +195,7 @@ bool btKinematicCharacterController::recoverFromPenetration(btCollisionWorld* co collisionWorld->getDispatcher()->dispatchAllCollisionPairs(m_ghostObject->getOverlappingPairCache(), collisionWorld->getDispatchInfo(), collisionWorld->getDispatcher()); - m_currentPosition = m_ghostObject->getWorldTransform().getOrigin(); + m_currentPosition = m_ghostObject->getWorldTransform().m_origin; // btScalar maxPen = btScalar(0.0); for (int i = 0; i < m_ghostObject->getOverlappingPairCache()->getNumOverlappingPairs(); i++) @@ -248,7 +248,7 @@ bool btKinematicCharacterController::recoverFromPenetration(btCollisionWorld* co } } btTransform newTrans = m_ghostObject->getWorldTransform(); - newTrans.setOrigin(m_currentPosition); + newTrans.m_origin = (m_currentPosition); m_ghostObject->setWorldTransform(newTrans); // printf("m_touchingNormal = %f,%f,%f\n",m_touchingNormal[0],m_touchingNormal[1],m_touchingNormal[2]); return penetration; @@ -267,12 +267,12 @@ void btKinematicCharacterController::stepUp(btCollisionWorld* world) end.setIdentity(); /* FIXME: Handle penetration properly */ - start.setOrigin(m_currentPosition); + start.m_origin = (m_currentPosition); m_targetPosition = m_currentPosition + m_up * (stepHeight) + m_jumpAxis * ((m_verticalOffset > 0.f ? m_verticalOffset : 0.f)); m_currentPosition = m_targetPosition; - end.setOrigin(m_targetPosition); + end.m_origin = (m_targetPosition); start.setRotation(m_currentOrientation); end.setRotation(m_targetOrientation); @@ -304,7 +304,7 @@ void btKinematicCharacterController::stepUp(btCollisionWorld* world) } btTransform& xform = m_ghostObject->getWorldTransform(); - xform.setOrigin(m_currentPosition); + xform.m_origin = (m_currentPosition); m_ghostObject->setWorldTransform(xform); // fix penetration if we hit a ceiling for example @@ -320,7 +320,7 @@ void btKinematicCharacterController::stepUp(btCollisionWorld* world) break; } } - m_targetPosition = m_ghostObject->getWorldTransform().getOrigin(); + m_targetPosition = m_ghostObject->getWorldTransform().m_origin; m_currentPosition = m_targetPosition; if (m_verticalOffset > 0) @@ -401,8 +401,8 @@ void btKinematicCharacterController::stepForwardAndStrafe(btCollisionWorld* coll while (fraction > btScalar(0.01) && maxIter-- > 0) { - start.setOrigin(m_currentPosition); - end.setOrigin(m_targetPosition); + start.m_origin = (m_currentPosition); + end.m_origin = (m_targetPosition); btVector3 sweepDirNegative(m_currentPosition - m_targetPosition); start.setRotation(m_currentOrientation); @@ -503,14 +503,14 @@ void btKinematicCharacterController::stepDown(btCollisionWorld* collisionWorld, end_double.setIdentity(); - start.setOrigin(m_currentPosition); - end.setOrigin(m_targetPosition); + start.m_origin = (m_currentPosition); + end.m_origin = (m_targetPosition); start.setRotation(m_currentOrientation); end.setRotation(m_targetOrientation); //set double test for 2x the step drop, to check for a large drop vs small drop - end_double.setOrigin(m_targetPosition - step_drop); + end_double.m_origin = (m_targetPosition - step_drop); if (m_useGhostObjectSweepTest) { @@ -659,7 +659,7 @@ void btKinematicCharacterController::setLinearVelocity(const btVector3& velocity if (c > 0.0f) { m_wasJumping = true; - m_jumpPosition = m_ghostObject->getWorldTransform().getOrigin(); + m_jumpPosition = m_ghostObject->getWorldTransform().m_origin; } } } @@ -693,13 +693,13 @@ void btKinematicCharacterController::warp(const btVector3& origin) { btTransform xform; xform.setIdentity(); - xform.setOrigin(origin); + xform.m_origin = (origin); m_ghostObject->setWorldTransform(xform); } void btKinematicCharacterController::preStep(btCollisionWorld* collisionWorld) { - m_currentPosition = m_ghostObject->getWorldTransform().getOrigin(); + m_currentPosition = m_ghostObject->getWorldTransform().m_origin; m_targetPosition = m_currentPosition; m_currentOrientation = m_ghostObject->getWorldTransform().getRotation(); @@ -730,7 +730,7 @@ void btKinematicCharacterController::playerStep(btCollisionWorld* collisionWorld xform.setRotation(orn); m_ghostObject->setWorldTransform(xform); - m_currentPosition = m_ghostObject->getWorldTransform().getOrigin(); + m_currentPosition = m_ghostObject->getWorldTransform().m_origin; m_targetPosition = m_currentPosition; m_currentOrientation = m_ghostObject->getWorldTransform().getRotation(); m_targetOrientation = m_currentOrientation; @@ -832,7 +832,7 @@ void btKinematicCharacterController::playerStep(btCollisionWorld* collisionWorld //} // printf("\n"); - xform.setOrigin(m_currentPosition); + xform.m_origin = (m_currentPosition); m_ghostObject->setWorldTransform(xform); int numPenetrationLoops = 0; @@ -878,13 +878,13 @@ void btKinematicCharacterController::jump(const btVector3& v) m_jumpAxis = v.length2() == 0 ? m_up : v.normalized(); - m_jumpPosition = m_ghostObject->getWorldTransform().getOrigin(); + m_jumpPosition = m_ghostObject->getWorldTransform().m_origin; #if 0 currently no jumping. btTransform xform; m_rigidBody->getMotionState()->getWorldTransform (xform); - btVector3 up = xform.getBasis()[1]; + btVector3 up = xform.m_basis[1]; up.normalize (); btScalar magnitude = (btScalar(1.0)/m_rigidBody->getInvMass()) * btScalar(8.0); m_rigidBody->applyCentralImpulse (up * magnitude); diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btBatchedConstraints.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btBatchedConstraints.cpp index 89bd067a27..798f360dd3 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btBatchedConstraints.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btBatchedConstraints.cpp @@ -114,8 +114,8 @@ static void debugDrawSingleBatch(const btBatchedConstraints* bc, const btSolverConstraint& con = constraints->at(iCon); int iBody0 = con.m_solverBodyIdA; int iBody1 = con.m_solverBodyIdB; - btVector3 pos0 = bodies[iBody0].getWorldTransform().getOrigin() + offset; - btVector3 pos1 = bodies[iBody1].getWorldTransform().getOrigin() + offset; + btVector3 pos0 = bodies[iBody0].getWorldTransform().m_origin + offset; + btVector3 pos1 = bodies[iBody1].getWorldTransform().m_origin + offset; bc->m_debugDrawer->drawLine(pos0, pos1, color); } } @@ -153,7 +153,7 @@ static void debugDrawAllBatches(const btBatchedConstraints* bc, btVector3 bboxMax = -bboxMin; for (int iBody = 0; iBody < bodies.size(); ++iBody) { - const btVector3& pos = bodies[iBody].getWorldTransform().getOrigin(); + const btVector3& pos = bodies[iBody].getWorldTransform().m_origin; bboxMin.setMin(pos); bboxMax.setMax(pos); } @@ -872,7 +872,7 @@ static void setupSpatialGridBatchesMt( for (int i = 0; i < bodies.size(); ++i) { const btSolverBody& body = bodies[i]; - btVector3 bodyPos = body.getWorldTransform().getOrigin(); + btVector3 bodyPos = body.getWorldTransform().m_origin; bool isDynamic = (body.internalGetInvMass().x() > btScalar(0)); bodyPositions[i] = bodyPos; bodyDynamicFlags[i] = isDynamic; diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp index ac046aa6ea..f0100736a3 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp @@ -43,7 +43,7 @@ btConeTwistConstraint::btConeTwistConstraint(btRigidBody& rbA, const btTransform : btTypedConstraint(CONETWIST_CONSTRAINT_TYPE, rbA), m_rbAFrame(rbAFrame), m_angularOnly(false), m_useSolveConstraintObsolete(CONETWIST_USE_OBSOLETE_SOLVER) { m_rbBFrame = m_rbAFrame; - m_rbBFrame.setOrigin(btVector3(0., 0., 0.)); + m_rbBFrame.m_origin = (btVector3(0., 0., 0.)); init(); } @@ -115,7 +115,7 @@ void btConeTwistConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const bt info->m_J1linearAxis[0] = 1; info->m_J1linearAxis[info->rowskip + 1] = 1; info->m_J1linearAxis[2 * info->rowskip + 2] = 1; - btVector3 a1 = transA.getBasis() * m_rbAFrame.getOrigin(); + btVector3 a1 = transA.m_basis * m_rbAFrame.m_origin; { btVector3* angular0 = (btVector3*)(info->m_J1angularAxis); btVector3* angular1 = (btVector3*)(info->m_J1angularAxis + info->rowskip); @@ -126,7 +126,7 @@ void btConeTwistConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const bt info->m_J2linearAxis[0] = -1; info->m_J2linearAxis[info->rowskip + 1] = -1; info->m_J2linearAxis[2 * info->rowskip + 2] = -1; - btVector3 a2 = transB.getBasis() * m_rbBFrame.getOrigin(); + btVector3 a2 = transB.m_basis * m_rbBFrame.m_origin; { btVector3* angular0 = (btVector3*)(info->m_J2angularAxis); btVector3* angular1 = (btVector3*)(info->m_J2angularAxis + info->rowskip); @@ -139,7 +139,7 @@ void btConeTwistConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const bt int j; for (j = 0; j < 3; j++) { - info->m_constraintError[j * info->rowskip] = k * (a2[j] + transB.getOrigin()[j] - a1[j] - transA.getOrigin()[j]); + info->m_constraintError[j * info->rowskip] = k * (a2[j] + transB.m_origin[j] - a1[j] - transA.m_origin[j]); info->m_lowerLimit[j * info->rowskip] = -SIMD_INFINITY; info->m_upperLimit[j * info->rowskip] = SIMD_INFINITY; if (m_flags & BT_CONETWIST_FLAGS_LIN_CFM) @@ -158,8 +158,8 @@ void btConeTwistConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const bt if ((m_swingSpan1 < m_fixThresh) && (m_swingSpan2 < m_fixThresh)) { btTransform trA = transA * m_rbAFrame; - btVector3 p = trA.getBasis().getColumn(1); - btVector3 q = trA.getBasis().getColumn(2); + btVector3 p = trA.m_basis.getColumn(1); + btVector3 q = trA.m_basis.getColumn(2); int srow1 = srow + info->rowskip; J1[srow + 0] = p[0]; J1[srow + 1] = p[1]; @@ -254,8 +254,8 @@ void btConeTwistConstraint::buildJacobian() if (!m_angularOnly) { - btVector3 pivotAInW = m_rbA.getCenterOfMassTransform() * m_rbAFrame.getOrigin(); - btVector3 pivotBInW = m_rbB.getCenterOfMassTransform() * m_rbBFrame.getOrigin(); + btVector3 pivotAInW = m_rbA.getCenterOfMassTransform() * m_rbAFrame.m_origin; + btVector3 pivotBInW = m_rbB.getCenterOfMassTransform() * m_rbBFrame.m_origin; btVector3 relPos = pivotBInW - pivotAInW; btVector3 normal[3]; @@ -273,8 +273,8 @@ void btConeTwistConstraint::buildJacobian() for (int i = 0; i < 3; i++) { new (&m_jac[i]) btJacobianEntry( - m_rbA.getCenterOfMassTransform().getBasis().transpose(), - m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getCenterOfMassTransform().m_basis.transpose(), + m_rbB.getCenterOfMassTransform().m_basis.transpose(), pivotAInW - m_rbA.getCenterOfMassPosition(), pivotBInW - m_rbB.getCenterOfMassPosition(), normal[i], @@ -294,8 +294,8 @@ void btConeTwistConstraint::solveConstraintObsolete(btSolverBody& bodyA, btSolve #ifndef __SPU__ if (m_useSolveConstraintObsolete) { - btVector3 pivotAInW = m_rbA.getCenterOfMassTransform() * m_rbAFrame.getOrigin(); - btVector3 pivotBInW = m_rbB.getCenterOfMassTransform() * m_rbBFrame.getOrigin(); + btVector3 pivotAInW = m_rbA.getCenterOfMassTransform() * m_rbAFrame.m_origin; + btVector3 pivotBInW = m_rbB.getCenterOfMassTransform() * m_rbBFrame.m_origin; btScalar tau = btScalar(0.3); @@ -522,8 +522,8 @@ void btConeTwistConstraint::calcAngleInfo() btVector3 b1Axis1(0, 0, 0), b1Axis2(0, 0, 0), b1Axis3(0, 0, 0); btVector3 b2Axis1(0, 0, 0), b2Axis2(0, 0, 0); - b1Axis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(0); - b2Axis1 = getRigidBodyB().getCenterOfMassTransform().getBasis() * this->m_rbBFrame.getBasis().getColumn(0); + b1Axis1 = getRigidBodyA().getCenterOfMassTransform().m_basis * this->m_rbAFrame.m_basis.getColumn(0); + b2Axis1 = getRigidBodyB().getCenterOfMassTransform().m_basis * this->m_rbBFrame.m_basis.getColumn(0); btScalar swing1 = btScalar(0.), swing2 = btScalar(0.); @@ -534,7 +534,7 @@ void btConeTwistConstraint::calcAngleInfo() // Get Frame into world space if (m_swingSpan1 >= btScalar(0.05f)) { - b1Axis2 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(1); + b1Axis2 = getRigidBodyA().getCenterOfMassTransform().m_basis * this->m_rbAFrame.m_basis.getColumn(1); swx = b2Axis1.dot(b1Axis1); swy = b2Axis1.dot(b1Axis2); swing1 = btAtan2Fast(swy, swx); @@ -545,7 +545,7 @@ void btConeTwistConstraint::calcAngleInfo() if (m_swingSpan2 >= btScalar(0.05f)) { - b1Axis3 = getRigidBodyA().getCenterOfMassTransform().getBasis() * this->m_rbAFrame.getBasis().getColumn(2); + b1Axis3 = getRigidBodyA().getCenterOfMassTransform().m_basis * this->m_rbAFrame.m_basis.getColumn(2); swx = b2Axis1.dot(b1Axis1); swy = b2Axis1.dot(b1Axis3); swing2 = btAtan2Fast(swy, swx); @@ -572,7 +572,7 @@ void btConeTwistConstraint::calcAngleInfo() // Twist limits if (m_twistSpan >= btScalar(0.)) { - btVector3 b2Axis2 = getRigidBodyB().getCenterOfMassTransform().getBasis() * this->m_rbBFrame.getBasis().getColumn(1); + btVector3 b2Axis2 = getRigidBodyB().getCenterOfMassTransform().m_basis * this->m_rbBFrame.m_basis.getColumn(1); btQuaternion rotationArc = shortestArcQuat(b2Axis1, b1Axis1); btVector3 TwistRef = quatRotate(rotationArc, b2Axis2); btScalar twist = btAtan2Fast(TwistRef.dot(b1Axis3), TwistRef.dot(b1Axis2)); @@ -689,10 +689,10 @@ void btConeTwistConstraint::calcAngleInfo2(const btTransform& transA, const btTr // you haven't set any limits; // or you're trying to set at least one of the swing limits too small. (if so, do you really want a conetwist constraint?) // anyway, we have either hinge or fixed joint - btVector3 ivA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(0); - btVector3 jvA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(1); - btVector3 kvA = transA.getBasis() * m_rbAFrame.getBasis().getColumn(2); - btVector3 ivB = transB.getBasis() * m_rbBFrame.getBasis().getColumn(0); + btVector3 ivA = transA.m_basis * m_rbAFrame.m_basis.getColumn(0); + btVector3 jvA = transA.m_basis * m_rbAFrame.m_basis.getColumn(1); + btVector3 kvA = transA.m_basis * m_rbAFrame.m_basis.getColumn(2); + btVector3 ivB = transB.m_basis * m_rbBFrame.m_basis.getColumn(0); btVector3 target; btScalar x = ivB.dot(ivA); btScalar y = ivB.dot(jvA); diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp index e8ebe3a795..2c4049b728 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp @@ -69,8 +69,8 @@ btScalar resolveSingleCollision( const btVector3& normal = contactNormalOnB; - btVector3 rel_pos1 = contactPositionWorld - body1->getWorldTransform().getOrigin(); - btVector3 rel_pos2 = contactPositionWorld - colObj2->getWorldTransform().getOrigin(); + btVector3 rel_pos1 = contactPositionWorld - body1->getWorldTransform().m_origin; + btVector3 rel_pos2 = contactPositionWorld - colObj2->getWorldTransform().m_origin; btVector3 vel1 = body1->getVelocityInLocalPoint(rel_pos1); btVector3 vel2 = body2 ? body2->getVelocityInLocalPoint(rel_pos2) : btVector3(0, 0, 0); @@ -124,8 +124,8 @@ void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1, btVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2); btVector3 vel = vel1 - vel2; - btJacobianEntry jac(body1.getCenterOfMassTransform().getBasis().transpose(), - body2.getCenterOfMassTransform().getBasis().transpose(), + btJacobianEntry jac(body1.getCenterOfMassTransform().m_basis.transpose(), + body2.getCenterOfMassTransform().m_basis.transpose(), rel_pos1, rel_pos2, normal, body1.getInvInertiaDiagLocal(), body1.getInvMass(), body2.getInvInertiaDiagLocal(), body2.getInvMass()); @@ -134,9 +134,9 @@ void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1, btScalar rel_vel = jac.getRelativeVelocity( body1.getLinearVelocity(), - body1.getCenterOfMassTransform().getBasis().transpose() * body1.getAngularVelocity(), + body1.getCenterOfMassTransform().m_basis.transpose() * body1.getAngularVelocity(), body2.getLinearVelocity(), - body2.getCenterOfMassTransform().getBasis().transpose() * body2.getAngularVelocity()); + body2.getCenterOfMassTransform().m_basis.transpose() * body2.getAngularVelocity()); rel_vel = normal.dot(vel); diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGearConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGearConstraint.cpp index 7535c52c05..066a8da690 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGearConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGearConstraint.cpp @@ -39,8 +39,8 @@ void btGearConstraint::getInfo2(btConstraintInfo2* info) { btVector3 globalAxisA, globalAxisB; - globalAxisA = m_rbA.getWorldTransform().getBasis() * this->m_axisInA; - globalAxisB = m_rbB.getWorldTransform().getBasis() * this->m_axisInB; + globalAxisA = m_rbA.getWorldTransform().m_basis * this->m_axisInA; + globalAxisB = m_rbB.getWorldTransform().m_basis * this->m_axisInB; info->m_J1angularAxis[0] = globalAxisA[0]; info->m_J1angularAxis[1] = globalAxisA[1]; diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp index 14ec4a8e0a..c9f6e4e89d 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp @@ -305,7 +305,7 @@ btScalar btTranslationalLimitMotor::solveLinearAxis( void btGeneric6DofConstraint::calculateAngleInfo() { - btMatrix3x3 relative_frame = m_calculatedTransformA.getBasis().inverse() * m_calculatedTransformB.getBasis(); + btMatrix3x3 relative_frame = m_calculatedTransformA.m_basis.inverse() * m_calculatedTransformB.m_basis; matrixToEulerXYZ(relative_frame, m_calculatedAxisAngleDiff); // in euler angle mode we do not actually constrain the angular velocity // along the axes axis[0] and axis[2] (although we do use axis[1]) : @@ -321,8 +321,8 @@ void btGeneric6DofConstraint::calculateAngleInfo() // GetInfo1 then take the derivative. to prove this for angle[2] it is // easier to take the euler rate expression for d(angle[2])/dt with respect // to the components of w and set that to 0. - btVector3 axis0 = m_calculatedTransformB.getBasis().getColumn(0); - btVector3 axis2 = m_calculatedTransformA.getBasis().getColumn(2); + btVector3 axis0 = m_calculatedTransformB.m_basis.getColumn(0); + btVector3 axis2 = m_calculatedTransformA.m_basis.getColumn(2); m_calculatedAxis[1] = axis2.cross(axis0); m_calculatedAxis[0] = m_calculatedAxis[1].cross(axis2); @@ -367,8 +367,8 @@ void btGeneric6DofConstraint::buildLinearJacobian( const btVector3& pivotAInW, const btVector3& pivotBInW) { new (&jacLinear) btJacobianEntry( - m_rbA.getCenterOfMassTransform().getBasis().transpose(), - m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getCenterOfMassTransform().m_basis.transpose(), + m_rbB.getCenterOfMassTransform().m_basis.transpose(), pivotAInW - m_rbA.getCenterOfMassPosition(), pivotBInW - m_rbB.getCenterOfMassPosition(), normalWorld, @@ -382,8 +382,8 @@ void btGeneric6DofConstraint::buildAngularJacobian( btJacobianEntry& jacAngular, const btVector3& jointAxisW) { new (&jacAngular) btJacobianEntry(jointAxisW, - m_rbA.getCenterOfMassTransform().getBasis().transpose(), - m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getCenterOfMassTransform().m_basis.transpose(), + m_rbB.getCenterOfMassTransform().m_basis.transpose(), m_rbA.getInvInertiaDiagLocal(), m_rbB.getInvInertiaDiagLocal()); } @@ -413,8 +413,8 @@ void btGeneric6DofConstraint::buildJacobian() //calculates transform calculateTransforms(m_rbA.getCenterOfMassTransform(), m_rbB.getCenterOfMassTransform()); - // const btVector3& pivotAInW = m_calculatedTransformA.getOrigin(); - // const btVector3& pivotBInW = m_calculatedTransformB.getOrigin(); + // const btVector3& pivotAInW = m_calculatedTransformA.m_origin; + // const btVector3& pivotBInW = m_calculatedTransformB.m_origin; calcAnchorPos(); btVector3 pivotAInW = m_AnchorPos; btVector3 pivotBInW = m_AnchorPos; @@ -430,9 +430,9 @@ void btGeneric6DofConstraint::buildJacobian() if (m_linearLimits.isLimited(i)) { if (m_useLinearReferenceFrameA) - normalWorld = m_calculatedTransformA.getBasis().getColumn(i); + normalWorld = m_calculatedTransformA.m_basis.getColumn(i); else - normalWorld = m_calculatedTransformB.getBasis().getColumn(i); + normalWorld = m_calculatedTransformB.m_basis.getColumn(i); buildLinearJacobian( m_jacLinear[i], normalWorld, @@ -573,7 +573,7 @@ int btGeneric6DofConstraint::setLinearLimits(btConstraintInfo2* info, int row, c limot.m_maxLimitForce = btScalar(0.f); limot.m_maxMotorForce = m_linearLimits.m_maxMotorForce[i]; limot.m_targetVelocity = m_linearLimits.m_targetVelocity[i]; - btVector3 axis = m_calculatedTransformA.getBasis().getColumn(i); + btVector3 axis = m_calculatedTransformA.m_basis.getColumn(i); int flags = m_flags >> (i * BT_6DOF_FLAGS_AXIS_SHIFT); limot.m_normalCFM = (flags & BT_6DOF_FLAGS_CFM_NORM) ? m_linearLimits.m_normalCFM[i] : info->cfm[0]; limot.m_stopCFM = (flags & BT_6DOF_FLAGS_CFM_STOP) ? m_linearLimits.m_stopCFM[i] : info->cfm[0]; @@ -670,16 +670,16 @@ void btGeneric6DofConstraint::calcAnchorPos(void) { weight = imA / (imA + imB); } - const btVector3& pA = m_calculatedTransformA.getOrigin(); - const btVector3& pB = m_calculatedTransformB.getOrigin(); + const btVector3& pA = m_calculatedTransformA.m_origin; + const btVector3& pB = m_calculatedTransformB.m_origin; m_AnchorPos = pA * weight + pB * (btScalar(1.0) - weight); return; } void btGeneric6DofConstraint::calculateLinearInfo() { - m_calculatedLinearDiff = m_calculatedTransformB.getOrigin() - m_calculatedTransformA.getOrigin(); - m_calculatedLinearDiff = m_calculatedTransformA.getBasis().inverse() * m_calculatedLinearDiff; + m_calculatedLinearDiff = m_calculatedTransformB.m_origin - m_calculatedTransformA.m_origin; + m_calculatedLinearDiff = m_calculatedTransformA.m_basis.inverse() * m_calculatedLinearDiff; for (int i = 0; i < 3; i++) { m_linearLimits.m_currentLinearDiff[i] = m_calculatedLinearDiff[i]; @@ -713,13 +713,13 @@ int btGeneric6DofConstraint::get_limit_motor_info2( { btVector3 tmpA, tmpB, relA, relB; // get vector from bodyB to frameB in WCS - relB = m_calculatedTransformB.getOrigin() - transB.getOrigin(); + relB = m_calculatedTransformB.m_origin - transB.m_origin; // get its projection to constraint axis btVector3 projB = ax1 * relB.dot(ax1); // get vector directed from bodyB to constraint axis (and orthogonal to it) btVector3 orthoB = relB - projB; // same for bodyA - relA = m_calculatedTransformA.getOrigin() - transA.getOrigin(); + relA = m_calculatedTransformA.m_origin - transA.m_origin; btVector3 projA = ax1 * relA.dot(ax1); btVector3 orthoA = relA - projA; // get desired offset between frames A and B along constraint axis @@ -743,13 +743,13 @@ int btGeneric6DofConstraint::get_limit_motor_info2( else { btVector3 ltd; // Linear Torque Decoupling vector - btVector3 c = m_calculatedTransformB.getOrigin() - transA.getOrigin(); + btVector3 c = m_calculatedTransformB.m_origin - transA.m_origin; ltd = c.cross(ax1); info->m_J1angularAxis[srow + 0] = ltd[0]; info->m_J1angularAxis[srow + 1] = ltd[1]; info->m_J1angularAxis[srow + 2] = ltd[2]; - c = m_calculatedTransformB.getOrigin() - transB.getOrigin(); + c = m_calculatedTransformB.m_origin - transB.m_origin; ltd = -c.cross(ax1); info->m_J2angularAxis[srow + 0] = ltd[0]; info->m_J2angularAxis[srow + 1] = ltd[1]; @@ -963,7 +963,7 @@ void btGeneric6DofConstraint::setAxis(const btVector3& axis1, const btVector3& a btTransform frameInW; frameInW.setIdentity(); - frameInW.getBasis().setValue(xAxis[0], yAxis[0], zAxis[0], + frameInW.m_basis.setValue(xAxis[0], yAxis[0], zAxis[0], xAxis[1], yAxis[1], zAxis[1], xAxis[2], yAxis[2], zAxis[2]); diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp index 39e0cc0ae4..5e7e934b13 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp @@ -268,7 +268,7 @@ bool btGeneric6DofSpring2Constraint::matrixToEulerZYX(const btMatrix3x3& mat, bt void btGeneric6DofSpring2Constraint::calculateAngleInfo() { - btMatrix3x3 relative_frame = m_calculatedTransformA.getBasis().inverse() * m_calculatedTransformB.getBasis(); + btMatrix3x3 relative_frame = m_calculatedTransformA.m_basis.inverse() * m_calculatedTransformB.m_basis; switch (m_rotateOrder) { case RO_XYZ: @@ -327,8 +327,8 @@ void btGeneric6DofSpring2Constraint::calculateAngleInfo() //third rotate around x" = X //Original XYZ extrinsic rotation order. //Planes: xy and YZ normals: z, X. Plane intersection (N) is z.cross(X) - btVector3 axis0 = m_calculatedTransformB.getBasis().getColumn(0); - btVector3 axis2 = m_calculatedTransformA.getBasis().getColumn(2); + btVector3 axis0 = m_calculatedTransformB.m_basis.getColumn(0); + btVector3 axis2 = m_calculatedTransformA.m_basis.getColumn(2); m_calculatedAxis[1] = axis2.cross(axis0); m_calculatedAxis[0] = m_calculatedAxis[1].cross(axis2); m_calculatedAxis[2] = axis0.cross(m_calculatedAxis[1]); @@ -340,8 +340,8 @@ void btGeneric6DofSpring2Constraint::calculateAngleInfo() //first rotate around y //second rotate around z'= y.cross(X) //third rotate around x" = X - btVector3 axis0 = m_calculatedTransformB.getBasis().getColumn(0); - btVector3 axis1 = m_calculatedTransformA.getBasis().getColumn(1); + btVector3 axis0 = m_calculatedTransformB.m_basis.getColumn(0); + btVector3 axis1 = m_calculatedTransformA.m_basis.getColumn(1); m_calculatedAxis[2] = axis0.cross(axis1); m_calculatedAxis[0] = axis1.cross(m_calculatedAxis[2]); m_calculatedAxis[1] = m_calculatedAxis[2].cross(axis0); @@ -353,8 +353,8 @@ void btGeneric6DofSpring2Constraint::calculateAngleInfo() //first rotate around z //second rotate around x'= z.cross(Y) //third rotate around y" = Y - btVector3 axis1 = m_calculatedTransformB.getBasis().getColumn(1); - btVector3 axis2 = m_calculatedTransformA.getBasis().getColumn(2); + btVector3 axis1 = m_calculatedTransformB.m_basis.getColumn(1); + btVector3 axis2 = m_calculatedTransformA.m_basis.getColumn(2); m_calculatedAxis[0] = axis1.cross(axis2); m_calculatedAxis[1] = axis2.cross(m_calculatedAxis[0]); m_calculatedAxis[2] = m_calculatedAxis[0].cross(axis1); @@ -366,8 +366,8 @@ void btGeneric6DofSpring2Constraint::calculateAngleInfo() //first rotate around x //second rotate around z'= x.cross(Y) //third rotate around y" = Y - btVector3 axis0 = m_calculatedTransformA.getBasis().getColumn(0); - btVector3 axis1 = m_calculatedTransformB.getBasis().getColumn(1); + btVector3 axis0 = m_calculatedTransformA.m_basis.getColumn(0); + btVector3 axis1 = m_calculatedTransformB.m_basis.getColumn(1); m_calculatedAxis[2] = axis0.cross(axis1); m_calculatedAxis[0] = axis1.cross(m_calculatedAxis[2]); m_calculatedAxis[1] = m_calculatedAxis[2].cross(axis0); @@ -379,8 +379,8 @@ void btGeneric6DofSpring2Constraint::calculateAngleInfo() //first rotate around y //second rotate around x'= y.cross(Z) //third rotate around z" = Z - btVector3 axis1 = m_calculatedTransformA.getBasis().getColumn(1); - btVector3 axis2 = m_calculatedTransformB.getBasis().getColumn(2); + btVector3 axis1 = m_calculatedTransformA.m_basis.getColumn(1); + btVector3 axis2 = m_calculatedTransformB.m_basis.getColumn(2); m_calculatedAxis[0] = axis1.cross(axis2); m_calculatedAxis[1] = axis2.cross(m_calculatedAxis[0]); m_calculatedAxis[2] = m_calculatedAxis[0].cross(axis1); @@ -392,8 +392,8 @@ void btGeneric6DofSpring2Constraint::calculateAngleInfo() //first rotate around x //second rotate around y' = x.cross(Z) //third rotate around z" = Z - btVector3 axis0 = m_calculatedTransformA.getBasis().getColumn(0); - btVector3 axis2 = m_calculatedTransformB.getBasis().getColumn(2); + btVector3 axis0 = m_calculatedTransformA.m_basis.getColumn(0); + btVector3 axis2 = m_calculatedTransformB.m_basis.getColumn(2); m_calculatedAxis[1] = axis2.cross(axis0); m_calculatedAxis[0] = m_calculatedAxis[1].cross(axis2); m_calculatedAxis[2] = axis0.cross(m_calculatedAxis[1]); @@ -513,7 +513,7 @@ int btGeneric6DofSpring2Constraint::setLinearLimits(btConstraintInfo2* info, int limot.m_loLimit = m_linearLimits.m_lowerLimit[i]; limot.m_maxMotorForce = m_linearLimits.m_maxMotorForce[i]; limot.m_targetVelocity = m_linearLimits.m_targetVelocity[i]; - btVector3 axis = m_calculatedTransformA.getBasis().getColumn(i); + btVector3 axis = m_calculatedTransformA.m_basis.getColumn(i); int flags = m_flags >> (i * BT_6DOF_FLAGS_AXIS_SHIFT2); limot.m_stopCFM = (flags & BT_6DOF_FLAGS_CFM_STOP2) ? m_linearLimits.m_stopCFM[i] : info->cfm[0]; limot.m_stopERP = (flags & BT_6DOF_FLAGS_ERP_STOP2) ? m_linearLimits.m_stopERP[i] : info->erp; @@ -625,8 +625,8 @@ void btGeneric6DofSpring2Constraint::setFrames(const btTransform& frameA, const void btGeneric6DofSpring2Constraint::calculateLinearInfo() { - m_calculatedLinearDiff = m_calculatedTransformB.getOrigin() - m_calculatedTransformA.getOrigin(); - m_calculatedLinearDiff = m_calculatedTransformA.getBasis().inverse() * m_calculatedLinearDiff; + m_calculatedLinearDiff = m_calculatedTransformB.m_origin - m_calculatedTransformA.m_origin; + m_calculatedLinearDiff = m_calculatedTransformA.m_basis.inverse() * m_calculatedLinearDiff; for (int i = 0; i < 3; i++) { m_linearLimits.m_currentLinearDiff[i] = m_calculatedLinearDiff[i]; @@ -651,9 +651,9 @@ void btGeneric6DofSpring2Constraint::calculateJacobi(btRotationalLimitMotor2* li { btVector3 tmpA, tmpB, relA, relB; // get vector from bodyB to frameB in WCS - relB = m_calculatedTransformB.getOrigin() - transB.getOrigin(); + relB = m_calculatedTransformB.m_origin - transB.m_origin; // same for bodyA - relA = m_calculatedTransformA.getOrigin() - transA.getOrigin(); + relA = m_calculatedTransformA.m_origin - transA.m_origin; tmpA = relA.cross(ax1); tmpB = relB.cross(ax1); if (m_hasStaticBody && (!rotAllowed)) @@ -828,8 +828,8 @@ int btGeneric6DofSpring2Constraint::get_limit_motor_info2( } else { - btVector3 tanVelA = angVelA.cross(m_calculatedTransformA.getOrigin() - transA.getOrigin()); - btVector3 tanVelB = angVelB.cross(m_calculatedTransformB.getOrigin() - transB.getOrigin()); + btVector3 tanVelA = angVelA.cross(m_calculatedTransformA.m_origin - transA.m_origin); + btVector3 tanVelB = angVelB.cross(m_calculatedTransformB.m_origin - transB.m_origin); vel = (linVelA + tanVelA).dot(ax1) - (linVelB + tanVelB).dot(ax1); } btScalar cfm = BT_ZERO; @@ -837,8 +837,8 @@ int btGeneric6DofSpring2Constraint::get_limit_motor_info2( btScalar mB = BT_ONE / m_rbB.getInvMass(); if (rotational) { - btScalar rrA = (m_calculatedTransformA.getOrigin() - transA.getOrigin()).length2(); - btScalar rrB = (m_calculatedTransformB.getOrigin() - transB.getOrigin()).length2(); + btScalar rrA = (m_calculatedTransformA.m_origin - transA.m_origin).length2(); + btScalar rrB = (m_calculatedTransformB.m_origin - transB.m_origin).length2(); if (m_rbA.getInvMass()) mA = mA * rrA + 1 / (m_rbA.getInvInertiaTensorWorld() * ax1).length(); if (m_rbB.getInvMass()) mB = mB * rrB + 1 / (m_rbB.getInvInertiaTensorWorld() * ax1).length(); } @@ -1027,7 +1027,7 @@ void btGeneric6DofSpring2Constraint::setAxis(const btVector3& axis1, const btVec btTransform frameInW; frameInW.setIdentity(); - frameInW.getBasis().setValue(xAxis[0], yAxis[0], zAxis[0], + frameInW.m_basis.setValue(xAxis[0], yAxis[0], zAxis[0], xAxis[1], yAxis[1], zAxis[1], xAxis[2], yAxis[2], zAxis[2]); diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp index 8baf52bcd1..abfd8dadeb 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp @@ -157,7 +157,7 @@ void btGeneric6DofSpringConstraint::setAxis(const btVector3& axis1, const btVect btTransform frameInW; frameInW.setIdentity(); - frameInW.getBasis().setValue(xAxis[0], yAxis[0], zAxis[0], + frameInW.m_basis.setValue(xAxis[0], yAxis[0], zAxis[0], xAxis[1], yAxis[1], zAxis[1], xAxis[2], yAxis[2], zAxis[2]); diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp index 6507e1a0a7..14d55da7fd 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp @@ -40,10 +40,10 @@ btHinge2Constraint::btHinge2Constraint(btRigidBody& rbA, btRigidBody& rbB, btVec btVector3 yAxis = zAxis.cross(xAxis); // we want right coordinate system btTransform frameInW; frameInW.setIdentity(); - frameInW.getBasis().setValue(xAxis[0], yAxis[0], zAxis[0], + frameInW.m_basis.setValue(xAxis[0], yAxis[0], zAxis[0], xAxis[1], yAxis[1], zAxis[1], xAxis[2], yAxis[2], zAxis[2]); - frameInW.setOrigin(anchor); + frameInW.m_origin = (anchor); // now get constraint frame in local coordinate systems m_frameInA = rbA.getCenterOfMassTransform().inverse() * frameInW; m_frameInB = rbB.getCenterOfMassTransform().inverse() * frameInW; diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h index 95f604a890..4cd96bc498 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHinge2Constraint.h @@ -41,8 +41,8 @@ btHinge2Constraint : public btGeneric6DofSpring2Constraint // axis1 must be orthogonal to axis2 btHinge2Constraint(btRigidBody & rbA, btRigidBody & rbB, btVector3 & anchor, btVector3 & axis1, btVector3 & axis2); // access - const btVector3& getAnchor() { return m_calculatedTransformA.getOrigin(); } - const btVector3& getAnchor2() { return m_calculatedTransformB.getOrigin(); } + const btVector3& getAnchor() { return m_calculatedTransformA.m_origin; } + const btVector3& getAnchor2() { return m_calculatedTransformB.m_origin; } const btVector3& getAxis1() { return m_axis1; } const btVector3& getAxis2() { return m_axis2; } btScalar getAngle1() { return getAngle(2); } diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp index cb59e5a5b5..5435693dd6 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp @@ -44,22 +44,22 @@ btHingeConstraint::btHingeConstraint(btRigidBody& rbA, btRigidBody& rbB, const b m_stopCFM(0), m_stopERP(0) { - m_rbAFrame.getOrigin() = pivotInA; + m_rbAFrame.m_origin = pivotInA; // since no frame is given, assume this to be zero angle and just pick rb transform axis - btVector3 rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(0); + btVector3 rbAxisA1 = rbA.getCenterOfMassTransform().m_basis.getColumn(0); btVector3 rbAxisA2; btScalar projection = axisInA.dot(rbAxisA1); if (projection >= 1.0f - SIMD_EPSILON) { - rbAxisA1 = -rbA.getCenterOfMassTransform().getBasis().getColumn(2); - rbAxisA2 = rbA.getCenterOfMassTransform().getBasis().getColumn(1); + rbAxisA1 = -rbA.getCenterOfMassTransform().m_basis.getColumn(2); + rbAxisA2 = rbA.getCenterOfMassTransform().m_basis.getColumn(1); } else if (projection <= -1.0f + SIMD_EPSILON) { - rbAxisA1 = rbA.getCenterOfMassTransform().getBasis().getColumn(2); - rbAxisA2 = rbA.getCenterOfMassTransform().getBasis().getColumn(1); + rbAxisA1 = rbA.getCenterOfMassTransform().m_basis.getColumn(2); + rbAxisA2 = rbA.getCenterOfMassTransform().m_basis.getColumn(1); } else { @@ -67,7 +67,7 @@ btHingeConstraint::btHingeConstraint(btRigidBody& rbA, btRigidBody& rbB, const b rbAxisA1 = rbAxisA2.cross(axisInA); } - m_rbAFrame.getBasis().setValue(rbAxisA1.getX(), rbAxisA2.getX(), axisInA.getX(), + m_rbAFrame.m_basis.setValue(rbAxisA1.getX(), rbAxisA2.getX(), axisInA.getX(), rbAxisA1.getY(), rbAxisA2.getY(), axisInA.getY(), rbAxisA1.getZ(), rbAxisA2.getZ(), axisInA.getZ()); @@ -75,8 +75,8 @@ btHingeConstraint::btHingeConstraint(btRigidBody& rbA, btRigidBody& rbB, const b btVector3 rbAxisB1 = quatRotate(rotationArc, rbAxisA1); btVector3 rbAxisB2 = axisInB.cross(rbAxisB1); - m_rbBFrame.getOrigin() = pivotInB; - m_rbBFrame.getBasis().setValue(rbAxisB1.getX(), rbAxisB2.getX(), axisInB.getX(), + m_rbBFrame.m_origin = pivotInB; + m_rbBFrame.m_basis.setValue(rbAxisB1.getX(), rbAxisB2.getX(), axisInB.getX(), rbAxisB1.getY(), rbAxisB2.getY(), axisInB.getY(), rbAxisB1.getZ(), rbAxisB2.getZ(), axisInB.getZ()); @@ -113,19 +113,19 @@ btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btVector3& pivotInA btVector3 rbAxisA1, rbAxisA2; btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2); - m_rbAFrame.getOrigin() = pivotInA; - m_rbAFrame.getBasis().setValue(rbAxisA1.getX(), rbAxisA2.getX(), axisInA.getX(), + m_rbAFrame.m_origin = pivotInA; + m_rbAFrame.m_basis.setValue(rbAxisA1.getX(), rbAxisA2.getX(), axisInA.getX(), rbAxisA1.getY(), rbAxisA2.getY(), axisInA.getY(), rbAxisA1.getZ(), rbAxisA2.getZ(), axisInA.getZ()); - btVector3 axisInB = rbA.getCenterOfMassTransform().getBasis() * axisInA; + btVector3 axisInB = rbA.getCenterOfMassTransform().m_basis * axisInA; btQuaternion rotationArc = shortestArcQuat(axisInA, axisInB); btVector3 rbAxisB1 = quatRotate(rotationArc, rbAxisA1); btVector3 rbAxisB2 = axisInB.cross(rbAxisB1); - m_rbBFrame.getOrigin() = rbA.getCenterOfMassTransform()(pivotInA); - m_rbBFrame.getBasis().setValue(rbAxisB1.getX(), rbAxisB2.getX(), axisInB.getX(), + m_rbBFrame.m_origin = rbA.getCenterOfMassTransform()(pivotInA); + m_rbBFrame.m_basis.setValue(rbAxisB1.getX(), rbAxisB2.getX(), axisInB.getX(), rbAxisB1.getY(), rbAxisB2.getY(), axisInB.getY(), rbAxisB1.getZ(), rbAxisB2.getZ(), axisInB.getZ()); @@ -188,7 +188,7 @@ btHingeConstraint::btHingeConstraint(btRigidBody& rbA, const btTransform& rbAFra { ///not providing rigidbody B means implicitly using worldspace for body B - m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(m_rbAFrame.getOrigin()); + m_rbBFrame.m_origin = m_rbA.getCenterOfMassTransform()(m_rbAFrame.m_origin); #ifndef _BT_USE_CENTER_LIMIT_ //start with free m_lowerLimit = btScalar(1.0f); @@ -210,8 +210,8 @@ void btHingeConstraint::buildJacobian() if (!m_angularOnly) { - btVector3 pivotAInW = m_rbA.getCenterOfMassTransform() * m_rbAFrame.getOrigin(); - btVector3 pivotBInW = m_rbB.getCenterOfMassTransform() * m_rbBFrame.getOrigin(); + btVector3 pivotAInW = m_rbA.getCenterOfMassTransform() * m_rbAFrame.m_origin; + btVector3 pivotBInW = m_rbB.getCenterOfMassTransform() * m_rbBFrame.m_origin; btVector3 relPos = pivotBInW - pivotAInW; btVector3 normal[3]; @@ -229,8 +229,8 @@ void btHingeConstraint::buildJacobian() for (int i = 0; i < 3; i++) { new (&m_jac[i]) btJacobianEntry( - m_rbA.getCenterOfMassTransform().getBasis().transpose(), - m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getCenterOfMassTransform().m_basis.transpose(), + m_rbB.getCenterOfMassTransform().m_basis.transpose(), pivotAInW - m_rbA.getCenterOfMassPosition(), pivotBInW - m_rbB.getCenterOfMassPosition(), normal[i], @@ -248,27 +248,27 @@ void btHingeConstraint::buildJacobian() btVector3 jointAxis0local; btVector3 jointAxis1local; - btPlaneSpace1(m_rbAFrame.getBasis().getColumn(2), jointAxis0local, jointAxis1local); + btPlaneSpace1(m_rbAFrame.m_basis.getColumn(2), jointAxis0local, jointAxis1local); - btVector3 jointAxis0 = getRigidBodyA().getCenterOfMassTransform().getBasis() * jointAxis0local; - btVector3 jointAxis1 = getRigidBodyA().getCenterOfMassTransform().getBasis() * jointAxis1local; - btVector3 hingeAxisWorld = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(2); + btVector3 jointAxis0 = getRigidBodyA().getCenterOfMassTransform().m_basis * jointAxis0local; + btVector3 jointAxis1 = getRigidBodyA().getCenterOfMassTransform().m_basis * jointAxis1local; + btVector3 hingeAxisWorld = getRigidBodyA().getCenterOfMassTransform().m_basis * m_rbAFrame.m_basis.getColumn(2); new (&m_jacAng[0]) btJacobianEntry(jointAxis0, - m_rbA.getCenterOfMassTransform().getBasis().transpose(), - m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getCenterOfMassTransform().m_basis.transpose(), + m_rbB.getCenterOfMassTransform().m_basis.transpose(), m_rbA.getInvInertiaDiagLocal(), m_rbB.getInvInertiaDiagLocal()); new (&m_jacAng[1]) btJacobianEntry(jointAxis1, - m_rbA.getCenterOfMassTransform().getBasis().transpose(), - m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getCenterOfMassTransform().m_basis.transpose(), + m_rbB.getCenterOfMassTransform().m_basis.transpose(), m_rbA.getInvInertiaDiagLocal(), m_rbB.getInvInertiaDiagLocal()); new (&m_jacAng[2]) btJacobianEntry(hingeAxisWorld, - m_rbA.getCenterOfMassTransform().getBasis().transpose(), - m_rbB.getCenterOfMassTransform().getBasis().transpose(), + m_rbA.getCenterOfMassTransform().m_basis.transpose(), + m_rbB.getCenterOfMassTransform().m_basis.transpose(), m_rbA.getInvInertiaDiagLocal(), m_rbB.getInvInertiaDiagLocal()); @@ -279,7 +279,7 @@ void btHingeConstraint::buildJacobian() testLimit(m_rbA.getCenterOfMassTransform(), m_rbB.getCenterOfMassTransform()); //Compute K = J*W*J' for hinge axis - btVector3 axisA = getRigidBodyA().getCenterOfMassTransform().getBasis() * m_rbAFrame.getBasis().getColumn(2); + btVector3 axisA = getRigidBodyA().getCenterOfMassTransform().m_basis * m_rbAFrame.m_basis.getColumn(2); m_kHinge = 1.0f / (getRigidBodyA().computeAngularImpulseDenominator(axisA) + getRigidBodyB().computeAngularImpulseDenominator(axisA)); } @@ -397,8 +397,8 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf btTransform trA = transA * m_rbAFrame; btTransform trB = transB * m_rbBFrame; // pivot point - btVector3 pivotAInW = trA.getOrigin(); - btVector3 pivotBInW = trB.getOrigin(); + btVector3 pivotAInW = trA.m_origin; + btVector3 pivotBInW = trB.m_origin; #if 0 if (0) { @@ -437,7 +437,7 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf info->m_J2linearAxis[2 * skip + 2] = -1; } - btVector3 a1 = pivotAInW - transA.getOrigin(); + btVector3 a1 = pivotAInW - transA.m_origin; { btVector3* angular0 = (btVector3*)(info->m_J1angularAxis); btVector3* angular1 = (btVector3*)(info->m_J1angularAxis + skip); @@ -445,7 +445,7 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf btVector3 a1neg = -a1; a1neg.getSkewSymmetricMatrix(angular0, angular1, angular2); } - btVector3 a2 = pivotBInW - transB.getOrigin(); + btVector3 a2 = pivotBInW - transB.m_origin; { btVector3* angular0 = (btVector3*)(info->m_J2angularAxis); btVector3* angular1 = (btVector3*)(info->m_J2angularAxis + skip); @@ -472,10 +472,10 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf // where p and q are unit vectors normal to the hinge axis, and w1 and w2 // are the angular velocity vectors of the two bodies. // get hinge axis (Z) - btVector3 ax1 = trA.getBasis().getColumn(2); + btVector3 ax1 = trA.m_basis.getColumn(2); // get 2 orthos to hinge axis (X, Y) - btVector3 p = trA.getBasis().getColumn(0); - btVector3 q = trA.getBasis().getColumn(1); + btVector3 p = trA.m_basis.getColumn(0); + btVector3 q = trA.m_basis.getColumn(1); // set the two hinge angular rows int s3 = 3 * info->rowskip; int s4 = 4 * info->rowskip; @@ -508,7 +508,7 @@ void btHingeConstraint::getInfo2Internal(btConstraintInfo2* info, const btTransf // angular_velocity = (erp*fps) * (ax1 x ax2) // ax1 x ax2 is in the plane space of ax1, so we project the angular // velocity to p and q to find the right hand side. - btVector3 ax2 = trB.getBasis().getColumn(2); + btVector3 ax2 = trB.m_basis.getColumn(2); btVector3 u = ax1.cross(ax2); info->m_constraintError[s3] = k * u.dot(p); info->m_constraintError[s4] = k * u.dot(q); @@ -646,9 +646,9 @@ btScalar btHingeConstraint::getHingeAngle() btScalar btHingeConstraint::getHingeAngle(const btTransform& transA, const btTransform& transB) { - const btVector3 refAxis0 = transA.getBasis() * m_rbAFrame.getBasis().getColumn(0); - const btVector3 refAxis1 = transA.getBasis() * m_rbAFrame.getBasis().getColumn(1); - const btVector3 swingAxis = transB.getBasis() * m_rbBFrame.getBasis().getColumn(1); + const btVector3 refAxis0 = transA.m_basis * m_rbAFrame.m_basis.getColumn(0); + const btVector3 refAxis1 = transA.m_basis * m_rbAFrame.m_basis.getColumn(1); + const btVector3 swingAxis = transB.m_basis * m_rbBFrame.m_basis.getColumn(1); // btScalar angle = btAtan2Fast(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1)); btScalar angle = btAtan2(swingAxis.dot(refAxis0), swingAxis.dot(refAxis1)); return m_referenceSign * angle; @@ -739,11 +739,11 @@ void btHingeConstraint::getInfo2InternalUsingFrameOffset(btConstraintInfo2* info btTransform trA = transA * m_rbAFrame; btTransform trB = transB * m_rbBFrame; // pivot point -// btVector3 pivotAInW = trA.getOrigin(); -// btVector3 pivotBInW = trB.getOrigin(); +// btVector3 pivotAInW = trA.m_origin; +// btVector3 pivotBInW = trB.m_origin; #if 1 // difference between frames in WCS - btVector3 ofs = trB.getOrigin() - trA.getOrigin(); + btVector3 ofs = trB.m_origin - trA.m_origin; // now get weight factors depending on masses btScalar miA = getRigidBodyA().getInvMass(); btScalar miB = getRigidBodyB().getInvMass(); @@ -761,8 +761,8 @@ void btHingeConstraint::getInfo2InternalUsingFrameOffset(btConstraintInfo2* info factB = btScalar(1.0f) - factA; // get the desired direction of hinge axis // as weighted sum of Z-orthos of frameA and frameB in WCS - btVector3 ax1A = trA.getBasis().getColumn(2); - btVector3 ax1B = trB.getBasis().getColumn(2); + btVector3 ax1A = trA.m_basis.getColumn(2); + btVector3 ax1B = trB.m_basis.getColumn(2); btVector3 ax1 = ax1A * factA + ax1B * factB; if (ax1.length2()m_J1linearAxis[info->rowskip + 1] = 1; info->m_J1linearAxis[2 * info->rowskip + 2] = 1; - btVector3 a1 = body0_trans.getBasis() * getPivotInA(); + btVector3 a1 = body0_trans.m_basis * getPivotInA(); { btVector3* angular0 = (btVector3*)(info->m_J1angularAxis); btVector3* angular1 = (btVector3*)(info->m_J1angularAxis + info->rowskip); @@ -103,7 +103,7 @@ void btPoint2PointConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const info->m_J2linearAxis[info->rowskip + 1] = -1; info->m_J2linearAxis[2 * info->rowskip + 2] = -1; - btVector3 a2 = body1_trans.getBasis() * getPivotInB(); + btVector3 a2 = body1_trans.m_basis * getPivotInB(); { // btVector3 a2n = -a2; @@ -119,7 +119,7 @@ void btPoint2PointConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const int j; for (j = 0; j < 3; j++) { - info->m_constraintError[j * info->rowskip] = k * (a2[j] + body1_trans.getOrigin()[j] - a1[j] - body0_trans.getOrigin()[j]); + info->m_constraintError[j * info->rowskip] = k * (a2[j] + body1_trans.m_origin[j] - a1[j] - body0_trans.m_origin[j]); //printf("info->m_constraintError[%d]=%f\n",j,info->m_constraintError[j]); } if (m_flags & BT_P2P_FLAGS_CFM) diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp index 419e564c40..06a12dbcc2 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp @@ -506,12 +506,12 @@ void btSequentialImpulseConstraintSolver::applyAnisotropicFriction(btCollisionOb if (colObj && colObj->hasAnisotropicFriction(frictionMode)) { // transform to local coordinates - btVector3 loc_lateral = frictionDirection * colObj->getWorldTransform().getBasis(); + btVector3 loc_lateral = frictionDirection * colObj->getWorldTransform().m_basis; const btVector3& friction_scaling = colObj->getAnisotropicFriction(); //apply anisotropic friction loc_lateral *= friction_scaling; // ... and transform it back to global coordinates - frictionDirection = colObj->getWorldTransform().getBasis() * loc_lateral; + frictionDirection = colObj->getWorldTransform().m_basis * loc_lateral; } } @@ -808,10 +808,10 @@ void btSequentialImpulseConstraintSolver::setupContactConstraint(btSolverConstra btRigidBody* rb0 = bodyA->m_originalBody; btRigidBody* rb1 = bodyB->m_originalBody; - // btVector3 rel_pos1 = pos1 - colObj0->getWorldTransform().getOrigin(); - // btVector3 rel_pos2 = pos2 - colObj1->getWorldTransform().getOrigin(); - //rel_pos1 = pos1 - bodyA->getWorldTransform().getOrigin(); - //rel_pos2 = pos2 - bodyB->getWorldTransform().getOrigin(); + // btVector3 rel_pos1 = pos1 - colObj0->getWorldTransform().m_origin; + // btVector3 rel_pos2 = pos2 - colObj1->getWorldTransform().m_origin; + //rel_pos1 = pos1 - bodyA->getWorldTransform().m_origin; + //rel_pos2 = pos2 - bodyB->getWorldTransform().m_origin; relaxation = infoGlobal.m_sor; btScalar invTimeStep = btScalar(1) / infoGlobal.m_timeStep; @@ -1037,8 +1037,8 @@ void btSequentialImpulseConstraintSolver::convertContact(btPersistentManifold* m const btVector3& pos1 = cp.getPositionWorldOnA(); const btVector3& pos2 = cp.getPositionWorldOnB(); - rel_pos1 = pos1 - colObj0->getWorldTransform().getOrigin(); - rel_pos2 = pos2 - colObj1->getWorldTransform().getOrigin(); + rel_pos1 = pos1 - colObj0->getWorldTransform().m_origin; + rel_pos2 = pos2 - colObj1->getWorldTransform().m_origin; btVector3 vel1; btVector3 vel2; diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolverMt.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolverMt.cpp index 7aa9953bbf..f80d92ad38 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolverMt.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolverMt.cpp @@ -84,8 +84,8 @@ void btSequentialImpulseConstraintSolverMt::internalSetupContactConstraints(int const btVector3& pos1 = cp.getPositionWorldOnA(); const btVector3& pos2 = cp.getPositionWorldOnB(); - rel_pos1 = pos1 - solverBodyA->getWorldTransform().getOrigin(); - rel_pos2 = pos2 - solverBodyB->getWorldTransform().getOrigin(); + rel_pos1 = pos1 - solverBodyA->getWorldTransform().m_origin; + rel_pos2 = pos2 - solverBodyB->getWorldTransform().m_origin; btVector3 vel1; btVector3 vel2; diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp index e42223c4cd..91658ab0f8 100755 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp @@ -92,7 +92,7 @@ btSliderConstraint::btSliderConstraint(btRigidBody& rbB, const btTransform& fram { ///not providing rigidbody A means implicitly using worldspace for body A m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB; - // m_frameInA.getOrigin() = m_rbA.getCenterOfMassTransform()(m_frameInA.getOrigin()); + // m_frameInA.m_origin = m_rbA.getCenterOfMassTransform()(m_frameInA.m_origin); initParams(); } @@ -148,9 +148,9 @@ void btSliderConstraint::calculateTransforms(const btTransform& transA, const bt m_calculatedTransformA = transB * m_frameInB; m_calculatedTransformB = transA * m_frameInA; } - m_realPivotAInW = m_calculatedTransformA.getOrigin(); - m_realPivotBInW = m_calculatedTransformB.getOrigin(); - m_sliderAxis = m_calculatedTransformA.getBasis().getColumn(0); // along X + m_realPivotAInW = m_calculatedTransformA.m_origin; + m_realPivotBInW = m_calculatedTransformB.m_origin; + m_sliderAxis = m_calculatedTransformA.m_basis.getColumn(0); // along X if (m_useLinearReferenceFrameA || m_useSolveConstraintObsolete) { m_delta = m_realPivotBInW - m_realPivotAInW; @@ -165,7 +165,7 @@ void btSliderConstraint::calculateTransforms(const btTransform& transA, const bt //linear part for (i = 0; i < 3; i++) { - normalWorld = m_calculatedTransformA.getBasis().getColumn(i); + normalWorld = m_calculatedTransformA.m_basis.getColumn(i); m_depth[i] = m_delta.dot(normalWorld); } } @@ -203,9 +203,9 @@ void btSliderConstraint::testAngLimits(void) m_solveAngLim = false; if (m_lowerAngLimit <= m_upperAngLimit) { - const btVector3 axisA0 = m_calculatedTransformA.getBasis().getColumn(1); - const btVector3 axisA1 = m_calculatedTransformA.getBasis().getColumn(2); - const btVector3 axisB0 = m_calculatedTransformB.getBasis().getColumn(1); + const btVector3 axisA0 = m_calculatedTransformA.m_basis.getColumn(1); + const btVector3 axisA1 = m_calculatedTransformA.m_basis.getColumn(2); + const btVector3 axisB0 = m_calculatedTransformB.m_basis.getColumn(1); // btScalar rot = btAtan2Fast(axisB0.dot(axisA1), axisB0.dot(axisA0)); btScalar rot = btAtan2(axisB0.dot(axisA1), axisB0.dot(axisA0)); rot = btAdjustAngleToLimits(rot, m_lowerAngLimit, m_upperAngLimit); @@ -234,7 +234,7 @@ btVector3 btSliderConstraint::getAncorInA(void) btVector3 btSliderConstraint::getAncorInB(void) { btVector3 ancorInB; - ancorInB = m_frameInB.getOrigin(); + ancorInB = m_frameInB.m_origin; return ancorInB; } @@ -249,7 +249,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra btScalar signFact = m_useLinearReferenceFrameA ? btScalar(1.0f) : btScalar(-1.0f); // difference between frames in WCS - btVector3 ofs = trB.getOrigin() - trA.getOrigin(); + btVector3 ofs = trB.m_origin - trA.m_origin; // now get weight factors depending on masses btScalar miA = rbAinvMass; btScalar miB = rbBinvMass; @@ -266,8 +266,8 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra } factB = btScalar(1.0f) - factA; btVector3 ax1, p, q; - btVector3 ax1A = trA.getBasis().getColumn(0); - btVector3 ax1B = trB.getBasis().getColumn(0); + btVector3 ax1A = trA.m_basis.getColumn(0); + btVector3 ax1B = trB.m_basis.getColumn(0); if (m_useOffsetForConstraintFrame) { // get the desired direction of slider axis @@ -279,10 +279,10 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra } else { // old way - use frameA - ax1 = trA.getBasis().getColumn(0); + ax1 = trA.m_basis.getColumn(0); // get 2 orthos to slider axis (Y, Z) - p = trA.getBasis().getColumn(1); - q = trA.getBasis().getColumn(2); + p = trA.m_basis.getColumn(1); + q = trA.m_basis.getColumn(2); } // make rotations around these orthos equal // the slider axis should be the only unconstrained @@ -352,13 +352,13 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra if (m_useOffsetForConstraintFrame) { // get vector from bodyB to frameB in WCS - relB = trB.getOrigin() - bodyB_trans.getOrigin(); + relB = trB.m_origin - bodyB_trans.m_origin; // get its projection to slider axis btVector3 projB = ax1 * relB.dot(ax1); // get vector directed from bodyB to slider axis (and orthogonal to it) btVector3 orthoB = relB - projB; // same for bodyA - relA = trA.getOrigin() - bodyA_trans.getOrigin(); + relA = trA.m_origin - bodyA_trans.m_origin; btVector3 projA = ax1 * relA.dot(ax1); btVector3 orthoA = relA - projA; // get desired offset between frames A and B along slider axis @@ -377,7 +377,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra } else { - p = trA.getBasis().getColumn(1); + p = trA.m_basis.getColumn(1); } // make one more ortho q = ax1.cross(p); @@ -404,7 +404,7 @@ void btSliderConstraint::getInfo2NonVirtual(btConstraintInfo2* info, const btTra else { // old way - maybe incorrect if bodies are not on the slider axis // see discussion "Bug in slider constraint" http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=4024&start=0 - c = bodyB_trans.getOrigin() - bodyA_trans.getOrigin(); + c = bodyB_trans.m_origin - bodyA_trans.m_origin; btVector3 tmp = c.cross(p); for (i = 0; i < 3; i++) info->m_J1angularAxis[s2 + i] = factA * tmp[i]; for (i = 0; i < 3; i++) info->m_J2angularAxis[s2 + i] = factB * tmp[i]; diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp index 42ed1fbb87..0b5c8aadd0 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp @@ -42,10 +42,10 @@ btUniversalConstraint::btUniversalConstraint(btRigidBody& rbA, btRigidBody& rbB, btVector3 xAxis = yAxis.cross(zAxis); // we want right coordinate system btTransform frameInW; frameInW.setIdentity(); - frameInW.getBasis().setValue(xAxis[0], yAxis[0], zAxis[0], + frameInW.m_basis.setValue(xAxis[0], yAxis[0], zAxis[0], xAxis[1], yAxis[1], zAxis[1], xAxis[2], yAxis[2], zAxis[2]); - frameInW.setOrigin(anchor); + frameInW.m_origin = (anchor); // now get constraint frame in local coordinate systems m_frameInA = rbA.getCenterOfMassTransform().inverse() * frameInW; m_frameInB = rbB.getCenterOfMassTransform().inverse() * frameInW; @@ -67,10 +67,10 @@ void btUniversalConstraint::setAxis(const btVector3& axis1, const btVector3& axi btTransform frameInW; frameInW.setIdentity(); - frameInW.getBasis().setValue(xAxis[0], yAxis[0], zAxis[0], + frameInW.m_basis.setValue(xAxis[0], yAxis[0], zAxis[0], xAxis[1], yAxis[1], zAxis[1], xAxis[2], yAxis[2], zAxis[2]); - frameInW.setOrigin(m_anchor); + frameInW.m_origin = (m_anchor); // now get constraint frame in local coordinate systems m_frameInA = m_rbA.getCenterOfMassTransform().inverse() * frameInW; diff --git a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h index 8c24d93a64..ffcde8300e 100644 --- a/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h +++ b/3rdparty/bullet3/src/BulletDynamics/ConstraintSolver/btUniversalConstraint.h @@ -43,8 +43,8 @@ btUniversalConstraint : public btGeneric6DofConstraint // axis1 must be orthogonal to axis2 btUniversalConstraint(btRigidBody & rbA, btRigidBody & rbB, const btVector3& anchor, const btVector3& axis1, const btVector3& axis2); // access - const btVector3& getAnchor() { return m_calculatedTransformA.getOrigin(); } - const btVector3& getAnchor2() { return m_calculatedTransformB.getOrigin(); } + const btVector3& getAnchor() { return m_calculatedTransformA.m_origin; } + const btVector3& getAnchor2() { return m_calculatedTransformB.m_origin; } const btVector3& getAxis1() { return m_axis1; } const btVector3& getAxis2() { return m_axis2; } btScalar getAngle1() { return getAngle(2); } diff --git a/3rdparty/bullet3/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/3rdparty/bullet3/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp index 9e99c154f2..f079ef155e 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp @@ -781,7 +781,7 @@ class btClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConve btVector3 linVelA, linVelB; linVelA = m_convexToWorld - m_convexFromWorld; - linVelB = btVector3(0, 0, 0); //toB.getOrigin()-fromB.getOrigin(); + linVelB = btVector3(0, 0, 0); //toB.m_origin-fromB.m_origin; btVector3 relativeVelocity = (linVelA - linVelB); //don't report time of impact for motion away from the contact normal (or causes minor penetration) @@ -858,7 +858,7 @@ void btDiscreteDynamicsWorld::createPredictiveContactsInternal(btRigidBody** bod { body->predictIntegratedTransform(timeStep, predictedTrans); - btScalar squareMotion = (predictedTrans.getOrigin() - body->getWorldTransform().getOrigin()).length2(); + btScalar squareMotion = (predictedTrans.m_origin - body->getWorldTransform().m_origin).length2(); if (getDispatchInfo().m_useContinuous && body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion) { @@ -883,9 +883,9 @@ void btDiscreteDynamicsWorld::createPredictiveContactsInternal(btRigidBody** bod } }; - StaticOnlyCallback sweepResults(body, body->getWorldTransform().getOrigin(), predictedTrans.getOrigin(), getBroadphase()->getOverlappingPairCache(), getDispatcher()); + StaticOnlyCallback sweepResults(body, body->getWorldTransform().m_origin, predictedTrans.m_origin, getBroadphase()->getOverlappingPairCache(), getDispatcher()); #else - btClosestNotMeConvexResultCallback sweepResults(body, body->getWorldTransform().getOrigin(), predictedTrans.getOrigin(), getBroadphase()->getOverlappingPairCache(), getDispatcher()); + btClosestNotMeConvexResultCallback sweepResults(body, body->getWorldTransform().m_origin, predictedTrans.m_origin, getBroadphase()->getOverlappingPairCache(), getDispatcher()); #endif //btConvexShape* convexShape = static_cast(body->getCollisionShape()); btSphereShape tmpSphere(body->getCcdSweptSphereRadius()); //btConvexShape* convexShape = static_cast(body->getCollisionShape()); @@ -894,12 +894,12 @@ void btDiscreteDynamicsWorld::createPredictiveContactsInternal(btRigidBody** bod sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup; sweepResults.m_collisionFilterMask = body->getBroadphaseProxy()->m_collisionFilterMask; btTransform modifiedPredictedTrans = predictedTrans; - modifiedPredictedTrans.setBasis(body->getWorldTransform().getBasis()); + modifiedPredictedTrans.m_basis = (body->getWorldTransform().m_basis); convexSweepTest(&tmpSphere, body->getWorldTransform(), modifiedPredictedTrans, sweepResults); if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f)) { - btVector3 distVec = (predictedTrans.getOrigin() - body->getWorldTransform().getOrigin()) * sweepResults.m_closestHitFraction; + btVector3 distVec = (predictedTrans.m_origin - body->getWorldTransform().m_origin) * sweepResults.m_closestHitFraction; btScalar distance = distVec.dot(-sweepResults.m_hitNormalWorld); btMutexLock(&m_predictiveManifoldsMutex); @@ -907,7 +907,7 @@ void btDiscreteDynamicsWorld::createPredictiveContactsInternal(btRigidBody** bod m_predictiveManifolds.push_back(manifold); btMutexUnlock(&m_predictiveManifoldsMutex); - btVector3 worldPointB = body->getWorldTransform().getOrigin() + distVec; + btVector3 worldPointB = body->getWorldTransform().m_origin + distVec; btVector3 localPointB = sweepResults.m_hitCollisionObject->getWorldTransform().inverse() * worldPointB; btManifoldPoint newPoint(btVector3(0, 0, 0), localPointB, sweepResults.m_hitNormalWorld, distance); @@ -917,7 +917,7 @@ void btDiscreteDynamicsWorld::createPredictiveContactsInternal(btRigidBody** bod btManifoldPoint& pt = manifold->getContactPoint(index); pt.m_combinedRestitution = 0; pt.m_combinedFriction = gCalculateCombinedFrictionCallback(body, sweepResults.m_hitCollisionObject); - pt.m_positionWorldOnA = body->getWorldTransform().getOrigin(); + pt.m_positionWorldOnA = body->getWorldTransform().m_origin; pt.m_positionWorldOnB = worldPointB; } } @@ -960,7 +960,7 @@ void btDiscreteDynamicsWorld::integrateTransformsInternal(btRigidBody** bodies, { body->predictIntegratedTransform(timeStep, predictedTrans); - btScalar squareMotion = (predictedTrans.getOrigin() - body->getWorldTransform().getOrigin()).length2(); + btScalar squareMotion = (predictedTrans.m_origin - body->getWorldTransform().m_origin).length2(); if (getDispatchInfo().m_useContinuous && body->getCcdSquareMotionThreshold() && body->getCcdSquareMotionThreshold() < squareMotion) { @@ -985,9 +985,9 @@ void btDiscreteDynamicsWorld::integrateTransformsInternal(btRigidBody** bodies, } }; - StaticOnlyCallback sweepResults(body, body->getWorldTransform().getOrigin(), predictedTrans.getOrigin(), getBroadphase()->getOverlappingPairCache(), getDispatcher()); + StaticOnlyCallback sweepResults(body, body->getWorldTransform().m_origin, predictedTrans.m_origin, getBroadphase()->getOverlappingPairCache(), getDispatcher()); #else - btClosestNotMeConvexResultCallback sweepResults(body, body->getWorldTransform().getOrigin(), predictedTrans.getOrigin(), getBroadphase()->getOverlappingPairCache(), getDispatcher()); + btClosestNotMeConvexResultCallback sweepResults(body, body->getWorldTransform().m_origin, predictedTrans.m_origin, getBroadphase()->getOverlappingPairCache(), getDispatcher()); #endif //btConvexShape* convexShape = static_cast(body->getCollisionShape()); btSphereShape tmpSphere(body->getCcdSweptSphereRadius()); //btConvexShape* convexShape = static_cast(body->getCollisionShape()); @@ -996,7 +996,7 @@ void btDiscreteDynamicsWorld::integrateTransformsInternal(btRigidBody** bodies, sweepResults.m_collisionFilterGroup = body->getBroadphaseProxy()->m_collisionFilterGroup; sweepResults.m_collisionFilterMask = body->getBroadphaseProxy()->m_collisionFilterMask; btTransform modifiedPredictedTrans = predictedTrans; - modifiedPredictedTrans.setBasis(body->getWorldTransform().getBasis()); + modifiedPredictedTrans.m_basis = (body->getWorldTransform().m_basis); convexSweepTest(&tmpSphere, body->getWorldTransform(), modifiedPredictedTrans, sweepResults); if (sweepResults.hasHit() && (sweepResults.m_closestHitFraction < 1.f)) @@ -1020,7 +1020,7 @@ void btDiscreteDynamicsWorld::integrateTransformsInternal(btRigidBody** bodies, btScalar ms2 = body->getLinearVelocity().length2(); body->predictIntegratedTransform(timeStep, predictedTrans); - btScalar sm2 = (predictedTrans.getOrigin()-body->getWorldTransform().getOrigin()).length2(); + btScalar sm2 = (predictedTrans.m_origin-body->getWorldTransform().m_origin).length2(); btScalar smt = body->getCcdSquareMotionThreshold(); printf("sm2=%f\n",sm2); } @@ -1075,8 +1075,8 @@ void btDiscreteDynamicsWorld::integrateTransforms(btScalar timeStep) const btVector3& pos1 = pt.getPositionWorldOnA(); const btVector3& pos2 = pt.getPositionWorldOnB(); - btVector3 rel_pos0 = pos1 - body0->getWorldTransform().getOrigin(); - btVector3 rel_pos1 = pos2 - body1->getWorldTransform().getOrigin(); + btVector3 rel_pos0 = pos1 - body0->getWorldTransform().m_origin; + btVector3 rel_pos1 = pos2 - body1->getWorldTransform().m_origin; if (body0) body0->applyImpulse(imp, rel_pos0); @@ -1133,12 +1133,12 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) tr.setIdentity(); btVector3 pivot = p2pC->getPivotInA(); pivot = p2pC->getRigidBodyA().getCenterOfMassTransform() * pivot; - tr.setOrigin(pivot); + tr.m_origin = (pivot); getDebugDrawer()->drawTransform(tr, dbgDrawSize); // that ideally should draw the same frame pivot = p2pC->getPivotInB(); pivot = p2pC->getRigidBodyB().getCenterOfMassTransform() * pivot; - tr.setOrigin(pivot); + tr.m_origin = (pivot); if (drawFrames) getDebugDrawer()->drawTransform(tr, dbgDrawSize); } break; @@ -1164,9 +1164,9 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) } if (drawLimits) { - btVector3& center = tr.getOrigin(); - btVector3 normal = tr.getBasis().getColumn(2); - btVector3 axis = tr.getBasis().getColumn(0); + btVector3& center = tr.m_origin; + btVector3 normal = tr.m_basis.getColumn(2); + btVector3 axis = tr.m_basis.getColumn(0); getDebugDrawer()->drawArc(center, normal, axis, dbgDrawSize, dbgDrawSize, minAng, maxAng, btVector3(0, 0, 0), drawSect); } } @@ -1194,7 +1194,7 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) getDebugDrawer()->drawLine(pPrev, pCur, btVector3(0, 0, 0)); if (i % (nSegments / 8) == 0) - getDebugDrawer()->drawLine(tr.getOrigin(), pCur, btVector3(0, 0, 0)); + getDebugDrawer()->drawLine(tr.m_origin, pCur, btVector3(0, 0, 0)); pPrev = pCur; } @@ -1209,9 +1209,9 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) { tr = pCT->getRigidBodyA().getCenterOfMassTransform() * pCT->getAFrame(); } - btVector3 pivot = tr.getOrigin(); - btVector3 normal = tr.getBasis().getColumn(0); - btVector3 axis1 = tr.getBasis().getColumn(1); + btVector3 pivot = tr.m_origin; + btVector3 normal = tr.m_basis.getColumn(0); + btVector3 axis1 = tr.m_basis.getColumn(1); getDebugDrawer()->drawArc(pivot, normal, axis1, dbgDrawSize, dbgDrawSize, -twa - tws, -twa + tws, btVector3(0, 0, 0), true); } } @@ -1227,15 +1227,15 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) if (drawLimits) { tr = p6DOF->getCalculatedTransformA(); - const btVector3& center = p6DOF->getCalculatedTransformB().getOrigin(); - btVector3 up = tr.getBasis().getColumn(2); - btVector3 axis = tr.getBasis().getColumn(0); + const btVector3& center = p6DOF->getCalculatedTransformB().m_origin; + btVector3 up = tr.m_basis.getColumn(2); + btVector3 axis = tr.m_basis.getColumn(0); btScalar minTh = p6DOF->getRotationalLimitMotor(1)->m_loLimit; btScalar maxTh = p6DOF->getRotationalLimitMotor(1)->m_hiLimit; btScalar minPs = p6DOF->getRotationalLimitMotor(2)->m_loLimit; btScalar maxPs = p6DOF->getRotationalLimitMotor(2)->m_hiLimit; getDebugDrawer()->drawSpherePatch(center, up, axis, dbgDrawSize * btScalar(.9f), minTh, maxTh, minPs, maxPs, btVector3(0, 0, 0)); - axis = tr.getBasis().getColumn(1); + axis = tr.m_basis.getColumn(1); btScalar ay = p6DOF->getAngle(1); btScalar az = p6DOF->getAngle(2); btScalar cy = btCos(ay); @@ -1247,7 +1247,7 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) ref[1] = -sz * axis[0] + cz * axis[1]; ref[2] = cz * sy * axis[0] + sz * sy * axis[1] + cy * axis[2]; tr = p6DOF->getCalculatedTransformB(); - btVector3 normal = -tr.getBasis().getColumn(0); + btVector3 normal = -tr.m_basis.getColumn(0); btScalar minFi = p6DOF->getRotationalLimitMotor(0)->m_loLimit; btScalar maxFi = p6DOF->getRotationalLimitMotor(0)->m_hiLimit; if (minFi > maxFi) @@ -1277,9 +1277,9 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) if (drawLimits) { tr = p6DOF->getCalculatedTransformA(); - const btVector3& center = p6DOF->getCalculatedTransformB().getOrigin(); - btVector3 up = tr.getBasis().getColumn(2); - btVector3 axis = tr.getBasis().getColumn(0); + const btVector3& center = p6DOF->getCalculatedTransformB().m_origin; + btVector3 up = tr.m_basis.getColumn(2); + btVector3 axis = tr.m_basis.getColumn(0); btScalar minTh = p6DOF->getRotationalLimitMotor(1)->m_loLimit; btScalar maxTh = p6DOF->getRotationalLimitMotor(1)->m_hiLimit; if (minTh <= maxTh) @@ -1288,7 +1288,7 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) btScalar maxPs = p6DOF->getRotationalLimitMotor(2)->m_hiLimit; getDebugDrawer()->drawSpherePatch(center, up, axis, dbgDrawSize * btScalar(.9f), minTh, maxTh, minPs, maxPs, btVector3(0, 0, 0)); } - axis = tr.getBasis().getColumn(1); + axis = tr.m_basis.getColumn(1); btScalar ay = p6DOF->getAngle(1); btScalar az = p6DOF->getAngle(2); btScalar cy = btCos(ay); @@ -1300,7 +1300,7 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) ref[1] = -sz * axis[0] + cz * axis[1]; ref[2] = cz * sy * axis[0] + sz * sy * axis[1] + cy * axis[2]; tr = p6DOF->getCalculatedTransformB(); - btVector3 normal = -tr.getBasis().getColumn(0); + btVector3 normal = -tr.m_basis.getColumn(0); btScalar minFi = p6DOF->getRotationalLimitMotor(0)->m_loLimit; btScalar maxFi = p6DOF->getRotationalLimitMotor(0)->m_hiLimit; if (minFi > maxFi) @@ -1332,11 +1332,11 @@ void btDiscreteDynamicsWorld::debugDrawConstraint(btTypedConstraint* constraint) btVector3 li_min = tr * btVector3(pSlider->getLowerLinLimit(), 0.f, 0.f); btVector3 li_max = tr * btVector3(pSlider->getUpperLinLimit(), 0.f, 0.f); getDebugDrawer()->drawLine(li_min, li_max, btVector3(0, 0, 0)); - btVector3 normal = tr.getBasis().getColumn(0); - btVector3 axis = tr.getBasis().getColumn(1); + btVector3 normal = tr.m_basis.getColumn(0); + btVector3 axis = tr.m_basis.getColumn(1); btScalar a_min = pSlider->getLowerAngLimit(); btScalar a_max = pSlider->getUpperAngLimit(); - const btVector3& center = pSlider->getCalculatedTransformB().getOrigin(); + const btVector3& center = pSlider->getCalculatedTransformB().m_origin; getDebugDrawer()->drawArc(center, normal, axis, dbgDrawSize, dbgDrawSize, a_min, a_max, btVector3(0, 0, 0), true); } } diff --git a/3rdparty/bullet3/src/BulletDynamics/Dynamics/btRigidBody.cpp b/3rdparty/bullet3/src/BulletDynamics/Dynamics/btRigidBody.cpp index bf7224b165..241b272180 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Dynamics/btRigidBody.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Dynamics/btRigidBody.cpp @@ -248,7 +248,7 @@ void btRigidBody::setMassProps(btScalar mass, const btVector3& inertia) void btRigidBody::updateInertiaTensor() { - m_invInertiaTensorWorld = m_worldTransform.getBasis().scaled(m_invInertiaLocal) * m_worldTransform.getBasis().transpose(); + m_invInertiaTensorWorld = m_worldTransform.m_basis.scaled(m_invInertiaLocal) * m_worldTransform.m_basis.transpose(); } btVector3 btRigidBody::getLocalInertia() const @@ -283,7 +283,7 @@ inline btMatrix3x3 evalEulerEqnDeriv(const btVector3& w1, const btVector3& w0, c btVector3 btRigidBody::computeGyroscopicForceExplicit(btScalar maxGyroscopicForce) const { btVector3 inertiaLocal = getLocalInertia(); - btMatrix3x3 inertiaTensorWorld = getWorldTransform().getBasis().scaled(inertiaLocal) * getWorldTransform().getBasis().transpose(); + btMatrix3x3 inertiaTensorWorld = getWorldTransform().m_basis.scaled(inertiaLocal) * getWorldTransform().m_basis.transpose(); btVector3 tmp = inertiaTensorWorld * getAngularVelocity(); btVector3 gf = getAngularVelocity().cross(tmp); btScalar l2 = gf.length2(); @@ -343,8 +343,8 @@ btVector3 btRigidBody::computeGyroscopicImpulseImplicit_World(btScalar step) con btMatrix3x3 I; - I = m_worldTransform.getBasis().scaled(inertiaLocal) * - m_worldTransform.getBasis().transpose(); + I = m_worldTransform.m_basis.scaled(inertiaLocal) * + m_worldTransform.m_basis.transpose(); // use newtons method to find implicit solution for new angular velocity (w') // f(w') = -(T*step + Iw) + Iw' + w' + w'xIw'*step = 0 @@ -392,7 +392,7 @@ void btRigidBody::integrateVelocities(btScalar step) btQuaternion btRigidBody::getOrientation() const { btQuaternion orn; - m_worldTransform.getBasis().getRotation(orn); + m_worldTransform.m_basis.getRotation(orn); return orn; } diff --git a/3rdparty/bullet3/src/BulletDynamics/Dynamics/btRigidBody.h b/3rdparty/bullet3/src/BulletDynamics/Dynamics/btRigidBody.h index 00143ef4e1..d50bda58f2 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Dynamics/btRigidBody.h +++ b/3rdparty/bullet3/src/BulletDynamics/Dynamics/btRigidBody.h @@ -422,7 +422,7 @@ class btRigidBody : public btCollisionObject const btVector3& getCenterOfMassPosition() const { - return m_worldTransform.getOrigin(); + return m_worldTransform.m_origin; } btQuaternion getOrientation() const; @@ -474,7 +474,7 @@ class btRigidBody : public btCollisionObject void translate(const btVector3& v) { - m_worldTransform.getOrigin() += v; + m_worldTransform.m_origin += v; } void getAabb(btVector3& aabbMin, btVector3& aabbMax) const; diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBody.cpp b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBody.cpp index 579b7eab46..0ef4128441 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBody.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBody.cpp @@ -1161,13 +1161,13 @@ void btMultiBody::computeAccelerationsArticulatedBodyAlgorithmMultiDof(btScalar { if (isConstraintPass) { - m_links[i].m_jointFeedback->m_reactionForces.m_bottomVec += m_links[i].m_cachedWorldTransform.getBasis() * angularBotVec; - m_links[i].m_jointFeedback->m_reactionForces.m_topVec += m_links[i].m_cachedWorldTransform.getBasis() * linearTopVec; + m_links[i].m_jointFeedback->m_reactionForces.m_bottomVec += m_links[i].m_cachedWorldTransform.m_basis * angularBotVec; + m_links[i].m_jointFeedback->m_reactionForces.m_topVec += m_links[i].m_cachedWorldTransform.m_basis * linearTopVec; } else { - m_links[i].m_jointFeedback->m_reactionForces.m_bottomVec = m_links[i].m_cachedWorldTransform.getBasis() * angularBotVec; - m_links[i].m_jointFeedback->m_reactionForces.m_topVec = m_links[i].m_cachedWorldTransform.getBasis() * linearTopVec; + m_links[i].m_jointFeedback->m_reactionForces.m_bottomVec = m_links[i].m_cachedWorldTransform.m_basis * angularBotVec; + m_links[i].m_jointFeedback->m_reactionForces.m_topVec = m_links[i].m_cachedWorldTransform.m_basis * linearTopVec; } } else @@ -2168,7 +2168,7 @@ void btMultiBody::forwardKinematics(btAlignedObjectArray &world_to btScalar quat[4] = {-world_to_local[index].x(), -world_to_local[index].y(), -world_to_local[index].z(), world_to_local[index].w()}; btTransform tr; tr.setIdentity(); - tr.setOrigin(posr); + tr.m_origin = (posr); tr.setRotation(btQuaternion(quat[0], quat[1], quat[2], quat[3])); getLink(link).m_cachedWorldTransform = tr; } @@ -2189,7 +2189,7 @@ void btMultiBody::updateCollisionObjectWorldTransforms(btAlignedObjectArraysetWorldTransform(tr); @@ -2218,7 +2218,7 @@ void btMultiBody::updateCollisionObjectWorldTransforms(btAlignedObjectArraysetWorldTransform(tr); @@ -2249,7 +2249,7 @@ void btMultiBody::updateCollisionObjectInterpolationWorldTransforms(btAlignedObj btScalar quat[4] = {-world_to_local[0].x(), -world_to_local[0].y(), -world_to_local[0].z(), world_to_local[0].w()}; btTransform tr; tr.setIdentity(); - tr.setOrigin(posr); + tr.m_origin = (posr); tr.setRotation(btQuaternion(quat[0], quat[1], quat[2], quat[3])); getBaseCollider()->setInterpolationWorldTransform(tr); @@ -2277,7 +2277,7 @@ void btMultiBody::updateCollisionObjectInterpolationWorldTransforms(btAlignedObj btScalar quat[4] = {-world_to_local[index].x(), -world_to_local[index].y(), -world_to_local[index].z(), world_to_local[index].w()}; btTransform tr; tr.setIdentity(); - tr.setOrigin(posr); + tr.m_origin = (posr); tr.setRotation(btQuaternion(quat[0], quat[1], quat[2], quat[3])); col->setInterpolationWorldTransform(tr); diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBody.h b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBody.h index 345970d261..e506ff71bb 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBody.h +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBody.h @@ -221,28 +221,28 @@ btMultiBody void setBaseWorldTransform(const btTransform &tr) { - setBasePos(tr.getOrigin()); + setBasePos(tr.m_origin); setWorldToBaseRot(tr.getRotation().inverse()); } btTransform getBaseWorldTransform() const { btTransform tr; - tr.setOrigin(getBasePos()); + tr.m_origin = (getBasePos()); tr.setRotation(getWorldToBaseRot().inverse()); return tr; } void setInterpolateBaseWorldTransform(const btTransform &tr) { - setInterpolateBasePos(tr.getOrigin()); + setInterpolateBasePos(tr.m_origin); setInterpolateWorldToBaseRot(tr.getRotation().inverse()); } btTransform getInterpolateBaseWorldTransform() const { btTransform tr; - tr.setOrigin(getInterpolateBasePos()); + tr.m_origin = (getInterpolateBasePos()); tr.setRotation(getInterpolateWorldToBaseRot().inverse()); return tr; } diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyConstraint.cpp index 00d5fd5609..cdfb288eea 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyConstraint.cpp @@ -80,9 +80,9 @@ btScalar btMultiBodyConstraint::fillMultiBodyConstraint(btMultiBodySolverConstra btVector3 rel_pos1, rel_pos2; //these two used to be inited to posAworld and posBworld (respectively) but it does not seem necessary if (bodyA) - rel_pos1 = posAworld - bodyA->getWorldTransform().getOrigin(); + rel_pos1 = posAworld - bodyA->getWorldTransform().m_origin; if (bodyB) - rel_pos2 = posBworld - bodyB->getWorldTransform().getOrigin(); + rel_pos2 = posBworld - bodyB->getWorldTransform().m_origin; if (multiBodyA) { @@ -92,7 +92,7 @@ btScalar btMultiBodyConstraint::fillMultiBodyConstraint(btMultiBodySolverConstra } else { - rel_pos1 = posAworld - multiBodyA->getLink(solverConstraint.m_linkA).m_cachedWorldTransform.getOrigin(); + rel_pos1 = posAworld - multiBodyA->getLink(solverConstraint.m_linkA).m_cachedWorldTransform.m_origin; } const int ndofA = multiBodyA->getNumDofs() + 6; @@ -171,7 +171,7 @@ btScalar btMultiBodyConstraint::fillMultiBodyConstraint(btMultiBodySolverConstra } else { - rel_pos2 = posBworld - multiBodyB->getLink(solverConstraint.m_linkB).m_cachedWorldTransform.getOrigin(); + rel_pos2 = posBworld - multiBodyB->getLink(solverConstraint.m_linkB).m_cachedWorldTransform.m_origin; } const int ndofB = multiBodyB->getNumDofs() + 6; diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp index 2788367431..3958776ab7 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp @@ -517,9 +517,9 @@ void btMultiBodyConstraintSolver::setupMultiBodyContactConstraint(btMultiBodySol btRigidBody* rb1 = multiBodyB ? 0 : bodyB->m_originalBody; if (bodyA) - rel_pos1 = pos1 - bodyA->getWorldTransform().getOrigin(); + rel_pos1 = pos1 - bodyA->getWorldTransform().m_origin; if (bodyB) - rel_pos2 = pos2 - bodyB->getWorldTransform().getOrigin(); + rel_pos2 = pos2 - bodyB->getWorldTransform().m_origin; relaxation = infoGlobal.m_sor; @@ -572,7 +572,7 @@ void btMultiBodyConstraintSolver::setupMultiBodyContactConstraint(btMultiBodySol } else { - rel_pos1 = pos1 - multiBodyA->getLink(solverConstraint.m_linkA).m_cachedWorldTransform.getOrigin(); + rel_pos1 = pos1 - multiBodyA->getLink(solverConstraint.m_linkA).m_cachedWorldTransform.m_origin; } const int ndofA = multiBodyA->getNumDofs() + 6; @@ -619,7 +619,7 @@ void btMultiBodyConstraintSolver::setupMultiBodyContactConstraint(btMultiBodySol } else { - rel_pos2 = pos2 - multiBodyB->getLink(solverConstraint.m_linkB).m_cachedWorldTransform.getOrigin(); + rel_pos2 = pos2 - multiBodyB->getLink(solverConstraint.m_linkB).m_cachedWorldTransform.m_origin; } const int ndofB = multiBodyB->getNumDofs() + 6; @@ -910,9 +910,9 @@ void btMultiBodyConstraintSolver::setupMultiBodyTorsionalFrictionConstraint(btMu btRigidBody* rb1 = multiBodyB ? 0 : bodyB->m_originalBody; if (bodyA) - rel_pos1 = pos1 - bodyA->getWorldTransform().getOrigin(); + rel_pos1 = pos1 - bodyA->getWorldTransform().m_origin; if (bodyB) - rel_pos2 = pos2 - bodyB->getWorldTransform().getOrigin(); + rel_pos2 = pos2 - bodyB->getWorldTransform().m_origin; relaxation = infoGlobal.m_sor; @@ -926,7 +926,7 @@ void btMultiBodyConstraintSolver::setupMultiBodyTorsionalFrictionConstraint(btMu } else { - rel_pos1 = pos1 - multiBodyA->getLink(solverConstraint.m_linkA).m_cachedWorldTransform.getOrigin(); + rel_pos1 = pos1 - multiBodyA->getLink(solverConstraint.m_linkA).m_cachedWorldTransform.m_origin; } const int ndofA = multiBodyA->getNumDofs() + 6; @@ -973,7 +973,7 @@ void btMultiBodyConstraintSolver::setupMultiBodyTorsionalFrictionConstraint(btMu } else { - rel_pos2 = pos2 - multiBodyB->getLink(solverConstraint.m_linkB).m_cachedWorldTransform.getOrigin(); + rel_pos2 = pos2 - multiBodyB->getLink(solverConstraint.m_linkB).m_cachedWorldTransform.m_origin; } const int ndofB = multiBodyB->getNumDofs() + 6; diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp index e7af332eb3..1a34b5ab81 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp @@ -724,8 +724,8 @@ void btMultiBodyDynamicsWorld::debugDrawWorld() btVector3 vec = quatRotate(tr.getRotation(), bod->getLink(m).m_axes[0].m_topVec) * 0.1; btVector4 color(0, 0, 0, 1); //1,1,1); - btVector3 from = vec + tr.getOrigin() - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); - btVector3 to = tr.getOrigin() - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); + btVector3 from = vec + tr.m_origin - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); + btVector3 to = tr.m_origin - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); getDebugDrawer()->drawLine(from, to, color); } if (bod->getLink(m).m_jointType == btMultibodyLink::eFixed) @@ -733,8 +733,8 @@ void btMultiBodyDynamicsWorld::debugDrawWorld() btVector3 vec = quatRotate(tr.getRotation(), bod->getLink(m).m_axes[0].m_bottomVec) * 0.1; btVector4 color(0, 0, 0, 1); //1,1,1); - btVector3 from = vec + tr.getOrigin() - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); - btVector3 to = tr.getOrigin() - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); + btVector3 from = vec + tr.m_origin - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); + btVector3 to = tr.m_origin - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); getDebugDrawer()->drawLine(from, to, color); } if (bod->getLink(m).m_jointType == btMultibodyLink::ePrismatic) @@ -742,8 +742,8 @@ void btMultiBodyDynamicsWorld::debugDrawWorld() btVector3 vec = quatRotate(tr.getRotation(), bod->getLink(m).m_axes[0].m_bottomVec) * 0.1; btVector4 color(0, 0, 0, 1); //1,1,1); - btVector3 from = vec + tr.getOrigin() - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); - btVector3 to = tr.getOrigin() - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); + btVector3 from = vec + tr.m_origin - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); + btVector3 to = tr.m_origin - quatRotate(tr.getRotation(), bod->getLink(m).m_dVector); getDebugDrawer()->drawLine(from, to, color); } } diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp index df2abbe97a..d872656137 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp @@ -190,26 +190,26 @@ void btMultiBodyFixedConstraint::debugDraw(class btIDebugDraw* drawer) if (m_rigidBodyA) { btVector3 pivot = m_rigidBodyA->getCenterOfMassTransform() * m_pivotInA; - tr.setOrigin(pivot); + tr.m_origin = (pivot); drawer->drawTransform(tr, 0.1); } if (m_bodyA) { btVector3 pivotAworld = m_bodyA->localPosToWorld(m_linkA, m_pivotInA); - tr.setOrigin(pivotAworld); + tr.m_origin = (pivotAworld); drawer->drawTransform(tr, 0.1); } if (m_rigidBodyB) { // that ideally should draw the same frame btVector3 pivot = m_rigidBodyB->getCenterOfMassTransform() * m_pivotInB; - tr.setOrigin(pivot); + tr.m_origin = (pivot); drawer->drawTransform(tr, 0.1); } if (m_bodyB) { btVector3 pivotBworld = m_bodyB->localPosToWorld(m_linkB, m_pivotInB); - tr.setOrigin(pivotBworld); + tr.m_origin = (pivotBworld); drawer->drawTransform(tr, 0.1); } } diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyPoint2Point.cpp b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyPoint2Point.cpp index f51e69deb1..cc598066a0 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyPoint2Point.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodyPoint2Point.cpp @@ -191,26 +191,26 @@ void btMultiBodyPoint2Point::debugDraw(class btIDebugDraw* drawer) if (m_rigidBodyA) { btVector3 pivot = m_rigidBodyA->getCenterOfMassTransform() * m_pivotInA; - tr.setOrigin(pivot); + tr.m_origin = (pivot); drawer->drawTransform(tr, 0.1); } if (m_bodyA) { btVector3 pivotAworld = m_bodyA->localPosToWorld(m_linkA, m_pivotInA); - tr.setOrigin(pivotAworld); + tr.m_origin = (pivotAworld); drawer->drawTransform(tr, 0.1); } if (m_rigidBodyB) { // that ideally should draw the same frame btVector3 pivot = m_rigidBodyB->getCenterOfMassTransform() * m_pivotInB; - tr.setOrigin(pivot); + tr.m_origin = (pivot); drawer->drawTransform(tr, 0.1); } if (m_bodyB) { btVector3 pivotBworld = m_bodyB->localPosToWorld(m_linkB, m_pivotInB); - tr.setOrigin(pivotBworld); + tr.m_origin = (pivotBworld); drawer->drawTransform(tr, 0.1); } } diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodySliderConstraint.cpp b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodySliderConstraint.cpp index 48ec1d5af2..225e584f7a 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodySliderConstraint.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodySliderConstraint.cpp @@ -209,26 +209,26 @@ void btMultiBodySliderConstraint::debugDraw(class btIDebugDraw* drawer) if (m_rigidBodyA) { btVector3 pivot = m_rigidBodyA->getCenterOfMassTransform() * m_pivotInA; - tr.setOrigin(pivot); + tr.m_origin = (pivot); drawer->drawTransform(tr, 0.1); } if (m_bodyA) { btVector3 pivotAworld = m_bodyA->localPosToWorld(m_linkA, m_pivotInA); - tr.setOrigin(pivotAworld); + tr.m_origin = (pivotAworld); drawer->drawTransform(tr, 0.1); } if (m_rigidBodyB) { // that ideally should draw the same frame btVector3 pivot = m_rigidBodyB->getCenterOfMassTransform() * m_pivotInB; - tr.setOrigin(pivot); + tr.m_origin = (pivot); drawer->drawTransform(tr, 0.1); } if (m_bodyB) { btVector3 pivotBworld = m_bodyB->localPosToWorld(m_linkB, m_pivotInB); - tr.setOrigin(pivotBworld); + tr.m_origin = (pivotBworld); drawer->drawTransform(tr, 0.1); } } diff --git a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodySphericalJointLimit.cpp b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodySphericalJointLimit.cpp index 27c7520dc3..7976ffc5c4 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodySphericalJointLimit.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Featherstone/btMultiBodySphericalJointLimit.cpp @@ -264,7 +264,7 @@ void btMultiBodySphericalJointLimit::debugDraw(class btIDebugDraw* drawer) if (m_bodyB) { btVector3 pivotBworld = m_bodyB->localPosToWorld(m_linkB, m_pivotB); - tr.setOrigin(pivotBworld); + tr.m_origin = (pivotBworld); drawer->drawTransform(tr, 0.1); } } diff --git a/3rdparty/bullet3/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp b/3rdparty/bullet3/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp index cbb41ece22..95c7f26b6a 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp +++ b/3rdparty/bullet3/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp @@ -122,8 +122,8 @@ void btRaycastVehicle::updateWheelTransform(int wheelIndex, bool interpolatedTra basis2[1][m_indexForwardAxis] = fwd[1]; basis2[2][m_indexForwardAxis] = fwd[2]; - wheel.m_worldTransform.setBasis(steeringMat * rotatingMat * basis2); - wheel.m_worldTransform.setOrigin( + wheel.m_worldTransform.m_basis = (steeringMat * rotatingMat * basis2); + wheel.m_worldTransform.m_origin = ( wheel.m_raycastInfo.m_hardPointWS + wheel.m_raycastInfo.m_wheelDirectionWS * wheel.m_raycastInfo.m_suspensionLength); } @@ -153,8 +153,8 @@ void btRaycastVehicle::updateWheelTransformsWS(btWheelInfo& wheel, bool interpol } wheel.m_raycastInfo.m_hardPointWS = chassisTrans(wheel.m_chassisConnectionPointCS); - wheel.m_raycastInfo.m_wheelDirectionWS = chassisTrans.getBasis() * wheel.m_wheelDirectionCS; - wheel.m_raycastInfo.m_wheelAxleWS = chassisTrans.getBasis() * wheel.m_wheelAxleCS; + wheel.m_raycastInfo.m_wheelDirectionWS = chassisTrans.m_basis * wheel.m_wheelDirectionCS; + wheel.m_raycastInfo.m_wheelAxleWS = chassisTrans.m_basis * wheel.m_wheelAxleCS; } btScalar btRaycastVehicle::rayCast(btWheelInfo& wheel) @@ -267,9 +267,9 @@ void btRaycastVehicle::updateVehicle(btScalar step) const btTransform& chassisTrans = getChassisWorldTransform(); btVector3 forwardW( - chassisTrans.getBasis()[0][m_indexForwardAxis], - chassisTrans.getBasis()[1][m_indexForwardAxis], - chassisTrans.getBasis()[2][m_indexForwardAxis]); + chassisTrans.m_basis[0][m_indexForwardAxis], + chassisTrans.m_basis[1][m_indexForwardAxis], + chassisTrans.m_basis[2][m_indexForwardAxis]); if (forwardW.dot(getRigidBody()->getLinearVelocity()) < btScalar(0.)) { @@ -320,9 +320,9 @@ void btRaycastVehicle::updateVehicle(btScalar step) const btTransform& chassisWorldTransform = getChassisWorldTransform(); btVector3 fwd( - chassisWorldTransform.getBasis()[0][m_indexForwardAxis], - chassisWorldTransform.getBasis()[1][m_indexForwardAxis], - chassisWorldTransform.getBasis()[2][m_indexForwardAxis]); + chassisWorldTransform.m_basis[0][m_indexForwardAxis], + chassisWorldTransform.m_basis[1][m_indexForwardAxis], + chassisWorldTransform.m_basis[2][m_indexForwardAxis]); btScalar proj = fwd.dot(wheel.m_raycastInfo.m_contactNormalWS); fwd -= wheel.m_raycastInfo.m_contactNormalWS * proj; @@ -521,7 +521,7 @@ void btRaycastVehicle::updateFriction(btScalar timeStep) { const btTransform& wheelTrans = getWheelTransformWS(i); - btMatrix3x3 wheelBasis0 = wheelTrans.getBasis(); + btMatrix3x3 wheelBasis0 = wheelTrans.m_basis; m_axle[i] = -btVector3( wheelBasis0[0][m_indexRightAxis], wheelBasis0[1][m_indexRightAxis], @@ -643,7 +643,7 @@ void btRaycastVehicle::updateFriction(btScalar timeStep) btVector3 sideImp = m_axle[wheel] * m_sideImpulse[wheel]; #if defined ROLLING_INFLUENCE_FIX // fix. It only worked if car's up was along Y - VT. - btVector3 vChassisWorldUp = getRigidBody()->getCenterOfMassTransform().getBasis().getColumn(m_indexUpAxis); + btVector3 vChassisWorldUp = getRigidBody()->getCenterOfMassTransform().m_basis.getColumn(m_indexUpAxis); rel_pos -= vChassisWorldUp * (vChassisWorldUp.dot(rel_pos) * (1.f - wheelInfo.m_rollInfluence)); #else rel_pos[m_indexUpAxis] *= wheelInfo.m_rollInfluence; @@ -671,12 +671,12 @@ void btRaycastVehicle::debugDraw(btIDebugDraw* debugDrawer) wheelColor.setValue(1, 0, 1); } - btVector3 wheelPosWS = getWheelInfo(v).m_worldTransform.getOrigin(); + btVector3 wheelPosWS = getWheelInfo(v).m_worldTransform.m_origin; btVector3 axle = btVector3( - getWheelInfo(v).m_worldTransform.getBasis()[0][getRightAxis()], - getWheelInfo(v).m_worldTransform.getBasis()[1][getRightAxis()], - getWheelInfo(v).m_worldTransform.getBasis()[2][getRightAxis()]); + getWheelInfo(v).m_worldTransform.m_basis[0][getRightAxis()], + getWheelInfo(v).m_worldTransform.m_basis[1][getRightAxis()], + getWheelInfo(v).m_worldTransform.m_basis[2][getRightAxis()]); //debug wheels (cylinders) debugDrawer->drawLine(wheelPosWS, wheelPosWS + axle, wheelColor); diff --git a/3rdparty/bullet3/src/BulletDynamics/Vehicle/btRaycastVehicle.h b/3rdparty/bullet3/src/BulletDynamics/Vehicle/btRaycastVehicle.h index b4a92b0a91..9956117f60 100644 --- a/3rdparty/bullet3/src/BulletDynamics/Vehicle/btRaycastVehicle.h +++ b/3rdparty/bullet3/src/BulletDynamics/Vehicle/btRaycastVehicle.h @@ -160,9 +160,9 @@ class btRaycastVehicle : public btActionInterface const btTransform& chassisTrans = getChassisWorldTransform(); btVector3 forwardW( - chassisTrans.getBasis()[0][m_indexForwardAxis], - chassisTrans.getBasis()[1][m_indexForwardAxis], - chassisTrans.getBasis()[2][m_indexForwardAxis]); + chassisTrans.m_basis[0][m_indexForwardAxis], + chassisTrans.m_basis[1][m_indexForwardAxis], + chassisTrans.m_basis[2][m_indexForwardAxis]); return forwardW; } diff --git a/3rdparty/bullet3/src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBody.cpp b/3rdparty/bullet3/src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBody.cpp index feb30d5879..3e068b405c 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBody.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableBody.cpp @@ -85,7 +85,7 @@ void btReducedDeformableBody::setInertiaProps() // m_nodes[i].m_x -= m_initialCoM; // } // m_initialCoM.setZero(); - m_rigidTransformWorld.setOrigin(m_initialCoM); + m_rigidTransformWorld.m_origin = (m_initialCoM); m_interpolationWorldTransform = m_rigidTransformWorld; updateLocalInertiaTensorFromNodes(); @@ -258,8 +258,8 @@ void btReducedDeformableBody::updateReducedDofs(btScalar solverdt) void btReducedDeformableBody::mapToFullPosition(const btTransform& ref_trans) { - btVector3 origin = ref_trans.getOrigin(); - btMatrix3x3 rotation = ref_trans.getBasis(); + btVector3 origin = ref_trans.m_origin; + btMatrix3x3 rotation = ref_trans.m_basis; for (int i = 0; i < m_nFull; ++i) @@ -291,7 +291,7 @@ void btReducedDeformableBody::mapToFullVelocity(const btTransform& ref_trans) // m_angularVelocityFromReduced.setZero(); // for (int i = 0; i < m_nFull; ++i) // { - // btVector3 r_com = ref_trans.getBasis() * m_localMomentArm[i]; + // btVector3 r_com = ref_trans.m_basis * m_localMomentArm[i]; // btMatrix3x3 r_star = Cross(r_com); // btVector3 v_from_reduced(0, 0, 0); @@ -304,7 +304,7 @@ void btReducedDeformableBody::mapToFullVelocity(const btTransform& ref_trans) // } // btVector3 delta_linear = m_nodalMass[i] * v_from_reduced; - // btVector3 delta_angular = m_nodalMass[i] * (r_star * ref_trans.getBasis() * v_from_reduced); + // btVector3 delta_angular = m_nodalMass[i] * (r_star * ref_trans.m_basis * v_from_reduced); // sum_linear += delta_linear; // sum_angular += delta_angular; // // std::cout << "delta_linear: " << delta_linear[0] << "\t" << delta_linear[1] << "\t" << delta_linear[2] << "\n"; @@ -312,7 +312,7 @@ void btReducedDeformableBody::mapToFullVelocity(const btTransform& ref_trans) // // std::cout << "sum_linear: " << sum_linear[0] << "\t" << sum_linear[1] << "\t" << sum_linear[2] << "\n"; // // std::cout << "sum_angular: " << sum_angular[0] << "\t" << sum_angular[1] << "\t" << sum_angular[2] << "\n"; // } - // m_linearVelocityFromReduced = 1.0 / m_mass * (ref_trans.getBasis() * sum_linear); + // m_linearVelocityFromReduced = 1.0 / m_mass * (ref_trans.m_basis * sum_linear); // m_angularVelocityFromReduced = m_interpolateInvInertiaTensorWorld * sum_angular; // m_linearVelocity -= m_linearVelocityFromReduced; @@ -332,7 +332,7 @@ const btVector3 btReducedDeformableBody::computeTotalAngularMomentum() const for (int i = 0; i < m_nFull; ++i) { - btVector3 r_com = m_rigidTransformWorld.getBasis() * m_localMomentArm[i]; + btVector3 r_com = m_rigidTransformWorld.m_basis * m_localMomentArm[i]; btMatrix3x3 r_star = Cross(r_com); btVector3 v_from_reduced(0, 0, 0); @@ -344,8 +344,8 @@ const btVector3 btReducedDeformableBody::computeTotalAngularMomentum() const } } - L_reduced += m_nodalMass[i] * (r_star * (m_rigidTransformWorld.getBasis() * v_from_reduced - omega_prime_star * r_com)); - // L_reduced += m_nodalMass[i] * (r_star * (m_rigidTransformWorld.getBasis() * v_from_reduced)); + L_reduced += m_nodalMass[i] * (r_star * (m_rigidTransformWorld.m_basis * v_from_reduced - omega_prime_star * r_com)); + // L_reduced += m_nodalMass[i] * (r_star * (m_rigidTransformWorld.m_basis * v_from_reduced)); } return L_rigid + L_reduced; } @@ -353,7 +353,7 @@ const btVector3 btReducedDeformableBody::computeTotalAngularMomentum() const const btVector3 btReducedDeformableBody::computeNodeFullVelocity(const btTransform& ref_trans, int n_node) const { btVector3 v_from_reduced(0, 0, 0); - btVector3 r_com = ref_trans.getBasis() * m_localMomentArm[n_node]; + btVector3 r_com = ref_trans.m_basis * m_localMomentArm[n_node]; // compute velocity contributed by the reduced velocity for (int k = 0; k < 3; ++k) { @@ -364,7 +364,7 @@ const btVector3 btReducedDeformableBody::computeNodeFullVelocity(const btTransfo } // get new velocity btVector3 vel = m_angularVelocity.cross(r_com) + - ref_trans.getBasis() * v_from_reduced + + ref_trans.m_basis * v_from_reduced + m_linearVelocity; return vel; } @@ -372,7 +372,7 @@ const btVector3 btReducedDeformableBody::computeNodeFullVelocity(const btTransfo const btVector3 btReducedDeformableBody::internalComputeNodeDeltaVelocity(const btTransform& ref_trans, int n_node) const { btVector3 deltaV_from_reduced(0, 0, 0); - btVector3 r_com = ref_trans.getBasis() * m_localMomentArm[n_node]; + btVector3 r_com = ref_trans.m_basis * m_localMomentArm[n_node]; // compute velocity contributed by the reduced velocity for (int k = 0; k < 3; ++k) @@ -385,7 +385,7 @@ const btVector3 btReducedDeformableBody::internalComputeNodeDeltaVelocity(const // get delta velocity btVector3 deltaV = m_internalDeltaAngularVelocity.cross(r_com) + - ref_trans.getBasis() * deltaV_from_reduced + + ref_trans.m_basis * deltaV_from_reduced + m_internalDeltaLinearVelocity; return deltaV; } @@ -394,7 +394,7 @@ void btReducedDeformableBody::proceedToTransform(btScalar dt, bool end_of_time_s { btTransformUtil::integrateTransform(m_rigidTransformWorld, m_linearVelocity, m_angularVelocity, dt, m_interpolationWorldTransform); updateInertiaTensor(); - // m_interpolateInvInertiaTensorWorld = m_interpolationWorldTransform.getBasis().scaled(m_invInertiaLocal) * m_interpolationWorldTransform.getBasis().transpose(); + // m_interpolateInvInertiaTensorWorld = m_interpolationWorldTransform.m_basis.scaled(m_invInertiaLocal) * m_interpolationWorldTransform.m_basis.transpose(); m_rigidTransformWorld = m_interpolationWorldTransform; m_invInertiaTensorWorld = m_interpolateInvInertiaTensorWorld; } @@ -402,8 +402,8 @@ void btReducedDeformableBody::proceedToTransform(btScalar dt, bool end_of_time_s void btReducedDeformableBody::transformTo(const btTransform& trs) { btTransform current_transform = getRigidTransform(); - btTransform new_transform(trs.getBasis() * current_transform.getBasis().transpose(), - trs.getOrigin() - current_transform.getOrigin()); + btTransform new_transform(trs.m_basis * current_transform.m_basis.transpose(), + trs.m_origin - current_transform.m_origin); transform(new_transform); } @@ -417,9 +417,9 @@ void btReducedDeformableBody::transform(const btTransform& trs) ATTRIBUTE_ALIGNED16(btDbvtVolume) vol; - btVector3 CoM = m_rigidTransformWorld.getOrigin(); - btVector3 translation = trs.getOrigin(); - btMatrix3x3 rotation = trs.getBasis(); + btVector3 CoM = m_rigidTransformWorld.m_origin; + btVector3 translation = trs.m_origin; + btMatrix3x3 rotation = trs.m_basis; for (int i = 0; i < m_nodes.size(); ++i) { @@ -437,17 +437,17 @@ void btReducedDeformableBody::transform(const btTransform& trs) } // update modes - updateModesByRotation(trs.getBasis()); + updateModesByRotation(trs.m_basis); // update inertia tensor - updateInitialInertiaTensor(trs.getBasis()); + updateInitialInertiaTensor(trs.m_basis); updateInertiaTensor(); m_interpolateInvInertiaTensorWorld = m_invInertiaTensorWorld; // update rigid frame (No need to update the rotation. Nodes have already been updated.) - m_rigidTransformWorld.setOrigin(m_initialCoM + trs.getOrigin()); + m_rigidTransformWorld.m_origin = (m_initialCoM + trs.m_origin); m_interpolationWorldTransform = m_rigidTransformWorld; - m_initialCoM = m_rigidTransformWorld.getOrigin(); + m_initialCoM = m_rigidTransformWorld.m_origin; internalInitialization(); } @@ -463,7 +463,7 @@ void btReducedDeformableBody::scale(const btVector3& scl) ATTRIBUTE_ALIGNED16(btDbvtVolume) vol; - btVector3 CoM = m_rigidTransformWorld.getOrigin(); + btVector3 CoM = m_rigidTransformWorld.m_origin; for (int i = 0; i < m_nodes.size(); ++i) { @@ -584,7 +584,7 @@ void btReducedDeformableBody::updateModesByRotation(const btMatrix3x3& rotation) void btReducedDeformableBody::updateInertiaTensor() { - m_invInertiaTensorWorld = m_rigidTransformWorld.getBasis() * m_invInertiaTensorWorldInitial * m_rigidTransformWorld.getBasis().transpose(); + m_invInertiaTensorWorld = m_rigidTransformWorld.m_basis * m_invInertiaTensorWorldInitial * m_rigidTransformWorld.m_basis.transpose(); } void btReducedDeformableBody::applyDamping(btScalar timeStep) @@ -625,7 +625,7 @@ void btReducedDeformableBody::internalApplyRigidImpulse(const btVector3& impulse btVector3 btReducedDeformableBody::getRelativePos(int n_node) { - btMatrix3x3 rotation = m_interpolationWorldTransform.getBasis(); + btMatrix3x3 rotation = m_interpolationWorldTransform.m_basis; btVector3 ri = rotation * m_localMomentArm[n_node]; return ri; } @@ -633,7 +633,7 @@ btVector3 btReducedDeformableBody::getRelativePos(int n_node) btMatrix3x3 btReducedDeformableBody::getImpulseFactor(int n_node) { // relative position - btMatrix3x3 rotation = m_interpolationWorldTransform.getBasis(); + btMatrix3x3 rotation = m_interpolationWorldTransform.m_basis; btVector3 ri = rotation * m_localMomentArm[n_node]; btMatrix3x3 ri_skew = Cross(ri); @@ -721,8 +721,8 @@ void btReducedDeformableBody::internalApplyFullSpaceImpulse(const btVector3& imp void btReducedDeformableBody::applyFullSpaceNodalForce(const btVector3& f_ext, int n_node) { // f_local = R^-1 * f_ext //TODO: interpoalted transfrom - // btVector3 f_local = m_rigidTransformWorld.getBasis().transpose() * f_ext; - btVector3 f_local = m_interpolationWorldTransform.getBasis().transpose() * f_ext; + // btVector3 f_local = m_rigidTransformWorld.m_basis.transpose() * f_ext; + btVector3 f_local = m_interpolationWorldTransform.m_basis.transpose() * f_ext; // f_ext_r = [S^T * P]_{n_node} * f_local tDenseArray f_ext_r; @@ -789,4 +789,4 @@ void btReducedDeformableBody::disableReducedModes(const bool rigid_only) bool btReducedDeformableBody::isReducedModesOFF() const { return m_rigidOnly; -} \ No newline at end of file +} diff --git a/3rdparty/bullet3/src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableContactConstraint.cpp b/3rdparty/bullet3/src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableContactConstraint.cpp index 3c78d2d225..d53c37a283 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableContactConstraint.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/BulletReducedDeformableBody/btReducedDeformableContactConstraint.cpp @@ -345,7 +345,7 @@ btReducedDeformableNodeRigidContactConstraint::btReducedDeformableNodeRigidConta { m_relPosA = btVector3(0,0,0); } - m_relPosB = m_node->m_x - m_rsb->getRigidTransform().getOrigin(); + m_relPosB = m_node->m_x - m_rsb->getRigidTransform().m_origin; if (m_collideStatic) // colliding with static object, only consider reduced deformable body's impulse factor { @@ -576,4 +576,4 @@ btVector3 btReducedDeformableFaceRigidContactConstraint::getDv(const btSoftBody: void btReducedDeformableFaceRigidContactConstraint::applyImpulse(const btVector3& impulse) { // -} \ No newline at end of file +} diff --git a/3rdparty/bullet3/src/BulletSoftBody/btDeformableBodySolver.cpp b/3rdparty/bullet3/src/BulletSoftBody/btDeformableBodySolver.cpp index 4e9df5f83e..aafcdd425c 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btDeformableBodySolver.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/btDeformableBodySolver.cpp @@ -557,7 +557,7 @@ void btDeformableBodySolver::applyTransforms(btScalar timeStep) shp, nrm, 0); - a.m_cti.m_normal = wtr.getBasis() * nrm; + a.m_cti.m_normal = wtr.m_basis * nrm; btVector3 normal = a.m_cti.m_normal; btVector3 t1 = generateUnitOrthogonalVector(normal); btVector3 t2 = btCross(normal, t1); @@ -590,4 +590,4 @@ void btDeformableBodySolver::applyTransforms(btScalar timeStep) } psb->interpolateRenderMesh(); } -} \ No newline at end of file +} diff --git a/3rdparty/bullet3/src/BulletSoftBody/btDeformableContactProjection.cpp b/3rdparty/bullet3/src/BulletSoftBody/btDeformableContactProjection.cpp index 7f67260ce6..2b16e2225e 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btDeformableContactProjection.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/btDeformableContactProjection.cpp @@ -117,7 +117,7 @@ void btDeformableContactProjection::setConstraints(const btContactSolverInfo& in { continue; } - anchor.m_c1 = anchor.m_cti.m_colObj->getWorldTransform().getBasis() * anchor.m_local; + anchor.m_c1 = anchor.m_cti.m_colObj->getWorldTransform().m_basis * anchor.m_local; btDeformableNodeAnchorConstraint constraint(anchor, infoGlobal); m_nodeAnchorConstraints[i].push_back(constraint); } diff --git a/3rdparty/bullet3/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.h b/3rdparty/bullet3/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.h index 5971ecd9a9..3baa5b77a0 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.h +++ b/3rdparty/bullet3/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.h @@ -193,9 +193,9 @@ class btDeformableMultiBodyDynamicsWorld : public btMultiBodyDynamicsWorld m_resultCallback(resultCallback) { m_rayFromTrans.setIdentity(); - m_rayFromTrans.setOrigin(m_rayFromWorld); + m_rayFromTrans.m_origin = (m_rayFromWorld); m_rayToTrans.setIdentity(); - m_rayToTrans.setOrigin(m_rayToWorld); + m_rayToTrans.m_origin = (m_rayToWorld); btVector3 rayDir = (rayToWorld - rayFromWorld); @@ -278,7 +278,7 @@ class btDeformableMultiBodyDynamicsWorld : public btMultiBodyDynamicsWorld if (softBody) { btSoftBody::sRayCast softResult; - if (softBody->rayFaceTest(rayFromTrans.getOrigin(), rayToTrans.getOrigin(), softResult)) + if (softBody->rayFaceTest(rayFromTrans.m_origin, rayToTrans.m_origin, softResult)) { if (softResult.fraction <= resultCallback.m_closestHitFraction) { @@ -286,7 +286,7 @@ class btDeformableMultiBodyDynamicsWorld : public btMultiBodyDynamicsWorld shapeInfo.m_shapePart = 0; shapeInfo.m_triangleIndex = softResult.index; // get the normal - btVector3 rayDir = rayToTrans.getOrigin() - rayFromTrans.getOrigin(); + btVector3 rayDir = rayToTrans.m_origin - rayFromTrans.m_origin; btVector3 normal = -rayDir; normal.normalize(); { diff --git a/3rdparty/bullet3/src/BulletSoftBody/btSoftBody.cpp b/3rdparty/bullet3/src/BulletSoftBody/btSoftBody.cpp index c873099b49..f2492e8ce8 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btSoftBody.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/btSoftBody.cpp @@ -545,7 +545,7 @@ void btSoftBody::appendDeformableAnchor(int node, btRigidBody* body) 0); c.m_cti.m_colObj = body; - c.m_cti.m_normal = wtr.getBasis() * nrm; + c.m_cti.m_normal = wtr.m_basis * nrm; c.m_cti.m_offset = dst; c.m_node = &m_nodes[node]; const btScalar fc = m_cfg.kDF * body->getFriction(); @@ -554,7 +554,7 @@ void btSoftBody::appendDeformableAnchor(int node, btRigidBody* body) c.m_c4 = body->isStaticOrKinematicObject() ? m_cfg.kKHR : m_cfg.kCHR; static const btMatrix3x3 iwiStatic(0, 0, 0, 0, 0, 0, 0, 0, 0); const btMatrix3x3& iwi = body->getInvInertiaTensorWorld(); - const btVector3 ra = n.m_x - wtr.getOrigin(); + const btVector3 ra = n.m_x - wtr.m_origin; c.m_c0 = ImpulseMatrix(1, ima, imb, iwi, ra); c.m_c1 = ra; @@ -596,7 +596,7 @@ void btSoftBody::appendDeformableAnchor(int node, btMultiBodyLinkCollider* link) nrm, 0); c.m_cti.m_colObj = link; - c.m_cti.m_normal = wtr.getBasis() * nrm; + c.m_cti.m_normal = wtr.m_basis * nrm; c.m_cti.m_offset = dst; c.m_node = &m_nodes[node]; const btScalar fc = m_cfg.kDF * link->getFriction(); @@ -630,7 +630,7 @@ void btSoftBody::appendDeformableAnchor(int node, btMultiBodyLinkCollider* link) c.jacobianData_t2 = jacobianData_t2; c.t1 = t1; c.t2 = t2; - const btVector3 ra = n.m_x - wtr.getOrigin(); + const btVector3 ra = n.m_x - wtr.m_origin; c.m_c1 = ra; c.m_local = link->getWorldTransform().inverse() * m_nodes[node].m_x; c.m_node->m_battach = 1; @@ -668,8 +668,8 @@ void btSoftBody::appendAngularJoint(const AJoint::Specs& specs, Cluster* body0, AJoint* pj = new (btAlignedAlloc(sizeof(AJoint), 16)) AJoint(); pj->m_bodies[0] = body0; pj->m_bodies[1] = body1; - pj->m_refs[0] = pj->m_bodies[0].xform().inverse().getBasis() * specs.axis; - pj->m_refs[1] = pj->m_bodies[1].xform().inverse().getBasis() * specs.axis; + pj->m_refs[0] = pj->m_bodies[0].xform().inverse().m_basis * specs.axis; + pj->m_refs[1] = pj->m_bodies[1].xform().inverse().m_basis * specs.axis; pj->m_cfm = specs.cfm; pj->m_erp = specs.erp; pj->m_split = specs.split; @@ -1084,8 +1084,8 @@ btTransform btSoftBody::getRigidTransform() btMatrix3x3 R = V * U.transpose(); btTransform trs; trs.setIdentity(); - trs.setOrigin(t); - trs.setBasis(R); + trs.m_origin = (t); + trs.m_basis = (R); return trs; } @@ -1111,7 +1111,7 @@ void btSoftBody::transform(const btTransform& trs) Node& n = m_nodes[i]; n.m_x = trs * n.m_x; n.m_q = trs * n.m_q; - n.m_n = trs.getBasis() * n.m_n; + n.m_n = trs.m_basis * n.m_n; vol = btDbvtVolume::FromCR(n.m_x, margin); m_ndbvt.update(n.m_leaf, vol); @@ -1126,7 +1126,7 @@ void btSoftBody::translate(const btVector3& trs) { btTransform t; t.setIdentity(); - t.setOrigin(trs); + t.m_origin = (trs); transform(t); } @@ -2223,7 +2223,7 @@ void btSoftBody::solveConstraints() for (i = 0, ni = m_anchors.size(); i < ni; ++i) { Anchor& a = m_anchors[i]; - const btVector3 ra = a.m_body->getWorldTransform().getBasis() * a.m_local; + const btVector3 ra = a.m_body->getWorldTransform().m_basis * a.m_local; a.m_c0 = ImpulseMatrix(m_sst.sdt, a.m_node->m_im, a.m_body->getInvMass(), @@ -2766,7 +2766,7 @@ bool btSoftBody::checkContact(const btCollisionObjectWrapper* colObjWrap, if (dst < 0) { cti.m_colObj = colObjWrap->getCollisionObject(); - cti.m_normal = wtr.getBasis() * nrm; + cti.m_normal = wtr.m_basis * nrm; cti.m_offset = -btDot(cti.m_normal, x - cti.m_normal * dst); return (true); } @@ -2796,7 +2796,7 @@ bool btSoftBody::checkDeformableContact(const btCollisionObjectWrapper* colObjWr if (!predict) { cti.m_colObj = colObjWrap->getCollisionObject(); - cti.m_normal = wtr.getBasis() * nrm; + cti.m_normal = wtr.m_basis * nrm; cti.m_offset = dst; } if (dst < 0) @@ -2879,7 +2879,7 @@ bool btSoftBody::checkDeformableFaceContact(const btCollisionObjectWrapper* colO if (!predict) { cti.m_colObj = colObjWrap->getCollisionObject(); - cti.m_normal = wtr.getBasis() * nrm; + cti.m_normal = wtr.m_basis * nrm; cti.m_offset = dst; } } @@ -2890,7 +2890,7 @@ bool btSoftBody::checkDeformableFaceContact(const btCollisionObjectWrapper* colO // collision detection using x* btTransform triangle_transform; triangle_transform.setIdentity(); - triangle_transform.setOrigin(f.m_n[0]->m_q); + triangle_transform.m_origin = (f.m_n[0]->m_q); btTriangleShape triangle(btVector3(0, 0, 0), f.m_n[1]->m_q - f.m_n[0]->m_q, f.m_n[2]->m_q - f.m_n[0]->m_q); btVector3 guess(0, 0, 0); const btConvexShape* csh = static_cast(shp); @@ -2917,7 +2917,7 @@ bool btSoftBody::checkDeformableFaceContact(const btCollisionObjectWrapper* colO //point-convex CD wtr = colObjWrap->getWorldTransform(); btTriangleShape triangle2(btVector3(0, 0, 0), f.m_n[1]->m_x - f.m_n[0]->m_x, f.m_n[2]->m_x - f.m_n[0]->m_x); - triangle_transform.setOrigin(f.m_n[0]->m_x); + triangle_transform.m_origin = (f.m_n[0]->m_x); btGjkEpaSolver2::SignedDistance(&triangle2, triangle_transform, csh, wtr, guess, results); dst = results.distance - csh->getMargin() - margin; @@ -2928,7 +2928,7 @@ bool btSoftBody::checkDeformableFaceContact(const btCollisionObjectWrapper* colO // Use triangle-convex CD. wtr = colObjWrap->getWorldTransform(); btTriangleShape triangle2(btVector3(0, 0, 0), f.m_n[1]->m_x - f.m_n[0]->m_x, f.m_n[2]->m_x - f.m_n[0]->m_x); - triangle_transform.setOrigin(f.m_n[0]->m_x); + triangle_transform.m_origin = (f.m_n[0]->m_x); btGjkEpaSolver2::SignedDistance(&triangle2, triangle_transform, csh, wtr, guess, results); contact_point = results.witnesses[0]; getBarycentric(contact_point, f.m_n[0]->m_x, f.m_n[1]->m_x, f.m_n[2]->m_x, bary); @@ -3222,7 +3222,7 @@ void btSoftBody::initializeClusters() /* Frame */ c.m_framexform.setIdentity(); - c.m_framexform.setOrigin(c.m_com); + c.m_framexform.m_origin = (c.m_com); c.m_framerefs.resize(c.m_nodes.size()); { int i; @@ -3264,11 +3264,11 @@ void btSoftBody::updateClusters() m[2] += a[2] * b; } PolarDecompose(m, r, s); - c.m_framexform.setOrigin(c.m_com); - c.m_framexform.setBasis(r); + c.m_framexform.m_origin = (c.m_com); + c.m_framexform.m_basis = (r); /* Inertia */ #if 1 /* Constant */ - c.m_invwi = c.m_framexform.getBasis() * c.m_locii * c.m_framexform.getBasis().transpose(); + c.m_invwi = c.m_framexform.m_basis * c.m_locii * c.m_framexform.m_basis.transpose(); #else #if 0 /* Sphere */ const btScalar rk=(2*c.m_extents.length2())/(5*c.m_imass); @@ -3277,7 +3277,7 @@ void btSoftBody::updateClusters() btFabs(inertia[1])>SIMD_EPSILON?1/inertia[1]:0, btFabs(inertia[2])>SIMD_EPSILON?1/inertia[2]:0); - c.m_invwi=c.m_xform.getBasis().scaled(iin)*c.m_xform.getBasis().transpose(); + c.m_invwi=c.m_xform.m_basis.scaled(iin)*c.m_xform.m_basis.transpose(); #else /* Actual */ c.m_invwi[0] = c.m_invwi[1] = c.m_invwi[2] = btVector3(0, 0, 0); for (int i = 0; i < n; ++i) @@ -3591,8 +3591,8 @@ void btSoftBody::LJoint::Prepare(btScalar dt, int iterations) m_rpos[0] = m_bodies[0].xform() * m_refs[0]; m_rpos[1] = m_bodies[1].xform() * m_refs[1]; m_drift = Clamp(m_rpos[0] - m_rpos[1], maxdrift) * m_erp / dt; - m_rpos[0] -= m_bodies[0].xform().getOrigin(); - m_rpos[1] -= m_bodies[1].xform().getOrigin(); + m_rpos[0] -= m_bodies[0].xform().m_origin; + m_rpos[1] -= m_bodies[1].xform().m_origin; m_massmatrix = ImpulseMatrix(m_bodies[0].invMass(), m_bodies[0].invWorldInertia(), m_rpos[0], m_bodies[1].invMass(), m_bodies[1].invWorldInertia(), m_rpos[1]); if (m_split > 0) @@ -3632,8 +3632,8 @@ void btSoftBody::AJoint::Prepare(btScalar dt, int iterations) static const btScalar maxdrift = SIMD_PI / 16; m_icontrol->Prepare(this); Joint::Prepare(dt, iterations); - m_axis[0] = m_bodies[0].xform().getBasis() * m_refs[0]; - m_axis[1] = m_bodies[1].xform().getBasis() * m_refs[1]; + m_axis[0] = m_bodies[0].xform().m_basis * m_refs[0]; + m_axis[1] = m_bodies[1].xform().m_basis * m_refs[1]; m_drift = NormalizeAny(btCross(m_axis[1], m_axis[0])); m_drift *= btMin(maxdrift, btAcos(Clamp(btDot(m_axis[0], m_axis[1]), -1, +1))); m_drift *= m_erp / dt; @@ -4093,7 +4093,7 @@ void btSoftBody::defaultCollisionHandler(const btCollisionObjectWrapper* pcoWrap btTransform wtr = pcoWrap->getWorldTransform(); const btTransform ctr = pcoWrap->getWorldTransform(); - const btScalar timemargin = (wtr.getOrigin() - ctr.getOrigin()).length(); + const btScalar timemargin = (wtr.m_origin - ctr.m_origin).length(); const btScalar basemargin = getCollisionShape()->getMargin(); btVector3 mins; btVector3 maxs; diff --git a/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp b/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp index 383f528ee5..8d06acbc1e 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp @@ -176,7 +176,7 @@ void btSoftBodyTriangleCallback::setTimeStepAndCounters(btScalar collisionMargin btTransform softTransform; softTransform.setIdentity(); - softTransform.setOrigin(softBodyCenter); + softTransform.m_origin = (softBodyCenter); btTransform convexInTriangleSpace; convexInTriangleSpace = triBodyWrap->getWorldTransform().inverse() * softTransform; @@ -222,14 +222,14 @@ btScalar btSoftBodyConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionO //only perform CCD above a certain threshold, this prevents blocking on the long run //because object in a blocked ccd state (hitfraction<1) get their linear velocity halved each frame... - btScalar squareMot0 = (convexbody->getInterpolationWorldTransform().getOrigin() - convexbody->getWorldTransform().getOrigin()).length2(); + btScalar squareMot0 = (convexbody->getInterpolationWorldTransform().m_origin - convexbody->getWorldTransform().m_origin).length2(); if (squareMot0 < convexbody->getCcdSquareMotionThreshold()) { return btScalar(1.); } - //const btVector3& from = convexbody->m_worldTransform.getOrigin(); - //btVector3 to = convexbody->m_interpolationWorldTransform.getOrigin(); + //const btVector3& from = convexbody->m_worldTransform.m_origin; + //btVector3 to = convexbody->m_interpolationWorldTransform.m_origin; //todo: only do if the motion exceeds the 'radius' btTransform triInv = triBody->getWorldTransform().inverse(); @@ -281,10 +281,10 @@ btScalar btSoftBodyConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionO if (triBody->getCollisionShape()->isConcave()) { - btVector3 rayAabbMin = convexFromLocal.getOrigin(); - rayAabbMin.setMin(convexToLocal.getOrigin()); - btVector3 rayAabbMax = convexFromLocal.getOrigin(); - rayAabbMax.setMax(convexToLocal.getOrigin()); + btVector3 rayAabbMin = convexFromLocal.m_origin; + rayAabbMin.setMin(convexToLocal.m_origin); + btVector3 rayAabbMax = convexFromLocal.m_origin; + rayAabbMax.setMax(convexToLocal.m_origin); btScalar ccdRadius0 = convexbody->getCcdSweptSphereRadius(); rayAabbMin -= btVector3(ccdRadius0, ccdRadius0, ccdRadius0); rayAabbMax += btVector3(ccdRadius0, ccdRadius0, ccdRadius0); diff --git a/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyHelpers.cpp b/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyHelpers.cpp index fbb7298306..8fe0df8d65 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyHelpers.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyHelpers.cpp @@ -409,8 +409,8 @@ void btSoftBodyHelpers::Draw(btSoftBody* psb, const btSoftBody::LJoint* pjl = (const btSoftBody::LJoint*)pj; const btVector3 a0 = pj->m_bodies[0].xform() * pjl->m_refs[0]; const btVector3 a1 = pj->m_bodies[1].xform() * pjl->m_refs[1]; - idraw->drawLine(pj->m_bodies[0].xform().getOrigin(), a0, btVector3(1, 1, 0)); - idraw->drawLine(pj->m_bodies[1].xform().getOrigin(), a1, btVector3(0, 1, 1)); + idraw->drawLine(pj->m_bodies[0].xform().m_origin, a0, btVector3(1, 1, 0)); + idraw->drawLine(pj->m_bodies[1].xform().m_origin, a1, btVector3(0, 1, 1)); drawVertex(idraw, a0, 0.25, btVector3(1, 1, 0)); drawVertex(idraw, a1, 0.25, btVector3(0, 1, 1)); } @@ -418,10 +418,10 @@ void btSoftBodyHelpers::Draw(btSoftBody* psb, case btSoftBody::Joint::eType::Angular: { //const btSoftBody::AJoint* pja=(const btSoftBody::AJoint*)pj; - const btVector3 o0 = pj->m_bodies[0].xform().getOrigin(); - const btVector3 o1 = pj->m_bodies[1].xform().getOrigin(); - const btVector3 a0 = pj->m_bodies[0].xform().getBasis() * pj->m_refs[0]; - const btVector3 a1 = pj->m_bodies[1].xform().getBasis() * pj->m_refs[1]; + const btVector3 o0 = pj->m_bodies[0].xform().m_origin; + const btVector3 o1 = pj->m_bodies[1].xform().m_origin; + const btVector3 a0 = pj->m_bodies[0].xform().m_basis * pj->m_refs[0]; + const btVector3 a1 = pj->m_bodies[1].xform().m_basis * pj->m_refs[1]; idraw->drawLine(o0, o0 + a0 * 10, btVector3(1, 1, 0)); idraw->drawLine(o0, o0 + a1 * 10, btVector3(1, 1, 0)); idraw->drawLine(o1, o1 + a0 * 10, btVector3(0, 1, 1)); diff --git a/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyInternals.h b/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyInternals.h index 137258675b..5a79a7d118 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyInternals.h +++ b/3rdparty/bullet3/src/BulletSoftBody/btSoftBodyInternals.h @@ -1446,8 +1446,8 @@ struct btSoftColliders btVector3 norm = res.normal; norm.normalize(); //is it necessary? - const btVector3 ra = res.witnesses[0] - ba.xform().getOrigin(); - const btVector3 rb = res.witnesses[1] - bb.xform().getOrigin(); + const btVector3 ra = res.witnesses[0] - ba.xform().m_origin; + const btVector3 rb = res.witnesses[1] - bb.xform().m_origin; const btVector3 va = ba.velocity(ra); const btVector3 vb = bb.velocity(rb); const btVector3 vrel = va - vb; @@ -1459,8 +1459,8 @@ struct btSoftColliders const btVector3 fv = vrel - iv; joint.m_bodies[0] = ba; joint.m_bodies[1] = bb; - joint.m_refs[0] = ra * ba.xform().getBasis(); - joint.m_refs[1] = rb * bb.xform().getBasis(); + joint.m_refs[0] = ra * ba.xform().m_basis; + joint.m_refs[1] = rb * bb.xform().m_basis; joint.m_rpos[0] = ra; joint.m_rpos[1] = rb; joint.m_cfm = 1; @@ -1626,7 +1626,7 @@ struct btSoftColliders const btTransform& wtr = m_rigidBody ? m_rigidBody->getWorldTransform() : m_colObj1Wrap->getCollisionObject()->getWorldTransform(); static const btMatrix3x3 iwiStatic(0, 0, 0, 0, 0, 0, 0, 0, 0); const btMatrix3x3& iwi = m_rigidBody ? m_rigidBody->getInvInertiaTensorWorld() : iwiStatic; - const btVector3 ra = n.m_x - wtr.getOrigin(); + const btVector3 ra = n.m_x - wtr.m_origin; const btVector3 va = m_rigidBody ? m_rigidBody->getVelocityInLocalPoint(ra) * psb->m_sst.sdt : btVector3(0, 0, 0); const btVector3 vb = n.m_x - n.m_q; const btVector3 vr = vb - va; @@ -1691,7 +1691,7 @@ struct btSoftColliders if (cti.m_colObj->getInternalType() == btCollisionObject::CO_RIGID_BODY) { const btTransform& wtr = m_rigidBody ? m_rigidBody->getWorldTransform() : m_colObj1Wrap->getCollisionObject()->getWorldTransform(); - const btVector3 ra = n.m_x - wtr.getOrigin(); + const btVector3 ra = n.m_x - wtr.m_origin; static const btMatrix3x3 iwiStatic(0, 0, 0, 0, 0, 0, 0, 0, 0); const btMatrix3x3& iwi = m_rigidBody ? m_rigidBody->getInvInertiaTensorWorld() : iwiStatic; @@ -1811,7 +1811,7 @@ struct btSoftColliders const btTransform& wtr = m_rigidBody ? m_rigidBody->getWorldTransform() : m_colObj1Wrap->getCollisionObject()->getWorldTransform(); static const btMatrix3x3 iwiStatic(0, 0, 0, 0, 0, 0, 0, 0, 0); const btMatrix3x3& iwi = m_rigidBody ? m_rigidBody->getInvInertiaTensorWorld() : iwiStatic; - const btVector3 ra = contact_point - wtr.getOrigin(); + const btVector3 ra = contact_point - wtr.m_origin; // we do not scale the impulse matrix by dt c.m_c0 = ImpulseMatrix(1, ima, imb, iwi, ra); diff --git a/3rdparty/bullet3/src/BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp b/3rdparty/bullet3/src/BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp index dcdd932028..469d60c686 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp @@ -195,9 +195,9 @@ struct btSoftSingleRayCallback : public btBroadphaseRayCallback m_resultCallback(resultCallback) { m_rayFromTrans.setIdentity(); - m_rayFromTrans.setOrigin(m_rayFromWorld); + m_rayFromTrans.m_origin = (m_rayFromWorld); m_rayToTrans.setIdentity(); - m_rayToTrans.setOrigin(m_rayToWorld); + m_rayToTrans.m_origin = (m_rayToWorld); btVector3 rayDir = (rayToWorld - rayFromWorld); @@ -280,7 +280,7 @@ void btSoftMultiBodyDynamicsWorld::rayTestSingle(const btTransform& rayFromTrans if (softBody) { btSoftBody::sRayCast softResult; - if (softBody->rayTest(rayFromTrans.getOrigin(), rayToTrans.getOrigin(), softResult)) + if (softBody->rayTest(rayFromTrans.m_origin, rayToTrans.m_origin, softResult)) { if (softResult.fraction <= resultCallback.m_closestHitFraction) { @@ -288,7 +288,7 @@ void btSoftMultiBodyDynamicsWorld::rayTestSingle(const btTransform& rayFromTrans shapeInfo.m_shapePart = 0; shapeInfo.m_triangleIndex = softResult.index; // get the normal - btVector3 rayDir = rayToTrans.getOrigin() - rayFromTrans.getOrigin(); + btVector3 rayDir = rayToTrans.m_origin - rayFromTrans.m_origin; btVector3 normal = -rayDir; normal.normalize(); diff --git a/3rdparty/bullet3/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp b/3rdparty/bullet3/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp index dc9b004a37..9ced6e96e1 100644 --- a/3rdparty/bullet3/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp +++ b/3rdparty/bullet3/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp @@ -190,9 +190,9 @@ struct btSoftSingleRayCallback : public btBroadphaseRayCallback m_resultCallback(resultCallback) { m_rayFromTrans.setIdentity(); - m_rayFromTrans.setOrigin(m_rayFromWorld); + m_rayFromTrans.m_origin = (m_rayFromWorld); m_rayToTrans.setIdentity(); - m_rayToTrans.setOrigin(m_rayToWorld); + m_rayToTrans.m_origin = (m_rayToWorld); btVector3 rayDir = (rayToWorld - rayFromWorld); @@ -275,7 +275,7 @@ void btSoftRigidDynamicsWorld::rayTestSingle(const btTransform& rayFromTrans, co if (softBody) { btSoftBody::sRayCast softResult; - if (softBody->rayTest(rayFromTrans.getOrigin(), rayToTrans.getOrigin(), softResult)) + if (softBody->rayTest(rayFromTrans.m_origin, rayToTrans.m_origin, softResult)) { if (softResult.fraction <= resultCallback.m_closestHitFraction) { @@ -283,7 +283,7 @@ void btSoftRigidDynamicsWorld::rayTestSingle(const btTransform& rayFromTrans, co shapeInfo.m_shapePart = 0; shapeInfo.m_triangleIndex = softResult.index; // get the normal - btVector3 rayDir = rayToTrans.getOrigin() - rayFromTrans.getOrigin(); + btVector3 rayDir = rayToTrans.m_origin - rayFromTrans.m_origin; btVector3 normal = -rayDir; normal.normalize(); diff --git a/3rdparty/bullet3/src/LinearMath/btAabbUtil2.h b/3rdparty/bullet3/src/LinearMath/btAabbUtil2.h index 67ff479c79..fdb4cb810b 100644 --- a/3rdparty/bullet3/src/LinearMath/btAabbUtil2.h +++ b/3rdparty/bullet3/src/LinearMath/btAabbUtil2.h @@ -3,8 +3,8 @@ Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans https://bulletphysi This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -172,8 +172,8 @@ SIMD_FORCE_INLINE bool btRayAabb(const btVector3& rayFrom, SIMD_FORCE_INLINE void btTransformAabb(const btVector3& halfExtents, btScalar margin, const btTransform& t, btVector3& aabbMinOut, btVector3& aabbMaxOut) { btVector3 halfExtentsWithMargin = halfExtents + btVector3(margin, margin, margin); - btMatrix3x3 abs_b = t.getBasis().absolute(); - btVector3 center = t.getOrigin(); + btMatrix3x3 abs_b = t.m_basis.absolute(); + btVector3 center = t.m_origin; btVector3 extent = halfExtentsWithMargin.dot3(abs_b[0], abs_b[1], abs_b[2]); aabbMinOut = center - extent; aabbMaxOut = center + extent; @@ -188,7 +188,7 @@ SIMD_FORCE_INLINE void btTransformAabb(const btVector3& localAabbMin, const btVe localHalfExtents += btVector3(margin, margin, margin); btVector3 localCenter = btScalar(0.5) * (localAabbMax + localAabbMin); - btMatrix3x3 abs_b = trans.getBasis().absolute(); + btMatrix3x3 abs_b = trans.m_basis.absolute(); btVector3 center = trans(localCenter); btVector3 extent = localHalfExtents.dot3(abs_b[0], abs_b[1], abs_b[2]); aabbMinOut = center - extent; diff --git a/3rdparty/bullet3/src/LinearMath/btIDebugDraw.h b/3rdparty/bullet3/src/LinearMath/btIDebugDraw.h index df4db2ff5a..6b7c0c9255 100644 --- a/3rdparty/bullet3/src/LinearMath/btIDebugDraw.h +++ b/3rdparty/bullet3/src/LinearMath/btIDebugDraw.h @@ -91,9 +91,9 @@ class btIDebugDraw virtual void drawSphere(btScalar radius, const btTransform& transform, const btVector3& color) { - btVector3 center = transform.getOrigin(); - btVector3 up = transform.getBasis().getColumn(1); - btVector3 axis = transform.getBasis().getColumn(0); + btVector3 center = transform.m_origin; + btVector3 up = transform.m_basis.getColumn(1); + btVector3 axis = transform.m_basis.getColumn(0); btScalar minTh = -SIMD_HALF_PI; btScalar maxTh = SIMD_HALF_PI; btScalar minPs = -SIMD_HALF_PI; @@ -107,7 +107,7 @@ class btIDebugDraw { btTransform tr; tr.setIdentity(); - tr.setOrigin(p); + tr.m_origin = p; drawSphere(radius, tr, color); } @@ -162,10 +162,10 @@ class btIDebugDraw } virtual void drawTransform(const btTransform& transform, btScalar orthoLen) { - btVector3 start = transform.getOrigin(); - drawLine(start, start + transform.getBasis() * btVector3(orthoLen, 0, 0), btVector3(btScalar(1.), btScalar(0.3), btScalar(0.3))); - drawLine(start, start + transform.getBasis() * btVector3(0, orthoLen, 0), btVector3(btScalar(0.3), btScalar(1.), btScalar(0.3))); - drawLine(start, start + transform.getBasis() * btVector3(0, 0, orthoLen), btVector3(btScalar(0.3), btScalar(0.3), btScalar(1.))); + btVector3 start = transform.m_origin; + drawLine(start, start + transform.m_basis * btVector3(orthoLen, 0, 0), btVector3(btScalar(1.), btScalar(0.3), btScalar(0.3))); + drawLine(start, start + transform.m_basis * btVector3(0, orthoLen, 0), btVector3(btScalar(0.3), btScalar(1.), btScalar(0.3))); + drawLine(start, start + transform.m_basis * btVector3(0, 0, orthoLen), btVector3(btScalar(0.3), btScalar(0.3), btScalar(1.))); } virtual void drawArc(const btVector3& center, const btVector3& normal, const btVector3& axis, btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle, @@ -345,11 +345,11 @@ class btIDebugDraw // Draw the ends { btTransform childTransform = transform; - childTransform.getOrigin() = transform * capStart; + childTransform.m_origin = transform * capStart; { - btVector3 center = childTransform.getOrigin(); - btVector3 up = childTransform.getBasis().getColumn((upAxis + 1) % 3); - btVector3 axis = -childTransform.getBasis().getColumn(upAxis); + btVector3 center = childTransform.m_origin; + btVector3 up = childTransform.m_basis.getColumn((upAxis + 1) % 3); + btVector3 axis = -childTransform.m_basis.getColumn(upAxis); btScalar minTh = -SIMD_HALF_PI; btScalar maxTh = SIMD_HALF_PI; btScalar minPs = -SIMD_HALF_PI; @@ -361,11 +361,11 @@ class btIDebugDraw { btTransform childTransform = transform; - childTransform.getOrigin() = transform * capEnd; + childTransform.m_origin = transform * capEnd; { - btVector3 center = childTransform.getOrigin(); - btVector3 up = childTransform.getBasis().getColumn((upAxis + 1) % 3); - btVector3 axis = childTransform.getBasis().getColumn(upAxis); + btVector3 center = childTransform.m_origin; + btVector3 up = childTransform.m_basis.getColumn((upAxis + 1) % 3); + btVector3 axis = childTransform.m_basis.getColumn(upAxis); btScalar minTh = -SIMD_HALF_PI; btScalar maxTh = SIMD_HALF_PI; btScalar minPs = -SIMD_HALF_PI; @@ -375,19 +375,19 @@ class btIDebugDraw } // Draw some additional lines - btVector3 start = transform.getOrigin(); + btVector3 start = transform.m_origin; for (int i = 0; i < 360; i += stepDegrees) { capEnd[(upAxis + 1) % 3] = capStart[(upAxis + 1) % 3] = btSin(btScalar(i) * SIMD_RADS_PER_DEG) * radius; capEnd[(upAxis + 2) % 3] = capStart[(upAxis + 2) % 3] = btCos(btScalar(i) * SIMD_RADS_PER_DEG) * radius; - drawLine(start + transform.getBasis() * capStart, start + transform.getBasis() * capEnd, color); + drawLine(start + transform.m_basis * capStart, start + transform.m_basis * capEnd, color); } } virtual void drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color) { - btVector3 start = transform.getOrigin(); + btVector3 start = transform.m_origin; btVector3 offsetHeight(0, 0, 0); offsetHeight[upAxis] = halfHeight; int stepDegrees = 30; @@ -400,21 +400,21 @@ class btIDebugDraw { capEnd[(upAxis + 1) % 3] = capStart[(upAxis + 1) % 3] = btSin(btScalar(i) * SIMD_RADS_PER_DEG) * radius; capEnd[(upAxis + 2) % 3] = capStart[(upAxis + 2) % 3] = btCos(btScalar(i) * SIMD_RADS_PER_DEG) * radius; - drawLine(start + transform.getBasis() * capStart, start + transform.getBasis() * capEnd, color); + drawLine(start + transform.m_basis * capStart, start + transform.m_basis * capEnd, color); } // Drawing top and bottom caps of the cylinder btVector3 yaxis(0, 0, 0); yaxis[upAxis] = btScalar(1.0); btVector3 xaxis(0, 0, 0); xaxis[(upAxis + 1) % 3] = btScalar(1.0); - drawArc(start - transform.getBasis() * (offsetHeight), transform.getBasis() * yaxis, transform.getBasis() * xaxis, radius, radius, 0, SIMD_2_PI, color, false, btScalar(10.0)); - drawArc(start + transform.getBasis() * (offsetHeight), transform.getBasis() * yaxis, transform.getBasis() * xaxis, radius, radius, 0, SIMD_2_PI, color, false, btScalar(10.0)); + drawArc(start - transform.m_basis * (offsetHeight), transform.m_basis * yaxis, transform.m_basis * xaxis, radius, radius, 0, SIMD_2_PI, color, false, btScalar(10.0)); + drawArc(start + transform.m_basis * (offsetHeight), transform.m_basis * yaxis, transform.m_basis * xaxis, radius, radius, 0, SIMD_2_PI, color, false, btScalar(10.0)); } virtual void drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color) { int stepDegrees = 30; - btVector3 start = transform.getOrigin(); + btVector3 start = transform.m_origin; btVector3 offsetHeight(0, 0, 0); btScalar halfHeight = height * btScalar(0.5); @@ -431,20 +431,20 @@ class btIDebugDraw { capEnd[(upAxis + 1) % 3] = btSin(btScalar(i) * SIMD_RADS_PER_DEG) * radius; capEnd[(upAxis + 2) % 3] = btCos(btScalar(i) * SIMD_RADS_PER_DEG) * radius; - drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * capEnd, color); + drawLine(start + transform.m_basis * (offsetHeight), start + transform.m_basis * capEnd, color); } - drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * (-offsetHeight + offsetRadius), color); - drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * (-offsetHeight - offsetRadius), color); - drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * (-offsetHeight + offset2Radius), color); - drawLine(start + transform.getBasis() * (offsetHeight), start + transform.getBasis() * (-offsetHeight - offset2Radius), color); + drawLine(start + transform.m_basis * (offsetHeight), start + transform.m_basis * (-offsetHeight + offsetRadius), color); + drawLine(start + transform.m_basis * (offsetHeight), start + transform.m_basis * (-offsetHeight - offsetRadius), color); + drawLine(start + transform.m_basis * (offsetHeight), start + transform.m_basis * (-offsetHeight + offset2Radius), color); + drawLine(start + transform.m_basis * (offsetHeight), start + transform.m_basis * (-offsetHeight - offset2Radius), color); // Drawing the base of the cone btVector3 yaxis(0, 0, 0); yaxis[upAxis] = btScalar(1.0); btVector3 xaxis(0, 0, 0); xaxis[(upAxis + 1) % 3] = btScalar(1.0); - drawArc(start - transform.getBasis() * (offsetHeight), transform.getBasis() * yaxis, transform.getBasis() * xaxis, radius, radius, 0, SIMD_2_PI, color, false, 10.0); + drawArc(start - transform.m_basis * (offsetHeight), transform.m_basis * yaxis, transform.m_basis * xaxis, radius, radius, 0, SIMD_2_PI, color, false, 10.0); } virtual void drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color) diff --git a/3rdparty/bullet3/src/LinearMath/btTransform.h b/3rdparty/bullet3/src/LinearMath/btTransform.h index b60c061ebc..b1e0c4411e 100644 --- a/3rdparty/bullet3/src/LinearMath/btTransform.h +++ b/3rdparty/bullet3/src/LinearMath/btTransform.h @@ -3,8 +3,8 @@ Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans https://bulletphysi This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -28,17 +28,18 @@ subject to the following restrictions: ATTRIBUTE_ALIGNED16(class) btTransform { +public: + ///Storage for the rotation btMatrix3x3 m_basis; ///Storage for the translation btVector3 m_origin; -public: BT_DECLARE_ALIGNED_ALLOCATOR(); /**@brief No initialization constructor */ btTransform() {} /**@brief Constructor from btQuaternion (optional btVector3 ) - * @param q Rotation from quaternion + * @param q Rotation from quaternion * @param c Translation from Vector (default 0,0,0) */ explicit SIMD_FORCE_INLINE btTransform(const btQuaternion& q, const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0))) @@ -48,7 +49,7 @@ btTransform } /**@brief Constructor from btMatrix3x3 (optional btVector3) - * @param b Rotation from Matrix + * @param b Rotation from Matrix * @param c Translation from Vector default (0,0,0)*/ explicit SIMD_FORCE_INLINE btTransform(const btMatrix3x3& b, const btVector3& c = btVector3(btScalar(0), btScalar(0), btScalar(0))) @@ -105,16 +106,6 @@ btTransform return getRotation() * q; } - /**@brief Return the basis matrix for the rotation */ - SIMD_FORCE_INLINE btMatrix3x3& getBasis() { return m_basis; } - /**@brief Return the basis matrix for the rotation */ - SIMD_FORCE_INLINE const btMatrix3x3& getBasis() const { return m_basis; } - - /**@brief Return the origin vector translation */ - SIMD_FORCE_INLINE btVector3& getOrigin() { return m_origin; } - /**@brief Return the origin vector translation */ - SIMD_FORCE_INLINE const btVector3& getOrigin() const { return m_origin; } - /**@brief Return a quaternion representing the rotation */ btQuaternion getRotation() const { @@ -142,21 +133,8 @@ btTransform m[15] = btScalar(1.0); } - /**@brief Set the translational element - * @param origin The vector to set the translation to */ - SIMD_FORCE_INLINE void setOrigin(const btVector3& origin) - { - m_origin = origin; - } - SIMD_FORCE_INLINE btVector3 invXform(const btVector3& inVec) const; - /**@brief Set the rotational element by btMatrix3x3 */ - SIMD_FORCE_INLINE void setBasis(const btMatrix3x3& basis) - { - m_basis = basis; - } - /**@brief Set the rotational element by btQuaternion */ SIMD_FORCE_INLINE void setRotation(const btQuaternion& q) { @@ -170,7 +148,7 @@ btTransform m_origin.setValue(btScalar(0.0), btScalar(0.0), btScalar(0.0)); } - /**@brief Multiply this Transform by another(this = this * another) + /**@brief Multiply this Transform by another(this = this * another) * @param t The other transform */ btTransform& operator*=(const btTransform& t) { @@ -187,7 +165,7 @@ btTransform } /**@brief Return the inverse of this transform times the other transform - * @param t The other transform + * @param t The other transform * return this.inverse() * the other */ btTransform inverseTimes(const btTransform& t) const; @@ -222,7 +200,7 @@ btTransform::invXform(const btVector3& inVec) const SIMD_FORCE_INLINE btTransform btTransform::inverseTimes(const btTransform& t) const { - btVector3 v = t.getOrigin() - m_origin; + btVector3 v = t.m_origin - m_origin; return btTransform(m_basis.transposeTimes(t.m_basis), v * m_basis); } @@ -237,8 +215,8 @@ SIMD_FORCE_INLINE btTransform /**@brief Test if two transforms have all elements equal */ SIMD_FORCE_INLINE bool operator==(const btTransform& t1, const btTransform& t2) { - return (t1.getBasis() == t2.getBasis() && - t1.getOrigin() == t2.getOrigin()); + return (t1.m_basis == t2.m_basis && + t1.m_origin == t2.m_origin); } ///for serialization diff --git a/3rdparty/bullet3/src/LinearMath/btTransformUtil.h b/3rdparty/bullet3/src/LinearMath/btTransformUtil.h index a5aab208f6..a320bcfca0 100644 --- a/3rdparty/bullet3/src/LinearMath/btTransformUtil.h +++ b/3rdparty/bullet3/src/LinearMath/btTransformUtil.h @@ -3,8 +3,8 @@ Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans https://bulletphysi This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. -Permission is granted to anyone to use this software for any purpose, -including commercial applications, and to alter it and redistribute it freely, +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. @@ -31,7 +31,7 @@ class btTransformUtil public: static void integrateTransform(const btTransform& curTrans, const btVector3& linvel, const btVector3& angvel, btScalar timeStep, btTransform& predictedTransform) { - predictedTransform.setOrigin(curTrans.getOrigin() + linvel * timeStep); + predictedTransform.m_origin = curTrans.m_origin + linvel * timeStep; // #define QUATERNION_DERIVATIVE #ifdef QUATERNION_DERIVATIVE btQuaternion predictedOrn = curTrans.getRotation(); @@ -77,7 +77,7 @@ class btTransformUtil } else { - predictedTransform.setBasis(curTrans.getBasis()); + predictedTransform.m_basis = curTrans.m_basis; } } @@ -114,7 +114,7 @@ class btTransformUtil static void calculateVelocity(const btTransform& transform0, const btTransform& transform1, btScalar timeStep, btVector3& linVel, btVector3& angVel) { - linVel = (transform1.getOrigin() - transform0.getOrigin()) / timeStep; + linVel = (transform1.m_origin - transform0.m_origin) / timeStep; btVector3 axis; btScalar angle; calculateDiffAxisAngle(transform0, transform1, axis, angle); @@ -123,7 +123,7 @@ class btTransformUtil static void calculateDiffAxisAngle(const btTransform& transform0, const btTransform& transform1, btVector3& axis, btScalar& angle) { - btMatrix3x3 dmat = transform1.getBasis() * transform0.getBasis().inverse(); + btMatrix3x3 dmat = transform1.m_basis * transform0.m_basis.inverse(); btQuaternion dorn; dmat.getRotation(dorn); @@ -172,8 +172,8 @@ class btConvexSeparatingDistanceUtil void updateSeparatingDistance(const btTransform& transA, const btTransform& transB) { - const btVector3& toPosA = transA.getOrigin(); - const btVector3& toPosB = transB.getOrigin(); + const btVector3& toPosA = transA.m_origin; + const btVector3& toPosB = transB.m_origin; btQuaternion toOrnA = transA.getRotation(); btQuaternion toOrnB = transB.getRotation(); @@ -208,8 +208,8 @@ class btConvexSeparatingDistanceUtil { m_separatingNormal = separatingVector; - const btVector3& toPosA = transA.getOrigin(); - const btVector3& toPosB = transB.getOrigin(); + const btVector3& toPosA = transA.m_origin; + const btVector3& toPosB = transB.m_origin; btQuaternion toOrnA = transA.getRotation(); btQuaternion toOrnB = transB.getRotation(); m_posA = toPosA; diff --git a/src/world/physics_world_bullet.cpp b/src/world/physics_world_bullet.cpp index 6c18209e97..b0a031bcc6 100644 --- a/src/world/physics_world_bullet.cpp +++ b/src/world/physics_world_bullet.cpp @@ -109,10 +109,10 @@ static inline Quaternion to_quaternion(const btQuaternion &q) static inline Matrix4x4 to_matrix4x4(const btTransform &t) { - const btVector3 x = t.getBasis().getRow(0); - const btVector3 y = t.getBasis().getRow(1); - const btVector3 z = t.getBasis().getRow(2); - const btVector3 o = t.getOrigin(); + const btVector3 x = t.m_basis.getRow(0); + const btVector3 y = t.m_basis.getRow(1); + const btVector3 z = t.m_basis.getRow(2); + const btVector3 o = t.m_origin; Matrix4x4 m; m.x.x = x.x(); @@ -582,7 +582,7 @@ struct PhysicsWorldImpl void actor_teleport_world_position(ActorInstance actor, const Vector3 &p) { btTransform pose = _actor[actor.i].body->getCenterOfMassTransform(); - pose.setOrigin(to_btVector3(p)); + pose.m_origin = to_btVector3(p); _actor[actor.i].body->setCenterOfMassTransform(pose); } @@ -600,13 +600,13 @@ struct PhysicsWorldImpl btTransform pose = _actor[actor.i].body->getCenterOfMassTransform(); pose.setRotation(to_btQuaternion(rot)); - pose.setOrigin(to_btVector3(pos)); + pose.m_origin = to_btVector3(pos); _actor[actor.i].body->setCenterOfMassTransform(pose); } Vector3 actor_center_of_mass(ActorInstance actor) const { - return to_vector3(_actor[actor.i].body->getCenterOfMassTransform().getOrigin()); + return to_vector3(_actor[actor.i].body->getCenterOfMassTransform().m_origin); } void actor_enable_gravity(ActorInstance actor)