Commit graph

129 commits

Author SHA1 Message Date
Erik Ogenvik
daebcd09fa Fixed keyboard slip. 2018-04-28 13:02:42 +02:00
Erik Ogenvik
90001d1a2c Use correct masks. 2018-04-27 23:12:15 +02:00
Erik Ogenvik
664988645e Make all properties define type and optional name. 2018-04-27 23:12:15 +02:00
Erik Ogenvik
cecee29236 Fixed issue with bbox scaling.
We can't use setLocalScaling since it doesn't seem to work well with
some shapes (such as mesh). We should use uniform scaling anyway.
2018-04-27 23:12:15 +02:00
Erik Ogenvik
d7900bebfb Added property for perception of sights.
Instead of having it determined by sending looks ops.
It's a float value since there's a possibility to apply is as a factor
of the default view distance.
2018-04-25 20:15:28 +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
ba777f05d7 Make characters stick to the ground.
This is done through the "step_factor" property.
2018-04-21 20:35:07 +02:00
Erik Ogenvik
dec9e5a36e Cleaned up memory leaks.
Which prevented the physical domain integration tests from running on
build servers with constrained memory.
2018-04-19 10:19:35 +02:00
Erik Ogenvik
a8e21ddfc5 Added more sphere options.
Where radius is determined by selected axis.
2018-04-15 13:29:49 +02:00
Erik Ogenvik
10a3ab8dfe Removed unnecessary function. 2018-03-29 14:42:25 +02:00
Erik Ogenvik
45432ef8ef Attached entities inherits free mode when changed. 2018-03-25 22:39:29 +02:00
Erik Ogenvik
d119d2f617 Move planted entities along. 2018-03-25 21:53:12 +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
070b0a6c85 Check for where to plant entities.
If an entity is in mode "planted" we should check for any existing
planted entities below it, to see if we should add it on top of them, or
on top of the terrain.
2018-03-23 23:07:09 +01:00
Erik Ogenvik
166a5aaba3 Initial work on planting entities. 2018-03-23 19:22:35 +01:00
Erik Ogenvik
ed0878dd5f Added missing spinning friction check. 2018-03-12 18:56:30 +01:00
Erik Ogenvik
ad8e6e9134 Support older versions of Bullet.
"spinning friction" is nice to have, but not necessary.
2018-03-12 18:43:28 +01:00
Erik Ogenvik
380b4e21d9 Added rolling and spinning friction. 2018-03-12 18:15:20 +01:00
Erik Ogenvik
72e7a5e0c2 Move resting entities along.
I.e. when an entity is moved, and there are other entities resting on
top of it, move them along too.
2018-03-09 14:37:11 +01:00
Erik Ogenvik
065505b07e Added compound shapes.
These are useful when you want to represent concave shapes with more
fidelity (since they otherwise would be represented by a convex hull
when on "free" mode).
2018-03-07 15:22:13 +01:00
Erik Ogenvik
8913f454dd Use convex hulls for moving meshes.
GImpact is just too slow, and we don't need the fidelity.
2018-03-06 16:30:08 +01:00
Erik Ogenvik
63d36617ed Fixed issues with terrain mods and moving entities. 2018-03-05 22:14:58 +01:00
Erik Ogenvik
98166a57e0 Added support for free mesh geometry.
We do this by using the GImpact shapes. These work, but are resource
intensive. So make sure you don't use too many of these in free mode.
This isn't thouroughly researched though. It might be worth looking into
btCollisionHull, or to alter some of the parameters to fine tune the
simulation.
2018-03-05 12:42:10 +01:00
Erik Ogenvik
f21e7509dc Avoid segfaults when removing water bodies. 2018-02-28 11:43:19 +01:00
Erik Ogenvik
d0585e9eb8 Enabled oceans and lakes.
Through the "water_body" property. An entity which has this is a water
body. If there's a bbox the entity is a lake (bounded), otherwise it's
an ocean (infinite bounds).
2018-02-28 09:34:05 +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
c19576d694 Added property for jumping, "speed-jump".
Entities without it cannot jump.
2018-02-20 23:08:14 +01:00
Erik Ogenvik
2590f4ded9 Fixed issue with invalid inertia for meshes. 2018-02-20 22:26:27 +01:00
Erik Ogenvik
0bc9450cff Standarize on double precision. 2018-02-12 09:46:30 +01:00
Erik Ogenvik
ca2abb94b5 Refactor how movement is handled and sent.
We've introduced the properties "speed-ground", "speed-water" and
"speed-flight" which specifies the top speed in m/s for each medium.

The "propel" attribute is now normalized, since it's multiplied with the
applicable top speed (depending on the medium, although currently we
only use the ground speed, TODO).
2018-02-11 23:22:20 +01:00
Erik Ogenvik
a3560c817f Use "propel" property for movement.
Clients shouldn't set the "velocity", instead setting the "propel"
property.
2018-02-11 21:15:35 +01:00
Erik Ogenvik
38433c11d0 Remove "creator" hacks. 2018-02-06 13:45:10 +01:00
Erik Ogenvik
99640d26aa Use a left hand coord system. 2018-02-06 13:45:10 +01:00
Erik Ogenvik
0acdd29674 Properly take offset into account when placing.
Fixes an issue with unsynced bullet representations when an entity was
moved.
2018-01-11 17:07:05 +01:00
Erik Ogenvik
eb2bb200e5 Clean up and remove unused structs. 2017-07-25 23:40:39 +02:00
Erik Ogenvik
6e6fe3b9b6 Handle (dis)appear ops when moving between locs. 2017-06-27 21:06:07 +02:00
Erik Ogenvik
b40c613a78 Improve handling of broadcasts.
Use the domains for determining broadcasts.
2017-06-24 21:47:43 +02:00
Erik Ogenvik
b9cdbbbd1a Handle inventory domain better. 2017-06-12 18:01:52 +02:00
Erik Ogenvik
e56200cfde Reset vertical movement if grounded when stopping. 2017-05-28 15:42:52 +02:00
Erik Ogenvik
b71125cd84 Remove code that tries to step up automatically.
This is really tricky to get right; we'll leave it out and instead rely
on clients sending commands to step up when they need to.
2017-05-28 15:41:54 +02:00
Erik Ogenvik
2c842050c0 Read property from correct entity. 2017-05-28 14:27:06 +02:00
Erik Ogenvik
be920d8e27 Use our own Bullet world class.
The main difference beeing that we only sync world state after all
substeps have been handled, which fit our use case well.
2017-05-28 00:13:41 +02:00
Erik Ogenvik
737005b624 Added step-factor to control stepping.
It's a float property which determines how high the entity can step,
relative to its height.
2017-03-24 17:19:10 +01:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Erik Ogenvik
df77523d16 Properly handle mesh geometry. 2017-03-19 14:36:35 +01:00
Erik Ogenvik
7c9f0da03a Prevent mobiles from slipping on slopes.
Any mobile should manage to cling onto slopes.
2017-03-16 21:32:05 +01:00
Erik Ogenvik
08c9ac0ded Fixed issue with observers not seeing themselves. 2017-03-16 21:12:17 +01:00
Erik Ogenvik
0b9fcf5c83 Control CCD better. 2017-03-15 22:28:44 +01:00
Erik Ogenvik
fe77a2d268 Always step with 60 hz. 2017-03-15 21:16:46 +01:00