views:

17

answers:

0

Hi!

use in a project two libraries. Irrlicht and OpenMesh. Both libraries feature a Vector3 format. Irrlicht has vector3df which stores three floats and OpenMesh has VectorT

OpenMesh has got some functions which return a VectorT - i know that N is 3 and the scalar is of type float.

How can I make the types compatible such that i can cast a vector3df to a VectorT with N=3 ?

thank you!

edit:

i defined two inline functions:

inline vector3df toVector(PolyMesh::Point& p)
{
vector3df v;
v.X = p[0];
v.Y = p[1];
v.Z = p[2];
return v;
}

inline PolyMesh::Point toPoint(vector3df& v)
{
PolyMesh::Point p;
p[0]=v.X;
p[1]=v.Y;
p[2]=v.Z;
return p;
}

but i'm using this a lot of time in many loops - is there a faster way to do it?