Possibly dumb question about where to store coordinates

I’m about to embark on a project which is a very very simple CAD type system. Think Sketchup but very very limited.

Never used babylon.js before, and I’m unsure about where to put the ‘source of truth’ for object coordinates.

  1. Put all coordinates in a single completely babylon.js agnostic data structure. (possibly ref object x,y,z positions directly into this data structure). This is basically the naked position database.

  2. But all babylon.js meshes in a data structure so I know where everything can be accessed (is this available already in babylon.js?). This is a mesh database. To search coordinates I’d have to loop over objects and look at their coordinates.

  3. suggestions welcome

I’m not sure but I think the most common actions I’ll be taking is searching for object positions within a region.

I have a feeling that both ways are doable but one will be hugely more inefficient than the others.

Hello and welcome!
I feel like if searching coordinates needs to be fast you may end up having an agnostic db to make sure it is fast to search

So this is not a common babylon.js thing? Things like relative positions and collisions are handled in other ways?

collisions are handled with local space coordinates (hence directly on each meshes)

by the way, what operations do you need to do with coordinates? do you need world or local space values?

I’m not sure if I need local anything (maybe for animations). It will be a CAD program for designing very simple shelves within given dimensions. So I have to know where things connect, where they overlap, etc. There will probably be resizing animations.

well in this case it could be worth a try just using the meshes as your DB