Hi, I am trying to convert a code from c++ to c# for oculus in unity.
How i can convert the following method
- copy(v.begin(), v.end(), std::back_inserter(a));
- how i can use Matrix4f which i used in c++ project that used ovr_math.h
any iDea??
thanks
Hi, I am trying to convert a code from c++ to c# for oculus in unity.
How i can convert the following method
any iDea??
thanks
First of all, I’m not sure this is really the best place for this question, since it is really only tangentially related to Virtual Reality development in Unity. Second, there’s not really all that much to go on here, can you provide more details about what you’re actually trying to do here? For example, what are ‘v’ and ‘a’ in your copy method?
As far as a matrix 4 class to use: Unity - Scripting API: Matrix4x4
HI, Thanks for your reply…
as an example
std::vector v(10,42), a;
std::copy(v.begin(),v.end(),std::back_inserter(a))
is there any function like this in c#
in c# I am using Listv (instead of vector in c++)
Thank you ![]()
Not sure what your goal is, but in C# you can easily copy lists:
List<int> v = new List<int>();
// add stuff to v
List<int> a = new List<int>(v);
That overload of the constructor for List iterates the collection passed in and adds each element to the new list.