Access geometry in Cubes plugin

@destroflyer is there any way to access the geometry of a specific cube?

My use case is that I want to implement a drop item using the same texture as the block. To do this I need the Geometry so I can animate it to float. I created a CubeGeometryFactory adapted from your code that creates the mesh. The problem is that the center point of the geometry is somehow offset and when it rotates it looks like it is revolving around the axis instead of spinning.

Also, access to the geometry would allow me to implement sand with a mass of 1 so that it falls.

Hope that makes sense.

Love the plugin.

Any help is appreciated.

I don’t really understand what you want to achieve, sorry. :smiley:
There is no single geometry of a specific cube, all blocks of a chunk are merged into one large geometry that uses a texture atlas. That’s the whole point of the library I guess.
There are methods like getGeometry_Opaque/Transparent in the chunk control class - But as I said, these are the geometries for the whole chunk. If you want to implement specific behaviors like sand blocks, that fall, you would have to use another approach than Cubes - I mean, using separate geometries for those or writing your own framework, that operates on the vertices or uses shaders to animate a bit.
Cubes is a very simple framework for people, who want to quickly insert a block world into their application (without the need to look into optimization or how the stuff is handled on a low level). But anything, that needs more features, will have to use an own framework that is specifically adapted to the programs needs.
Thanks for using the plugin though and for your input :smiley:

I’ve come to understand that it’s just one big mesh since posting this.

I am trying to animate individual blocks.

I have created a CubeGeometryFactory that uses code from the MeshOptimizer to create individual geometries from the texture atlas. I think I am going to remove the block from the BlockTerrain and insert the new Geometry that can be animated at that spot to create the illusion desired.

I’m new to game development so your framework has really helped me get something fun started without getting discouraged first. I’ve developed applications for 10 years but game development is truly a different animal.

Thanks for replying and thanks for the framework!

@destroflyer I hope you can help me with one last problem.

In order to place a geometry in the exact location of the block I need to get the the local translation vector given the Vector3Int block location.

I can’t find a utility anywhere in the framework for this. I’ve tried several things without any luck.

Any help is appreciated!

Nevermind, I got it!