asafbibas / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

BatchNodes cannot batch subclasses of Geometry #461

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
BatchNodes cannot batch Spatials that are subclasses of Geometry because in the 
gatherGeometries method, the Geometry class is explicitly checked for:

===
if (n.getClass() == Geometry.class) {
===

This is different from the behavior of GeometryBatchFactory.gatherGeoms, which 
uses instanceof instead.

Original issue reported on code.google.com by roja...@gmail.com on 7 Feb 2012 at 7:44

GoogleCodeExporter commented 8 years ago
it should check assignability instead @remy

Original comment by normen667 on 7 Feb 2012 at 12:09

GoogleCodeExporter commented 8 years ago
It's a known issue.
I did this at first because not all subclasses can be batched (particle 
emitters mostly), but now that there is the batchHint i guess i could use 
instanceof and default the batchHint of ParticleEmitter to never...

Original comment by remy.bou...@gmail.com on 7 Feb 2012 at 12:43

GoogleCodeExporter commented 8 years ago
Hm, ok. Generally its not a good idea to subclass Geometry anyway.. Except they 
are so special that they probably would not work for batching anyway, like 
terrain and particle emitters.. Setting the priority to "low", people who 
subclass Geometry to add some methods or data should use Controls anyway.

Original comment by normen667 on 7 Feb 2012 at 2:11

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
fixed

Original comment by remy.bou...@gmail.com on 22 Dec 2012 at 3:20

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r10040.

Original comment by remy.bou...@gmail.com on 22 Dec 2012 at 3:20