Update! Whole PhysX vector library was enabled for Lite-C. PhysX has an own class for vectors, called NxVec3 - for enabling it in Lite-C, I typedef'ed VECTORS as NxVec3:
Code:
typedef VECTOR NxVec3;


The rest (conversion, etc.) is done in my dll-backyard, so you can simply pass regular Lite-C vectors to the following functions. But if you are cool and sort of an NVidia hipster, you can also write always NxVec3 wink I just invented the typedef, because other basic datatypes will follow soon, like NxMat33 (rotation matrices), NxQuat (quaternions), etc.

Here are the new, bulletproof functions from NVidia for you. Some of them are really cool, even if it is just vector math wink

Quote:
// constructors
NxVec3* pXvecCreate (); // new uninitialized v
NxVec3* pXvecCreateScalar (float); // v = a,a,a
NxVec3* pXvecCreateXYZ (float, float, float); // v = x,y,z
NxVec3* pXvecCreateCopy (NxVec3*); // makes copy of another vector v
NxVec3* pXvecCreateArr (float* arr); // from array: v = [0],[1],[2]

// assignment
NxVec3* pXvecSet (NxVec3*, NxVec3* a); // v = a
NxVec3* pXvecSetXYZ (NxVec3*, float, float, float); // v = (x,y,z)
NxVec3* pXvecSetX (NxVec3*, float); // v.x = x
NxVec3* pXvecSetY (NxVec3*, float); // v.y = y
NxVec3* pXvecSetZ (NxVec3*, float); // v.z = z
NxVec3* pXvecSetS (NxVec3*, float); // v = (s,s,s)
NxVec3* pXvecZero (NxVec3*); // v = (0,0,0)

// writes out the 3 values to dest array
NxVec3* pXvecGetArr (NxVec3*, float* dest);

// gets element by index
float pXvecGet (NxVec3*, int);

// true if all the components of v are smaller
BOOL pXvecIsLesser (NxVec3*, NxVec3* greater);

// true if the vectors are -exactly- (un)equal
BOOL pXvecEqual (NxVec3*, NxVec3*);
BOOL pXvecUnequal (NxVec3*, NxVec3*);

// true if a and b's elems are within epsilon of each other
BOOL pXvecEqualEps (NxVec3*, NxVec3*, float eps);

// inverse
NxVec3* pXvecInv (NxVec3*); // v = -v
NxVec3* pXvecSetInv (NxVec3*, NxVec3* a); // v = -a

// v = (0,0,0)
NxVec3* pXvecZero (NxVec3*);

// tests for exact zero vector
BOOL pXvecIsZero (NxVec3*);

// sets minus/plus infinity
NxVec3* pXvecSetPlusInfinity (NxVec3*);
NxVec3* pXvecSetMinusInfinity (NxVec3*);

// v = element wise min(v,a) / max(v,a)
NxVec3* pXvecSetMin (NxVec3*, NxVec3* a);
NxVec3* pXvecSetMax (NxVec3*, NxVec3* a);

// arithmetics
NxVec3* pXvecAdd (NxVec3*, NxVec3* a); // v = v + a
NxVec3* pXvecSub (NxVec3*, NxVec3* a); // v = v - a
NxVec3* pXvecScale (NxVec3*, float s); // v = v * s
NxVec3* pXvecMul (NxVec3*, NxVec3* s); // element wise v = v * s
NxVec3* pXvecMulAdd (NxVec3*, float s, NxVec3* a); // v = v * s + a

// normalizes to length = 1
NxVec3* pXvecNormalize (NxVec3*);

// sets the vector's length to s
NxVec3* pXvecSetLength (NxVec3*, float);

// returns the length and squared length
float pXvecLength (NxVec3*);
float pXvecLengthSq (NxVec3*);

// returns the distance (and squared distance) between v and a
float pXvecDist (NxVec3*, NxVec3*);
float pXvecDistSq (NxVec3*, NxVec3*);

// returns the number of closest axis: 0 = x.., 1 = y.., 2 = z axis
int pXvecClosestAxis (NxVec3*);

// snaps to closest axis and normalizes vector
NxVec3* pXvecSnapToClosestAxis (NxVec3*);

// returns true if all 3 elems of the vector are finite (not NAN or INF, etc.)
BOOL pXvecIsFinite (NxVec3*);

// returns the scalar product of v and a
float pXvecDot (NxVec3*, NxVec3*);

// calculates the cross product of v and a: n = v X a
NxVec3* pXvecCross (NxVec3* n, NxVec3* v, NxVec3* a);

// compares orientations
BOOL pXvecSameDirection (NxVec3*, NxVec3*);


Download the dll + header + lib here: ackphysx.20111121_2.dll.h.lib.rar and checkout the whole as always on SVN.

Cheers!
-Christian

P.S: is anyone interested into swizzling functions for vectors?