• Advertisement
Sign in to follow this  

XNA Math equivalent of ID3DXMatrixStack?

This topic is 1843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi - quick topic (I hope): I am refactoring my C++ directx9 game that makes use of an ID3DXMatrixStack in its scene node tree rendering traversal. I am trying to eliminate all references to the old D3DXMath library replacing all with XNA Math/DirectXMath to use SSE. Firstly: is there an equivalent XNA Math Matrix Math structure? - there doesn't appear to be so, so failing that would you give  some suggestions for replacement implementation - and what might be normal? From what I see any solution seems to require an aligned XMMATRIX structure member... if I am to pick-up the SSE performance gain. Thanks vm.

Share this post


Link to post
Share on other sites
Advertisement

Unfortunately there's no equivalent for ID3DXMatrixStack. However if you know how it works it shouldn't be terribly difficult to implement your own version. If you're going to use something like std::vector to store the matrices in the stack you can store them as XMFLOAT4X4, and then load that into an XMMATRIX only when you need to do math operations with that matrix.

Share this post


Link to post
Share on other sites
Unfortunately there's no equivalent for ID3DXMatrixStack. However if you know how it works it shouldn't be terribly difficult to implement your own version. If you're going to use something like std::vector to store the matrices in the stack you can store them as XMFLOAT4X4, and then load that into an XMMATRIX only when you need to do math operations with that matrix.

Fair enough,thanks - I was thinking that maybe i would end up putting passing around XMMATRIX values in the function calls to try to keep the values in the SIMD registers but that is probably over-thinking things... I should go for the direct equivalent and optimize later (if necessary).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement