Commit graph

63 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
191d8ef7ea Added test for bullet terrain sync with Mercator. 2017-09-01 13:19:27 +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
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
df77523d16 Properly handle mesh geometry. 2017-03-19 14:36:35 +01:00
Erik Ogenvik
8f1373d18c Apply z-offset correctly. 2017-02-14 17:57:40 +01:00
Erik Ogenvik
9d873cf079 Removed kinetic character controller.
The performance is just too bad, we can't use it with the amount of
characters we intend to support.
2017-01-31 23:05:46 +01:00
Erik Ogenvik
696033a8fd Added ability to jump. 2017-01-31 22:14:01 +01:00
Erik Ogenvik
95be39e268 Provide single method for setting velocity. 2017-01-29 20:45:23 +01:00
Erik Ogenvik
6b4302dc5f Let property handle tick rate.
And other smaller fixes to the physical domain.
2017-01-27 20:39:00 +01:00
Erik Ogenvik
93f3450ea5 Only send changed location data.
To try to keep the amount of data down.
2017-01-21 14:31:19 +01:00
Erik Ogenvik
c15a2f80cd Implemented more functioanlity for characters. 2017-01-04 23:25:46 +01:00
Erik Ogenvik
6eb030d29d WIP on using character controllers. 2017-01-03 23:05:16 +01:00
Erik Ogenvik
21f62ea137 Moved shape creation to geometry property.
This optimizes mesh handling, since only one btBvhTriangleMeshShape
instance will be created per type.
2017-01-02 23:52:49 +01:00
Erik Ogenvik
66d8c6145a Fixed some smaller issues. 2017-01-02 00:34:38 +01:00
Erik Ogenvik
fd5e3d79e1 Add support for mesh geometry.
For now we only allow this for static geometry.
All code is provisional; we should move parsing to the Geometry
property and make it reuse scaled meshes.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
0940522913 Improvements to terrain handling. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
900dd544ea Cleaned up some smaller issues. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
bd42f89527 Removed unused method. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
645cf8b975 Process dirty terrain areas per tick.
To spread the load.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
b4d3a994a3 Update terrain correctly. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
3238b0b94c Let the domain handle terrain mods.
We can't just listen to Move ops, since we now let the Domain
handle movement.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
8bea81fa21 Toggle perception in domain when it changes.
Though for now we'll never remove it once an entity becomes perceptive.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
fe709529fe Synchronize visibility methods in Domain.
So that they behave the same way.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
0a133c75bc Handle broadcasts earlier.
Instead of handling broadcasts when the op is dispatched, handle them
when the op is first added to the world router.
This way we can better handle the case where an entity is deleted, as well
as make away with storage of perceptibles entities in the world router.
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
7b19e67cb8 Make sure domain updates when terrain updates. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
f2cd26c18b Remove old code and scale with time. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
6c6a6eb0b0 Don't check visibility each tick. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
aa88be1ea7 Make sight checks more efficient. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
5d98e768c7 Refactored visibility handling.
To allow for better performance when scaling to larger worlds we can't keep
iterating though all entities when checking visibility.
Instead we now have the PhysicalDomain keep track of all entities that are
either observering something, or being observed.
Since Bullet already contains efficient structures for doing space partioning and
collision detections we'll resuse that for visibility checks.
Each entity now has a sphere of "visibility" with which each perceptive entity does
checks against.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
596ffad815 Added properties for geometry and angular factor.
For now we'll only support a limited set of geometry shapes.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
531a23bf2e Update bullet collision shape when bbox changes. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
45a794e87b Make it possible to detect non-moving entities.
Do this by keeping tabs on those that moved, and any that now have stopped.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
b037cd9b95 Handle change of solidity and mass. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
31876516a7 Removed unused field. 2016-12-15 18:27:42 +01:00