NEWBIE-question: Why names for TriMesh and CompositeMesh?

Hello,



I'm creating a procedurally generated object that consists of many CompositeMesh objects (to allow the use of triangle strips).

My problem is, that I'm having difficulties to give all the procedurally generated sub objects names.



My (noob-) question:

Why (in general) do TriMeshes and CompositeMeshes need to have a name?

In most applications those objects don't need names - at least not unique names. Simply specify some constant as a name (e.g. "generated"). Unique names are used by some mechanisms to identify objects, but I would consider this as 'bad pratice'…

(In jME the contructors without a name parameter are for internal use only, but the actual name is not really needed.)

Irrisor,



What would you suggest as "good practice" as a means to identify objects then?



darkfrog

That surely depends on the context:

  • For loading meshes from modeler files names are the best means as they are the only means to do it
  • For operations on the loaded scenegraph object references should be used in all cases as they impose no overhead and definately are unique within the VM
  • For persistency and networking support the persistence- resp. networking-layer should care for some unique ids, as they probably have to be unique amoung all clients



    Names should (except for the case where there is no other means for identifying objects) basically be used for showing them to user (gui) or developer (debugging), only.



    Err, and: that's only my oppinion! - caused by very much work on various tool support and persistency libraries though  :slight_smile: . . .

As you know, the PhysicsNetworking stuff is using the name values currently to identify objects.  I'm still trying to figure out a good alternative to this to keep from having too much negotiation between client and server at startup.



darkfrog

Ah, thanks for the replies.



Actually I thought, that these names would be used only when testing for collisions and stuff.

Now I know for sure - thanks to you two.



And of course performance consideration came up in my mind - but testing for strings should not cause that much delay, shouldn't it?