Experimental changes for F3DFloor export.

Requires GZDoom PR (coelckers/gzdoom#732).
This commit is contained in:
Marisa the Magician 2019-02-08 14:12:16 +01:00
commit 65222b474c
12 changed files with 157 additions and 31 deletions

View file

@ -264,10 +264,10 @@ Class BioGel : Actor
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (FRandom[GES](-1,1),FRandom[GES](-1,1),FRandom[GES](-1,1)).unit()*FRandom[GES](1,3);
Vector3 spos = pos;
if ( atplane == 1 ) spos += Normal*2;
Vector3 spos = pos+normal*2*scale.x;
let s = Spawn("BioSpark",spos);
s.vel = pvel;
if ( normal != (0,0,0) ) s.vel += normal*2;
}
}
if ( deadtimer <= -1 ) return;
@ -286,6 +286,7 @@ Class BioGel : Actor
// align self to what surface was hit, currently does not support 3d floors + slopes properly
virtual void AlignSelf()
{
F3DFloor ff;
bINTERPOLATEANGLES = false;
bHITOWNER = true;
A_NoGravity();
@ -397,9 +398,17 @@ Class BioGel : Actor
}
else if ( BlockingFloor )
{
// find closest 3d floor for its normal
for ( int i=0; i<CurSector.e.ffloors.Size(); i++ )
{
if ( !(CurSector.e.ffloors[i].top.ZAtPoint(pos.xy) ~== floorz) ) continue;
ff = CurSector.e.ffloors[i];
break;
}
if ( ff ) normal = -ff.top.Normal;
else normal = BlockingFloor.floorplane.Normal;
atsector = BlockingFloor;
atplane = 0;
normal = BlockingFloor.floorplane.Normal;
pitch = asin(-normal.z);
angle = atan2(normal.y,normal.x);
roll = FRandom[GES](0,360);
@ -409,9 +418,17 @@ Class BioGel : Actor
}
else if ( BlockingCeiling )
{
// find closest 3d floor for its normal
for ( int i=0; i<CurSector.e.ffloors.Size(); i++ )
{
if ( !(CurSector.e.ffloors[i].bottom.ZAtPoint(pos.xy) ~== ceilingz) ) continue;
ff = CurSector.e.ffloors[i];
break;
}
if ( ff ) normal = -ff.bottom.Normal;
else normal = BlockingCeiling.ceilingplane.Normal;
atsector = BlockingCeiling;
atplane = 1;
normal = BlockingCeiling.ceilingplane.Normal;
pitch = asin(-normal.z);
angle = atan2(normal.y,normal.x);
roll = FRandom[GES](0,360);