fenomas / noa

Experimental voxel game engine.
MIT License
612 stars 87 forks source link

How to retrieve the mesh of a block from the registry? #27

Closed Nesh108 closed 7 years ago

Nesh108 commented 7 years ago

Hey!

I am making the player carry some items and I would like to know how to retrieve the base mesh of a specific block from the registry?

Something like:

let water_mesh = noa.rendering.makeMeshInstance(noa.registry.getBlockMesh(WaterId), false)
let flower_mesh = noa.rendering.makeMeshInstance(noa.registry.getBlockMesh(FlowerId), false);

In this way I can resize it and attach it to the player's hand.

Nesh108 commented 7 years ago

EDIT: I found out for blockMesh

noa.rendering.makeMeshInstance(noa.registry._blockMesh[WaterId], false);

How about other blocks?