raze-gles/polymer/eduke32/samples/spriteclip.txt

64 lines
2.9 KiB
Plaintext
Raw Normal View History

Sector-like clipping for sprites
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sprite picnums can be assigned to a bunch of connected sectors so that
clipping against these sprites will work as if it is carried out on the
associated sectors. For this, a file named _clipshape_.map must be present
at program start time that must be built to certain rules:
* Every sector that contains at least one white wall is considered an "outer" sector.
Conversely, sectors with only red walls are "inner" (clipping) sectors.
* Sprites in outer sectors are ignored.
* To associate a picnum with a bunch of sectors, place a sprite with that picnum in
some inner sector of the lot. At the end stage of editing, align the sprite so that
the model matches the sectors well. See samples/_clipshape_.map for examples.
* A picnum may be associated with many "layers" (called "indices" in the code) of
sectorwork. This serves two purposes: one is to enable more complex shapes than
would be possible using only one sector. The other reason is that a sprite may differ
in orientation in such a way that it is not possible to calculate one from another.
In particular, floor-aligned sprites and face/wall sprites should have their own
sector versions (of course only if they are intended to be used in a particular
orientation).
* The sprites in inner sectors should point northward and should not have any orientation-
changing bits like x-flip or y-flip set. Setting centering is permitted, though.
* A set of picnums can be aliased to a layer. This is useful if "secondary" picnums
are going to be used as decoration, for example. For this, set lotags and/or hitags
of any wall of an inner sector to the picnums to be aliased to values greater than 0.
If only one of them is set, it is taken as one picnum, otherwise as a both-sided inclusive
range, the order doesn't matter. The pigcop tank is present as an example in
samples/_clipshape_.map.
* The inner sectors of a given layer must be all interconnected (not necessarily directly)
and for a layer there must be a unique outer sector.
* Making the floor or ceiling of a sector parallaxed will disable clipping on it in certain
ways. Normally, there are four horizontal clipping planes (see the round table for an
example). Making the ceiling parallaxed disables the upper two, and analogously for the floor.
* Making a sprite transparent will disable rotation around its origin to match a given sprite's
angle. Use it on models with rotational symmetry.
Notes:
------
* Only clipmove and getzrange are changed, so that hitscan weapons will still behave the old way.
* The clipping will not change with rendering modes or options.
Known bugs:
-----------
* Flipping doesn't work correctly
* The behaviour in Mapster32 and EDuke32 differs slightly, see the
round table arrangement in the test area of _clipshape_.map
--Helixhorned