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?
- TheMadMe asked 8 years ago
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);
in the importfunctions region of the geometry class, change the entry for Geometry_AddPolygon to the following:
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]
- Guest answered 8 years ago
Please login first to submit.