我正在尝试使用DirectX绘制对象及其数学库以利用SIMD计算(XMMATRIX和XMVECTOR类)来实现小型刚体物理仿真。
我的问题是关于[[惯性张量,我知道使用其逆数可以像这样计算角加速度:
AngAcc = Inverse(I) * torque
并且局部空间中的惯性张量是恒定的,因此我将其逆与其他成员一起存储在我的RigidBody类中:
//'W' suffix means 'world space' //'L' suffix means 'local space' XMFLOAT3 m_positionW; //rigid body position XMFLOAT4 m_orientationW; //angular orientation XMFLOAT3 m_velocityW; //linear velocity XMFLOAT3 m_rotationW; //angular velocity (rotation) XMFLOAT3X3 m_inverseInertiaTensorL; //inverse of the body inertia tensor in local space (constant) XMFLOAT4X4 m_worldTransform; //transform matrix for converting body space into world space XMFLOAT3X3 m_inverseInertiaTensorW; //inverse of the body inertia tensor in world space (change every frame)
现在,在每一帧上,...在这一点上,我有点困惑...我该怎么做?我必须计算世界坐标中的惯性张量的倒数
XMMATRIX旋转= XMMatrixRotationQuaternion(orientationW);
我很困惑...有人可以帮助我吗?
我正在尝试使用DirectX绘制对象及其数学库以利用SIMD计算(XMMATRIX和XMVECTOR类)来实现小型刚体物理仿真。我的问题...
通过m_worldTransform乘以m_inverseInertiaTensorL