I'm writing a plugin for this c++ physics library for Unity3d. The library is a superset of Box2D with particle simulation added. In the c++ library there is a function that returns an array of 2d vector objects for all the particles. I'm wondering how I could pass this back to Unity so I can draw them? I Cant pass objects between the library and Unity. Could I pass a 2d array of floats? I heard that I should instantiate an array of the correct size in Unity in c#, then pass it to the c++ function where all the data will be filled in, then pass it back to Unity (this is to help avoid memory problems in c++) How would you write this in c++? Alternatively could I use an out paramater to do this? And how would you write that?
-
1may this two link helps you .its msdn corner link is social.msdn.microsoft.com/Forums/en-US/…Ferrakkem Bhuiyan– Ferrakkem Bhuiyan2014-01-30 18:20:47 +00:00Commented Jan 30, 2014 at 18:20
-
1C++ to C# use CoTaskMemAlloc family of functions on the C++ side. You can find information about this on msdn.microsoft.com/en-us/library/ms692727Ferrakkem Bhuiyan– Ferrakkem Bhuiyan2014-01-30 18:21:22 +00:00Commented Jan 30, 2014 at 18:21
Add a comment
|