xlash86
30-11-2008 17:50:44
Hey!
When making this call
I'm getting a AccessViolationException.
A manual-object is attached to the scene-node. The following code is used to create it
Any idea what's going wrong?
MfG xlash86
When making this call
Collision cMesh = new MogreNewt.CollisionPrimitives.ConvexHull(mWorld, scnMesh);
I'm getting a AccessViolationException.
A manual-object is attached to the scene-node. The following code is used to create it
private ManualObject CreateConvexManualObject(List<Vector3> hull, ManualObject mo)
{
lock (typeof(CoDMain))
{
if (mo == null)
mo = mSceneManager.CreateManualObject(NameFactory.GetName("MANUAL_OBJECT_"));
else
mo.Clear();
mo.Begin("BaseWhiteNoLight", RenderOperation.OperationTypes.OT_TRIANGLE_LIST);
ushort pointIndex = 0;
foreach (
Triangulation.Triangle t
in Triangulation.DelaunayTriangulation2d.Triangulate(hull))
{
mo.Position((float)t.Vertex1.x, (float)t.Vertex1.y, (float)t.Vertex1.z);
mo.Normal(Vector3.UNIT_Z);
mo.Index(pointIndex++);
mo.Position((float)t.Vertex2.x, (float)t.Vertex2.y, (float)t.Vertex2.z);
mo.Normal(Vector3.UNIT_Z);
mo.Index(pointIndex++);
mo.Position((float)t.Vertex3.x, (float)t.Vertex3.y, (float)t.Vertex3.z);
mo.Normal(Vector3.UNIT_Z);
mo.Index(pointIndex++);
}
mo.End();
//mo.ConvertToMesh(NameFactory.GetName("asdasd"));
return mo;
}
}
Any idea what's going wrong?
MfG xlash86