This project is read-only.

Strange error in TriangleMeshObject

Nov 10, 2008 at 4:03 AM
Hi, first i really want to tell you thanks for bringing such a usefull physics librairy to the xna community, this has really helped us in our projects.
I encountered a very strange problem implementing JiggleX in my XNA 3.0 CTP project. First, i had to remake the whole VertexProcessor librairy since visual studio obviously is never able to convert a project... Anyway, i just recopied the VertexProcessor classed and it worked, so that's maybe is not the problem. After that, i imported the VertexProcessor dll it created in my content references, and then set it as the content processor of my .x file. I then instanciated it as a TriangleMeshObject, and there goes the strange error. I first thought it was the vertexprocessor that did not send the right info to the class, but i checked and the tags of the model are all ok...
So there's my error, coming from this line of code in TriangleMeshObject class "triangleMesh.CreateMesh(vertexList,indexList, 4, 1.0f);".

System.ArrayTypeMismatchException was unhandled
  Message="Source array type cannot be assigned to destination array type."
       at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
       at System.Collections.Generic.List`1.CopyTo(T[] array)
       at JigLibX.Geometry.Octree.AddTriangles(List`1 _positions, List`1 _tris)
       at JigLibX.Geometry.TriangleMesh.CreateMesh(List`1 vertices, List`1 triangleVertexIndices, Int32 maxTrianglesPerCell, Single minCellSize)
       at SE3.Physics.Objects.TriangleMeshObject..ctor(Game game, Camera camera, DebugDrawer debugdrawer, Model model, Matrix orientation, Vector3 position) in C:\Users\Domino\Desktop\SquaredEngine\SquaredEngine 3.0\SE 3.0.0 Pre-Alpha\Physics\Objects\TriangleMeshObject.cs:line 42
       at Game1.LoadContent() in C:\Users\Domino\Desktop\SquaredEngine\SquaredEngine 3.0\SE3 Demo\Game1.cs:line 102
       at Microsoft.Xna.Framework.Game.Initialize()
       at Game1.Initialize() in C:\Users\Domino\Desktop\SquaredEngine\SquaredEngine 3.0\SE3 Demo\Game1.cs:line 98
       at Microsoft.Xna.Framework.Game.Run()
       at SE3_Demo.Program.Main(String[] args) in C:\Users\Domino\Desktop\SquaredEngine\SquaredEngine 3.0\SE3 Demo\Program.cs:line 14

Thanks for the help, i really dont understand why this happened
Oct 28, 2009 at 6:58 AM

I'm getting this same error, anyone ever figure out how to fix this?