Lot of bugfixes
* Adding clipper to generate the terrain's negative powder-contour offset. * Fixing RDB issues (fracture, active trigger, performances) * Fixing blood emission * Fixing the freezing formula on liquids * Fixing Steve spawning due to a missed test. * Reaction table properly build
This commit is contained in:
1 parent
a34f42d53e
commit
00a9c1c26c
48 files changed
+5799
-435
No files matched your search
+21
-1
@@ -69,8 +69,8 @@ void main() {
|
||||
if (e.st.x != 0 && (fc & 7) >= 3) gFlash = (fc & 8) != 0 ? 0xFF0000u : 0xFFFFFFu;
|
||||
}
|
||||
gFade = (e.st.x == 1 || e.st.x == 2 || e.st.x == 3) ? 0.0 : clamp(e.ex10.w, 0.0, 1.0); // INVISIBILITY active (a prop's ex8.xy is the hit point of its leak) (00b015d0 case 0x51: its sprites are told not to draw)
|
||||
{ vec2 pv = prevpos[h0.x].xy; if (distance(pv, e.a.xy) < 10.0) e.a.xy = mix(pv, e.a.xy, ctrl.view.z); } // drawn between the last two ticks
|
||||
const bool rigid = (e.st.w & (32 | 64)) != 0; // drawn rotated by the body angle in a.z (64: the part of a Verlet chain, angle in ex7.x)
|
||||
if (!rigid || (e.st.w & 64) != 0) { vec2 pv = prevpos[h0.x].xy; if (distance(pv, e.a.xy) < 10.0) e.a.xy = mix(pv, e.a.xy, ctrl.view.z); }
|
||||
bool mobile = e.st.x != 0 && !rigid;
|
||||
bool moving = mobile && abs(e.a.z) > 0.08;
|
||||
ivec4 an = moving ? hw : hi; // tex, w, h, frames | wait << 16
|
||||
@@ -88,6 +88,26 @@ void main() {
|
||||
for (int k = int(gl_LocalInvocationID.x); k < min(bhdr.x, 1024); k += 64) if (bodies[k].i.y == int(h0.x) && (bodies[k].i.z & 2) == 0) sBody = k;
|
||||
barrier();
|
||||
const int body = (e.st.w & 64) == 0 && w * h <= 4096 ? sBody : -1;
|
||||
if ((e.st.w & 64) == 0 && sBody >= 0) {
|
||||
// Interpolate one rigid pose. Mixing the old origin with the current
|
||||
// angle moves the image away from its collision body, particularly
|
||||
// when the sprite anchor is far from the centre of mass.
|
||||
const vec4 previous = prevpos[h0.x];
|
||||
const vec2 centre = bodies[sBody].p.xy;
|
||||
const float ca = cos(e.a.z), sa = sin(e.a.z);
|
||||
const vec2 offset = e.a.xy - centre;
|
||||
const vec2 local = vec2(ca * offset.x + sa * offset.y, -sa * offset.x + ca * offset.y);
|
||||
const float cp = cos(previous.z), sp = sin(previous.z);
|
||||
const vec2 previousCentre = previous.xy - vec2(cp * local.x - sp * local.y, sp * local.x + cp * local.y);
|
||||
// The solver clamps translation to 20 pixels/tick. Larger changes
|
||||
// are teleports and should be drawn immediately.
|
||||
if (distance(previousCentre, centre) <= 20.01) {
|
||||
const float delta = atan(sin(e.a.z - previous.z), cos(e.a.z - previous.z));
|
||||
e.a.z = previous.z + delta * ctrl.view.z;
|
||||
const float ci = cos(e.a.z), si = sin(e.a.z);
|
||||
e.a.xy = mix(previousCentre, centre, ctrl.view.z) + vec2(ci * local.x - si * local.y, si * local.x + ci * local.y);
|
||||
}
|
||||
}
|
||||
int rf = (pc.frame / wait + int(h0.x)) % max(frames, 1);
|
||||
const float ang = (e.st.w & 64) != 0 ? e.ex7.x : e.a.z;
|
||||
const float sx = (e.st.w & 64) != 0 && e.ex7.y > 0.0 ? e.ex7.y : 1.0; // a part stretched along its length (the segments of a limb: IKLimbComponent)
|
||||
|
||||
Reference in new issue
Block a user