Commit graph

13 commits

Author SHA1 Message Date
Erik Ogenvik
664988645e Make all properties define type and optional name. 2018-04-27 23:12:15 +02:00
Erik Ogenvik
c23b322ead Use "add" and "remove" for flags.
Since it's more descriptive.
2018-04-25 20:15:28 +02:00
Erik Ogenvik
f09675cec6 Use "planted" for floating entities.
Entities that are "planted" on bodies of water are floating.
This does away with the "floating" mode.

To mark that entities should by default be floating when placed in
water the boolean property "floats" has been added.
2018-03-24 17:06:02 +01:00
Erik Ogenvik
4cabaed1c8 Add support for submerged entities.
An entity becomes "submerged" when it moves into a body of water.
Currently we only check if its y-position is below 0, but we aim to
provide better support for various water entities in the future.
2018-02-24 00:20:02 +01:00
Erik Ogenvik
dffd89db29 Handle floating entities.
These are like planted entities, but will float when placed in water.
2018-02-23 14:51:35 +01:00
Erik Ogenvik
98db86f324 Don't install property if not needed. 2018-02-20 22:26:27 +01:00
Erik Ogenvik
320480a9c4 Don't install "mode" twice. 2018-02-06 13:45:11 +01:00
Erik Ogenvik
569a928d62 Parse mode string into enum.
To make it more efficient and easier to handle.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
fd34c235e4 Remove "transforms" and "modespec" property.
These properties didn't work out when we moved to a physics based world.
Instead we've introduced the properties "planted-offset" and "planted-scaled-offset".
These properties takes a float and specified vertical offset for planted entities.

Likewise with "planted-rotation" which specifies a rotation applied for planted entities.
"active-rotation" keeps track of any applied rotation.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
137e455725 Added "density" property.
Density is in kg/m3. This property will update mass when size changes.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
9cf67cb412 Added tests for Mode and ModeSpec properties. 2016-06-26 20:17:18 +02:00
Erik Ogenvik
12a38b3d0f Added a mode specification property.
This property tells how the entity should behave when put into
different modes. Currently we only allow for specific transformations
to occur.

The mode specifications are registed in properties where "mode-" forms
a prefix, and the mode a suffix. For example, "mode-planted".
This also does away with the "plantable" property.
2016-06-26 20:17:18 +02:00
Erik Ogenvik
8cfe2ba0eb Altered signature to prevent ambiguity. 2016-06-26 20:13:31 +02:00