Commit graph

20 commits

Author SHA1 Message Date
Erik Ogenvik
3b1a2cb566 Make Domain an interface and provide two versions.
The "physical" world behaves like a standard world. The "void" world
however doesn't allow for neither movement nor sights.
2014-09-24 22:00:54 +02:00
Erik Ogenvik
bb7d004e64 Send Disappear when moving out of domain.
It would be better to use a Broadcast of the Disappear op though, but
that would require a change so that the location is encoded in the op
which will be broadcasted. Otherwise the WorldRouter will just use the
location of the entity as it is when the op is processed, which will be
wrong for this case.
2014-09-22 20:14:41 +02:00
Erik Ogenvik
d02ddca0d0 Moved collision detection to the Domain.
Collision detection should fully be handled by the domain, as should
sight checking.
The plan is to let the domain keep a separate structure of all collision
geometry, optimized in something like a quad or oct tree. Since the vast
majority of geometry is static, in the sense that it very seldom moves,
the Domain should keep a flat representation of all geometry, with
precomputer meshes for fast lookup.
Similarily it should keep a separate structure, or structures, for sight
checks.
And it should of course also use Bullet for collision detection.
2014-09-18 21:45:35 +02:00
Erik Ogenvik
3472e17327 Don't send appear ops when moving within range.
This is handled by the Move op that is broadcasted anyway. Any client
which receives a Move op from an entity that's previously not visible
knows that it's an entity that now has appeared within its sight, and
should handle it as an appear op.
Note that this breaks the protocol for older clients.
2014-09-15 21:11:36 +02:00
Erik Ogenvik
23b2b71986 Moved visibility change calculations to the domain.
Currently it just iterates over all child entities, but this should of
course be done more efficient, with spacial trees.
2014-09-15 21:11:36 +02:00
Erik Ogenvik
dbf1a9e345 Let the Domain determine broadcast visibility. 2014-09-15 21:11:36 +02:00
Erik Ogenvik
7060e51dfd Don't show anything above the domain.
Since the observer can't see that anyway.
2014-09-15 21:11:36 +02:00
Erik Ogenvik
2f3ab1da18 Let the Domain handle sights.
As any world can contain multiple domains, we let the domain handle the
sights calculations.
This is a change from how this previously was done, as previously
sight checks were only done for the top level World entity. This has
changes however, so that sights checks now are done for all entities.

When determining whether an entity can be seen, the system first checks
the size of the entity against the distance from the observer. If this
check fails, the system makes exceptions if the entity in case is
outfitted or wielded.
2014-09-15 21:11:36 +02:00
Erik Ogenvik
b171410b05 Let the domain be specified by a property.
This means that we only attach domains to entities that have the
"domain" property. The "land" entity type for example.
2014-09-15 21:11:35 +02:00
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Alistair Riddoch
2de0615c1f Fix singleton behaviour on destruction. 2010-08-25 00:10:35 +01:00
Alistair Riddoch
a07820946b Fill out the vtable for the base class of Domain. 2010-08-10 14:40:02 +01:00
Alistair Riddoch
035f25e5dd Start work on a test movement domain class for handling collisions with bullet. 2010-08-10 00:54:25 +01:00
Alistair Riddoch
ad328fb19c Don't crash if the world does not contain any terrain. 2010-03-28 23:56:19 +01:00
Alistair Riddoch
ab2730237c Replace messy terrain query calls with efficient ones like the library. 2009-08-21 03:21:26 +01:00
Alistair Riddoch
6e7dc87261 Hack in some support for floating. 2009-08-12 20:23:10 +01:00
Alistair Riddoch
a310077edf Implement "fixed" mode. 2009-08-05 19:00:31 +01:00
Alistair Riddoch
40fe88308c Don't depend on World interface, but query terrain property more directly 2009-05-14 00:01:51 +01:00
Alistair Riddoch
f7b062219a Make Domain a singleton, and add method to constrain height 2009-05-12 23:26:42 +01:00
Alistair Riddoch
e35a9d6873 Fill out the basics of the class 2009-05-08 15:48:19 +01:00