1 |
At least for purposes of generating wake effects for ground units, i consider the unit to be not completely submerged when unit height + pos.y > 0.
|
1 |
At least for purposes of generating wake effects for ground units, i consider the unit to be not completely submerged when unit height + pos.y > 0.
|
2 |
\n
|
2 |
\n
|
3 |
But this applies only to ground units; for subs and ships i guess you'll have to actually also substract the waterline, going to this:
|
3 |
But this applies only to ground units; for subs and ships i guess you'll have to actually also substract the waterline, going to this:
|
4 |
\n
|
4 |
\n
|
5 |
{{{isSubmerged = (pos.y + unit.height - unit.waterline) > 0 }}}
|
5 |
{{{isSubmerged = (pos.y + unit.height - unit.waterline) > 0 }}}
|
6 |
\n
|
6 |
\n
|
7 |
In the Java interface you can obtain these values like this:
|
7 |
In the Java interface you can obtain these values like this:
|
8 |
[url=http://ato.github.io/spring-ai-javadoc/com/springrts/ai/oo/UnitDef.html#getWaterline()]UnitDef.getWaterline[/url]
|
8 |
[url=http://ato.github.io/spring-ai-javadoc/com/springrts/ai/oo/UnitDef.html#getWaterline()]UnitDef.getWaterline[/url]
|
9 |
[url=http://ato.github.io/spring-ai-javadoc/com/springrts/ai/oo/UnitDef.html#getHeight()]UnitDef.getHeight[/url]
|
9 |
[url=http://ato.github.io/spring-ai-javadoc/com/springrts/ai/oo/UnitDef.html#getHeight()]UnitDef.getHeight[/url]
|
10 |
\n
|
10 |
\n
|
11 |
I assume the C++ interface has something extremely similar.
|
11 |
I assume the C++ interface has something extremely similar.
|
12 |
\n
|
12 |
\n
|
13 |
Height (and radius) are [url=https://github.com/ZeroK-RTS/Zero-K/issues/3433]not guaranteed[/url] to completely match the unit's collision volume.
|
13 |
Height (and radius) are [url=https://github.com/ZeroK-RTS/Zero-K/issues/3433]not guaranteed[/url] to completely match the unit's collision volume.
|
14 |
\n
|
14 |
\n
|
15 |
But
parsing
the
actual
colvol
is
an
absurdly
difficult
task
because
there's
no
unified
way
in
which
is
defined;
it's
influenced
by
model
file
(
in
different
formats
for
different
models;
s3o
and
3do
have
in-file
metadata,
assimp
models
have
modelname.
ext.
lua
metafiles)
,
unitdef
fields
(
colllisionVolumeScales
etc)
and
gadgetry
(
which
takes
some
customParams
and
applies
them
in
a
similar
way)
.
|
15 |
But
parsing
the
actual
colvol
[url=http://ato.
github.
io/spring-ai-javadoc/com/springrts/ai/oo/UnitDef.
html#getCollisionVolume(
)
]SEEMS
TO
BE
EXTREMELY
SIMPLE[/url]
[s]is
an
absurdly
difficult
task
because
there's
no
unified
way
in
which
is
defined;
it's
influenced
by
model
file
(
in
different
formats
for
different
models;
s3o
and
3do
have
in-file
metadata,
assimp
models
have
modelname.
ext.
lua
metafiles)
,
unitdef
fields
(
colllisionVolumeScales
etc)
and
gadgetry
(
which
takes
some
customParams
and
applies
them
in
a
similar
way)
.
[/s]
|
|
|
16 |
\n
|
|
|
17 |
(Note that that is per-unitdef and not per-unit; however ZK generally doesn't modify colvols for unit instances).
|
16 |
\n
|
18 |
\n
|
17 |
So
i
think
generally
height
should
be
good
enough.
|
19 |
But
i
think
generally
height
should
be
good
enough.
|