Generalized hitnormal functions (where possible).
This commit is contained in:
parent
1d759a109a
commit
b1683dae8e
24 changed files with 206 additions and 785 deletions
|
|
@ -215,22 +215,7 @@ Class mkBloodDrop : SWWMNonInteractiveActor
|
|||
LineTrace(ang,spd,pt,TRF_THRUACTORS|TRF_THRUHITSCAN|TRF_ABSPOSITION,newpos.z,newpos.x,newpos.y,d);
|
||||
if ( d.HitType != TRACE_HitNone )
|
||||
{
|
||||
Vector3 hitnormal = -d.HitDir;
|
||||
if ( d.HitType == TRACE_HitFloor )
|
||||
{
|
||||
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.top.Normal;
|
||||
else hitnormal = d.HitSector.floorplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitCeiling )
|
||||
{
|
||||
if ( d.Hit3DFloor ) hitnormal = -d.Hit3DFloor.bottom.Normal;
|
||||
else hitnormal = d.HitSector.ceilingplane.Normal;
|
||||
}
|
||||
else if ( d.HitType == TRACE_HitWall )
|
||||
{
|
||||
hitnormal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit();
|
||||
if ( !d.LineSide ) hitnormal *= -1;
|
||||
}
|
||||
Vector3 hitnormal = SWWMUtility.GetLineTraceHitNormal(d);
|
||||
newpos = d.HitLocation+hitnormal;
|
||||
}
|
||||
else newpos = level.Vec3Offset(newpos,vel);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue