[ODE] Vector types (was: Joint Groups)

Jens Thiele karme at unforgettable.com
Tue Nov 20 06:06:01 MST 2001


Jani Kajala wrote:

>>>struct AdamsVector {
>>>  dVector3 data;
>>>};
>>>
>>struct MyVector
>>{
>>  int x,y,z;
>>  operator [] ...
>>};
>>

AFAIK

struct {
	int data[3];
};
and
struct {
	 int x,y,z;
};
may have a different memory layout !! (due to compiler optimizations)
a common trick is to use a union to force "linear" layout.

karme

-- 
email karme at unforgettable.com
IRC   Karme
HP    http://www-ti.informatik.uni-tuebingen.de/~thiele




More information about the ODE mailing list