mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add rigidbody:is_selectable, :set_selectable
This commit is contained in:
parent
04c367b476
commit
4b4026b028
6 changed files with 26 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ dv::value Rigidbody::serialize(bool saveVelocity, bool saveBodySettings) const {
|
|||
}
|
||||
bodymap["mass"] = mass;
|
||||
bodymap["elasticity"] = elasticity;
|
||||
bodymap["selectable"] = selectable;
|
||||
}
|
||||
return bodymap;
|
||||
}
|
||||
|
|
@ -37,6 +38,7 @@ void Rigidbody::deserialize(const dv::value& root) {
|
|||
root["damping"].asNumber(hitbox.linearDamping);
|
||||
root["mass"].asNumber(mass);
|
||||
root["elasticity"].asNumber(elasticity);
|
||||
root["selectable"].asBoolean(selectable);
|
||||
}
|
||||
|
||||
template <void (*callback)(const Entity&, size_t, entityid_t)>
|
||||
|
|
@ -55,6 +57,7 @@ void Rigidbody::initialize(
|
|||
) {
|
||||
mass = def.mass;
|
||||
elasticity = def.elasticity;
|
||||
selectable = def.selectable;
|
||||
sensors.resize(def.radialSensors.size() + def.boxSensors.size());
|
||||
for (auto& [i, box] : def.boxSensors) {
|
||||
SensorParams params {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue