mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add ParticlesPreset
This commit is contained in:
parent
83ddbda90b
commit
9728c674fc
5 changed files with 47 additions and 14 deletions
20
src/presets/ParticlesPreset.cpp
Normal file
20
src/presets/ParticlesPreset.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include "ParticlesPreset.hpp"
|
||||
|
||||
#include "data/dv_util.hpp"
|
||||
|
||||
dv::value ParticlesPreset::serialize() const {
|
||||
auto root = dv::object();
|
||||
root["collision"] = collision;
|
||||
root["lighting"] = lighting;
|
||||
root["max_distance"] = maxDistance;
|
||||
root["acceleration"] = dv::to_value(acceleration);
|
||||
return root;
|
||||
}
|
||||
|
||||
void ParticlesPreset::deserialize(const dv::value& src) {
|
||||
src.at("collision").get(collision);
|
||||
src.at("lighting").get(lighting);
|
||||
if (src.has("acceleration")) {
|
||||
dv::get_vec(src["acceleration"], acceleration);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue