Weapos Rejiggered
Modified weapon scripts to eliminate specialized projectile behavior - allows charged weapons to have projectiles and modify weapon stats when charged Added machine gun weapon & VFX Moved third party code to Plugins folder to improve compile times
This commit is contained in:
parent
2a0fe34611
commit
dbc522a224
2105 changed files with 7033 additions and 1141 deletions
|
|
@ -1,49 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Msagl.Core.Geometry;
|
||||
using Microsoft.Msagl.Core;
|
||||
|
||||
namespace Microsoft.Msagl.Routing.Visibility {
|
||||
internal class ObstacleSideComparer : IComparer<SegmentBase> {
|
||||
|
||||
readonly LineSweeperBase lineSweeper;
|
||||
|
||||
|
||||
internal ObstacleSideComparer(LineSweeperBase lineSweeper) {
|
||||
this.lineSweeper = lineSweeper;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// the intersection of the sweepline and the active segment
|
||||
/// </summary>
|
||||
Point x;
|
||||
|
||||
|
||||
public int Compare(SegmentBase a, SegmentBase b) {
|
||||
ValidateArg.IsNotNull(b, "b");
|
||||
var orient = Point.GetTriangleOrientation(b.Start, b.End, x);
|
||||
switch (orient) {
|
||||
case TriangleOrientation.Collinear:
|
||||
return 0;
|
||||
case TriangleOrientation.Clockwise:
|
||||
return 1;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal void SetOperand(SegmentBase side) {
|
||||
x = IntersectionOfSideAndSweepLine(side);
|
||||
}
|
||||
|
||||
internal Point IntersectionOfSideAndSweepLine(SegmentBase obstacleSide) {
|
||||
var den = obstacleSide.Direction * lineSweeper.SweepDirection;
|
||||
Debug.Assert(Math.Abs(den) > ApproximateComparer.DistanceEpsilon);
|
||||
var t = (lineSweeper.Z - obstacleSide.Start * lineSweeper.SweepDirection) / den;
|
||||
return obstacleSide.Start + t * obstacleSide.Direction;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue