Comments (2)
There is a dedicated thread for Blocks at the jMonkeyEngine forum. You can ask all your questions there.
I don't quite understand the question, but I'll try to answer it generally.
It's not a good idea to mix render data and business data together. In JME terms, it would be the same as storing game data on Spatials. If you want to add data to blocks, don't put this data in the Block class. Store the data and link it with the block id.
The Block class is pure data. It has an id, type, shape, ... It contains the bare minimum info so Blocks know how to render this specific block. A block will always render in exactly the same way. Some blocks however have only differences in shapes, or models as you call it.
A wedge block for example, actually has 4 different shapes. One shape facing north, east, south and west. Each shape is represented by a different block object (eg. oak_log-wedge_north, oak_log-wedge_east, ...
). You could for example create an object (WedgeBlock
), that holds a collection of blocks (Collection<Block> models
) containing all the different shapes of a specific type. This way you have sort of a multi-model system.
For handling blocks, there is the Chunk class. A chunk is a way of organising and structuring block data. Internally it has optimizations for block data lookup etc.
A ChunkRepository is used to serialize and deserialize (save and load) block data using protocol buffers.
from blocks.
That makes sense. Thanks!
from blocks.
Related Issues (20)
- Update AppSettings on examples
- Create a FluidFilterDebug state
- Chunk should have a public constructor so that it supports inheritance HOT 3
- Chunk.createNode() crashes with an internal error HOT 3
- prioritize chunkmanager queue's
- BlocksConfig.setShapeRegistry() doesn't update the chunk mesh generator. [version 1.5.1] HOT 2
- All the blocks in a Chunk become the placed block HOT 2
- Add GSON support HOT 1
- Toon foam effect HOT 1
- Issue in class file, which is not present in github code. HOT 6
- Disable default blocks, shapes and types registeration HOT 5
- Both package services have shut down HOT 3
- Add debug grid
- Update wiki and jmonkey store
- Add cylinder block HOT 1
- Use Sio2 com.simsilica.thread.* classes for handling job work HOT 3
- Create liquid implementation
- Sub-blocks / Micro-blocks HOT 3
- getChunk method HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blocks.