Containers for sony vector math's structures.

Post Reply
concubicycle
Posts: 3
Joined: Wed Apr 04, 2012 5:40 pm

Containers for sony vector math's structures.

Post by concubicycle »

I'm trying to use the SSE version of the vector math library in the Extras folder. Because of the 16byte alignment of its structures, however, I can't seem to use stl vector's to store them. This error comes up:
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector(870): error C2719: '_Val': formal parameter with __declspec(align('16')) won't be aligned
1> c:\...\projects\sonymath\sonymath\main.cpp(16) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
1> with
1> [
1> _Ty=Vectormath::Aos::Vector3
1> ]
1>
This is a pretty major hurdle, and I was wondering if any of you knew a fix, or a different container library providing vectors. Do people generally roll their own containers for these?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Containers for sony vector math's structures.

Post by Erwin Coumans »

In Bullet we use the btAlignedObjectArray to replace parts of std::vector, with a custom memory allocator. It is small reusable code.

Thanks,
Erwin
khoowaikeong
Posts: 43
Joined: Fri Jun 15, 2012 7:11 am

Re: Containers for sony vector math's structures.

Post by khoowaikeong »

so that is what btAlignedObjectArray is for... :o

it an amusing question. i did encounter it but then i just store everything in the stack(temp array) and throw it into bullet, the rest of my engine use it own math class. i did consider re-standardizing to bullet's vector class but it heck alot of work to change math class, so not for this revision at least, until i get more comfortable with it.
Post Reply