Interaction with batch generate world


#1

How can I add an eventlistener for mouse clicks on a batch generated world, and on its objs in h3d.scene


#2

You create an h3d.scene.Interactive with a given shape in order to detect clicks. You can look at the Interactive sample that showcase mixing 2D and 3D interactives.


#3

But that has no interaction with batched world, as all objects there are optimized together. So I cannot use batched generated world like in the world example, if I want to have interactions there?


#4

You can use batched world, and then still have several Interactive (one per object). Batching is good for GPU performances, Interactive handling does not involves GPU, mostly CPU but yes that requires a bit of by-hand management to put them at the right place wrt your batched objects.