void RenderDebugLines() { Matrix4x4 mat = Matrix4x4.identity; IntPtr pBody = NewtonAPI.NewtonWorldGetFirstBody(pWorld); while (pBody != IntPtr.Zero) { NewtonAPI.NewtonBodyGetMatrix(pBody, ref mat); IntPtr pColl = NewtonAPI.NewtonBodyGetCollision(pBody); NewtonAPI.NewtonCollisionForEachPolygonDo(pColl, ref mat, NewtonCollisionIterator, IntPtr.Zero); pBody = NewtonAPI.NewtonWorldGetNextBody(pWorld, pBody); } //Debug.Log("BodyCount:" + bodyCount.ToString()); //Vector3 p0 = new Vector3(-100, -100, -100); //Vector3 p1 = new Vector3(100, 100, 100); //WorldForEachBodyInAABBDo(ref p0, ref p1, NewtonBodyIterator, IntPtr.Zero); }