Generalized hitnormal functions (where possible).
This commit is contained in:
parent
1d759a109a
commit
b1683dae8e
24 changed files with 206 additions and 785 deletions
|
|
@ -424,24 +424,9 @@ Class FancyConfetti : SWWMNonInteractiveActor
|
|||
double ang = atan2(dir.y,dir.x);
|
||||
double pt = asin(-dir.z);
|
||||
LineTrace(ang,dist,pt,TRF_THRUACTORS|TRF_THRUHITSCAN|TRF_ABSPOSITION,newpos.z,newpos.x,newpos.y,d);
|
||||
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;
|
||||
}
|
||||
if ( (d.HitType != TRACE_HitNone) && (d.HitType != TRACE_HitFloor) )
|
||||
{
|
||||
Vector3 hitnormal = SWWMUtility.GetLineTraceHitNormal(d);
|
||||
dist -= d.Distance;
|
||||
// should only happen if we bounced
|
||||
dir = d.HitDir-(1.2*hitnormal*(d.HitDir dot hitnormal));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue