Code Monkey home page Code Monkey logo

Comments (3)

Phyronnaz avatar Phyronnaz commented on May 18, 2024

Already doable. I'm going to create a wiki page to explain how to do it.

Edit: With the wiki you should be able to do it

from voxelplugin.

mhoangvslev avatar mhoangvslev commented on May 18, 2024

@Phyronnaz I believe that you are referring to this page. I don't see where you define destructibility of a given zone. If it is not the case, could you make more extensive documenting?

from voxelplugin.

Phyronnaz avatar Phyronnaz commented on May 18, 2024

There are 2 ways of doing it:

  • Setting the values of the voxels to something higher than 1. This is quite easy to do, however it won't look great as it would deform the terrain
  • Setting a material to the voxels and creating a custom edit tool that checks whether the edited voxel contains this material (each voxel has 2 material blended by an alpha value). If it does, the edit strength is decreased.

To create this tool, I suggest you to copy/paste the SetValueProjection function, and replace this (and the similar call below) by this:

float CurrentStrength = Stength;
if (World->GetMaterial(Point).GetMax() /*Get the most visible material*/ == 255 /*Index of the material*/)
{
	CurrentStrength /= 10;
}
World->SetValue(Point, FMath::Clamp(World->GetValue(Point) - CurrentStrength, MinValue, MaxValue));

(not tested)

from voxelplugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.