0
0

Hi

Just have a query about the addPolygon funciton in c#, it is about the 5th parameter.

I looked for the geometry example in the c# example foler but none there. So in the c++ version, an array of vertices is passed in the 5th param.

In c#. it asks for ref vertices and therefore i am not able to pass an array of vertices?

So what are am i suppose to do? Does it do it automatically?

Please Help!!

Thanks

  • You must to post comments
0
0

Are you suppose to create a FMOD.VECTOR that is referencing to the first in the vector array and pass that by reference???

  • You must to post comments
0
0

Hi,

I took a look at the wrapper and it seems the 5th parameter is wrong. Thanks for pointing this out, I have fixed this up for our next release. To get it working you only have to make a couple of changes fmod.cs:

replace the Geometry::addPolygon function with this:
[code:4iv13ha8]public RESULT addPolygon (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, VECTOR[] vertices, ref int polygonindex)
{
return FMOD_Geometry_AddPolygon(geometryraw, directocclusion, reverbocclusion, (doublesided ? 1 : 0), numvertices, vertices, ref polygonindex);
}[/code:4iv13ha8]

in the importfunctions region of the geometry class, change the entry for Geometry_AddPolygon to the following:
[code:4iv13ha8]
private static extern RESULT FMOD_Geometry_AddPolygon (IntPtr geometry, float directocclusion, float reverbocclusion, int doublesided, int numvertices, [MarshalAs(UnmanagedType.LPArray)]VECTOR[] vertices, ref int polygonindex);[/code:4iv13ha8]

-Pete

  • You must to post comments
0
0

Hi,

Thanks. It is quite weird no one else has pointed this out yet, I’m guessing not a lot of people use the c# version or if they have, not done geometry stuff.

Oh well that’s great to hear, thank you for the reply.

thanks

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.