Original Post
In the fps game I'm building (in C#) I use Mesh.Intersect() to check if the player hits an object or other player when he shoots. To determine the other player is shoot in the head of another body part I'm trying to go a bit further with the collision detection by using Mesh.IntersectSubset() to detect the subset that's bin shot. While executing that method I get a invalid call error: -2005530516 D3DERR_INVALIDCALL at Microsoft.DirectX.Direct3D.Mesh.IntersectSubset(Int32 attributeId, Vector3 rayPos, Vector3 rayDir, IntersectInformation& closestHit, IntersectInformation[]& allHits) at Microsoft.DirectX.Direct3D.Mesh.IntersectSubset(Int32 attributeId, Vector3 rayPos, Vector3 rayDir) The part of my sourcecode where I call IntersecSubset looks like this: // Nearcor = Vector3.Unproject(new Vector3(Xpos, Ypos, 0), viewport, projection, view, Engine.Device3D.Transform.World); Farcor = Vector3.Unproject(new Vector3(Xpos, Ypos, 1), viewport, projection, view, Engine.Device3D.Transform.World); Farcor.Normalize(); if(m_Mesh.IntersectSubset(0, Nearcor, Farcor)) { Console.WriteLine("hit"); } // The Nearcor and Farcor I also use for the Mesh.Intersect() which works fine. I'm beginning to think there's a bug in Mesh.IntersectSubset(). Anybody who has experience with this? Thx in advance.