It looks like you're new here. If you want to get involved, click one of these buttons!
It doesn’t appear that blocks in voxel volumes can be solid in the sense that they interact with the physics engine (i.e. you can’t stand on them).
The attached project may be overkill for demonstrating this (I’m sure @dave1707 could do it in under 90 lines ) but it was what I had at hand.
The project shows a character either falling onto regular voxel blocks and being supported by them, or falling onto volume blocks and passing right through them; by default it starts with volume blocks, and to switch to regular voxel blocks comment out the line indicated around 42 or 43:
--comment this out to set voxels without a volume
if true then return end
Is there a way to make volume blocks solid so you can stand on them?
Comments
@UberGoober Not sure if this is anything you can use, I made this long ago when I was playing with Voxels. It’s the Frog moving across some random Voxel terrain.
@dave1707 I think in that example you’re using voxels directly and not as part of a volume. I’m specifically talking about voxels in a volume.
@UberGoober I'll look up volume and see what that's about. I don't think I've messed with it or else I forgot about it.
I forget where the original of this is, but this project contains many versions of a thing you did with volumes.
@UberGoober I totally forgot about the volume:set when creating those cubes. But I guess it would be the same thing I’m doing with the Frog. I’m recalculating where a Voxel would be and staying just above it. If a block isn’t a solid object then create a table of block positions and use that to position anything around it. Or you could create a physics wall to cover any open voxel edge.
Those seem like good alternate ways of creating solid surfaces.
It’s just odd to me that the base voxel system and the volume system use the exact same block objects, not to mention that (one assumes) the volume system is built on top of the base voxel system, but the blocks are solid in one case and not in the other case.
@John, given that voxel blocks have the properties necessary to be solid in the base voxel system, is there any way of activating those properties when used in volumes—and not for nothing, having solid volume-based blocks would greatly increase their usefulness in games, given that you can independently rotate and position volumes freely, and you can’t do that with the base voxel system.
I've been studying block usage for a while, and I've noticed that the difference between volume and blocks is that the former only provides the same visual appearance as the latter, but doesn't store the latter's behavioral properties. In other words, a volume model does not include physical simulations.
Since all voxel blocks can be scripted, it seems like it might not be too hard to write a script that automatically attaches a physics body cube to a block, but @John warns in his documentation that scripting should be used only sparingly, because it eats up memory like crazy.
In your experience, would a script that adds rigidbodies to every voxel just figuratively explode Codea?
@UberGoober You get the point. Indeed, the complexity of a custom block can affect the stability of your application. The more complex a block is, the more resource intensive it is and the more likely it is to crash. I just collected some voxel system documentation and experimented with it, and it's a great visualization tool. But perhaps because of the steep learning curve and the lack of documentation, there aren't many user-initiated projects. You can see the experimental code I posted earlier on voxel systems. In fact, the rigidbody is the default configuration for each voxel block (except for glass and water, which are two types of blocks that can pass right through, perhaps without attaching to the rigid body) , since each voxel block must be able to be mined, can be an obstacle.
Below is an example, you can change the radius to see the max value
@UberGoober Don't worry about the characters, they're just comments. I went through almost all the voxel-related articles on the forum, including yours, and downloaded and experimented with your projects to learn how to use your resources (make sure you have an info.plist file, for example)
And some interesting volume models, like castles, bears, soldiers with shields, etc. , I don't know if you created them or someone else did, but they inspired me a lot.
@UberGoober If you double tap on the characters and then highlight them, you’ll get a popup bar that has translate on it. Use that to read them. I use translate for any text I get that’s not English. A lot of discussions will show up here in foreign languages and I select some of the text to translate it before I delete them.
@UberGoober The info.plist file is needed in your custom asset folder, at first, I dont know this rule, and my custom block asset cannot take effect, after read your post, I got it.
Pls try to change these line to below:
If it still dont show the sphere, make the radius more smaller untill it can show.
In your device, the plane cannot be drawn in one piece, Means we're running out of memory.
Why did you include a grass.update function and a grass.destroy function—they don’t seem to be called ever?
I have to say it’s a little stunning how fast the memory runs out with scripted blocks—without scripted blocks Codea can render a volume containing a 400x400x400-voxel box without any trouble.