Skip to main content
Altered question to remove mistakes and make question more clear
Source Link
Jay
  • 287
  • 4
  • 15

Is there a way to getto count the actualvertices in a optimised/cooked mesh that a mesh collider uses?

I need to get the number of vertices a mesh collider's mesh has. As pointed out in the comments this may not even be a mesh anymore, I'mbut is there a way to count the vertices of whatever data structure a MeshCollider uses to store it's 'mesh'? I'm currently using

MeshCollider.sharedMesh.vertexCount; 

But seems to get the mesh that the collider initially uses and has a reference to. But this is, not the meshwhat actually used by the object, asphysics simulation. As cooking -> cook for faster simulation canseems to drastically alter this mesh.

Is there a way to get the actual cooked mesh? I only need to read it, not alter it.

Is there a way to get the actual optimised/cooked mesh that a mesh collider uses?

I need to get the number of vertices a mesh collider's mesh has, I'm currently using

MeshCollider.sharedMesh.vertexCount; 

But seems to get the mesh that the collider initially uses and has a reference to. But this is not the mesh actually used by the object, as cooking -> cook for faster simulation can drastically alter this mesh.

Is there a way to get the actual cooked mesh? I only need to read it, not alter it.

Is there a way to to count the vertices in a optimised/cooked mesh collider uses?

I need to get the number of vertices a mesh collider's mesh has. As pointed out in the comments this may not even be a mesh anymore, but is there a way to count the vertices of whatever data structure a MeshCollider uses to store it's 'mesh'? I'm currently using

MeshCollider.sharedMesh.vertexCount; 

But seems to get the mesh that the collider initially uses and has a reference to, not the what actually used by the physics simulation. As cooking -> cook for faster simulation seems to drastically alter this mesh.

Removing the tag from the title.
Source Link
Vaillancourt
  • 16.4k
  • 17
  • 56
  • 61

Unity Is there a way to get the actual optimised/cooked mesh that a mesh collider uses?

Unity Is there a way to get the actual optimised/cooked mesh that a mesh collider uses?

I need to get the number of vertices a mesh collider's mesh has, I'm currently using

MeshCollider.sharedMesh.vertexCount; 

But seems to get the mesh that the collider initially uses and has a reference to. But this is not the mesh actually used by the object, as cooking -> cook for faster simulation can drastically alter this mesh.

Is there a way to get the actual cooked mesh? I only need to read it, not alter it.

Unity Is there a way to get the actual optimised/cooked mesh that a mesh collider uses

I need to get the number of vertices a mesh collider's mesh has, I'm currently using

MeshCollider.sharedMesh.vertexCount; 

But seems to get the mesh that the collider initially uses and has a reference to. But this is not the mesh actually used by the object, as cooking -> cook for faster simulation can drastically alter this mesh.

Is there a way to get the actual cooked mesh? I only need to read it, not alter it.

Is there a way to get the actual optimised/cooked mesh that a mesh collider uses?

I need to get the number of vertices a mesh collider's mesh has, I'm currently using

MeshCollider.sharedMesh.vertexCount; 

But seems to get the mesh that the collider initially uses and has a reference to. But this is not the mesh actually used by the object, as cooking -> cook for faster simulation can drastically alter this mesh.

Is there a way to get the actual cooked mesh? I only need to read it, not alter it.

Source Link
Jay
  • 287
  • 4
  • 15

Unity Is there a way to get the actual optimised/cooked mesh that a mesh collider uses

I need to get the number of vertices a mesh collider's mesh has, I'm currently using

MeshCollider.sharedMesh.vertexCount; 

But seems to get the mesh that the collider initially uses and has a reference to. But this is not the mesh actually used by the object, as cooking -> cook for faster simulation can drastically alter this mesh.

Is there a way to get the actual cooked mesh? I only need to read it, not alter it.