Questions tagged [directxmath]

The DirectXMath API provides SIMD-friendly C++ types and functions for common linear algebra and graphics math operations common to DirectX applications.

The DirectXMath API provides SIMD-friendly C++ types and functions for common linear algebra and graphics math operations common to DirectX applications. The library provides optimized versions for Windows 32-bit (x86), Windows 64-bit (x64), Windows RT, and Windows Mobile through SSE and ARM-NEON intrinsics support in the Visual C++ compiler.

Source: MSDN

DirectXMath is also hosted on GitHub

57 questions
14
votes
3 answers

Alignment 16 not respected when using auto keyword?

Compiling with VS2012 and working with the DirectXMath library, I encountered an issue where it appeared that the compiler wasn't aligning my XMMATRIX. I simplified the issue down to the following. #include using namespace…
MerickOWA
  • 7,453
  • 1
  • 35
  • 56
7
votes
2 answers

How can shared_ptr disrupt alignment

I'm reading docs on DirectXMath, and stumbled upon next passage: As an alternative to enforcing alignment in your C++ class directly by overloading new/delete, you can use the pImpl idiom. If you ensure your Impl class is aligned via…
Yola
  • 18,496
  • 11
  • 65
  • 106
5
votes
1 answer

Avoiding DirectXMath XMStore/load

I have previously done OpenGL and am now learning some DirectX11. One of the things in the new math library is the presence of Load/Store methods for vectors and matrices (for example http://msdn.microsoft.com/en-us/library/ee415635(v=vs.85).aspx).…
KaiserJohaan
  • 9,028
  • 20
  • 112
  • 199
3
votes
1 answer

DirectXMath and Win8 SDK in VS2010 project

I've been working in an engine in Visual Studio 2012 that supports rendering with Direct3D 9 and Direct3D 11. However I'm getting some new people to help with the project and they would prefer to work on Visual Studio 2010 because that's the version…
3
votes
2 answers

How to use std::accumulate to neatly sum values in a vector pointed by separately defined indices (replacing loops)

I was wondering if there's a neater (or better yet, more efficient), method of summing values of a vector/(asymmetric) matrix (a matrix having structure like symmetry, could of course be exploited in looping, but not that pertinent to my question)…
Veksi
  • 3,556
  • 3
  • 30
  • 69
2
votes
1 answer

How is it possible to get the float value from XMVECTOR? (DirectXMath)

I would like to get the dot product of two 3D vectors in float. But unfortunately the result is a vector, not a float. I trued to access it's elements using vector4_f32, but I get an error, that it's not a member of __m128 float res =…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
2
votes
2 answers

Transforming a plane with DirectXTK / DirectXMath

I have a 3D plane defined by three points and I want to transform it with a 4x4 matrix using DirectXTK. I tried two ways to do this: Transform the plane with Plane::Transform() method - this gives a very strange result. Transform the three points…
milkyway
  • 55
  • 5
2
votes
1 answer

What are the perfomance implications of an inheritance like this?

I'm working with the DirectXMath (or XNAMath) library (defined in the DirectXMath.h header of the Windows SDK), as it appears to be really performant and offers everything that is needed for physics and rendering. However I found it to be quite…
LukeG
  • 638
  • 10
  • 20
2
votes
1 answer

DirectX::XMMATRIX error C2719: __declspec(align('16')) won't be aligned

Ok so im working on my own DirectX framework all tutorials about making a DirectX framework are old and use deprecated stuff so i just made my own one , though i took somethings from the old tutorials and updated them to work with the new Windows…
user3460574
2
votes
1 answer

Using XMVECTOR from DirectXMath as a class member causes a crash only in Release Mode?

I've been trying to use XMVECTOR as a class member for a bounding box, since I do a lot of calculations, but I use the XMFLOAT3 only once per frame, so the bounding box has a method that gives me it's center in a XMFLOAT3, otherwise it stays in a…
ulak blade
  • 2,515
  • 5
  • 37
  • 81
1
vote
0 answers

How to calculate orientation when a ray hits a quad?

I know how to determine where a ray hit a quad but I don't know how to determine the orientation at the hit position. ArCore describes the HitResult pose for a plane as: HitResult.getHitPose() Returns the pose of the intersection between a ray and…
1
vote
1 answer

Why does XMVector4Dot return a vector with the dot product copied to it's components?

The documentation for XMVector4Dot lists the return value as a vector. It also states that the dot product is replicated into each component. Given that the dot product is going to be a single value, how does this offer an advantage over just…
Caps
  • 79
  • 6
1
vote
1 answer

What's the difference between XMVectorSetByIndex when index = 0 and XMVectorSetX?

I read the source code of the DirectXMath Library and found that the implementation of XMVectorSetByIndex and XMVectorSetX are completely different. Why not XMVectorSetX simply returns XMVectorSetByIndex (index = 0) ?
Cu2S
  • 667
  • 1
  • 5
  • 21
1
vote
1 answer

DirectXTK spriteFont in 3D space

I was hoping to display an "X" at (50,0,0) using DirectXTK and following an article about billboarding. however i do not seem to have it correct. Could somebody help me out. XMVECTOR textPosition = XMVectorSet(50, 0, 0, 0); …
1
vote
1 answer

XMVector3Unproject - Screen to world coordinate at specific Z

I want to convert screen coordinate to world coordinate in Directx 11. I found that I can do it easily with function XMVector3Unproject. There is one catch, I want to pick my own Z coordinate to tell the function how far from the camera my point is…
Maciej Szpakowski
  • 571
  • 1
  • 7
  • 22
1
2 3 4