Ejemplo n.º 1
0
        public GateHit(GateData data, float height) : base(ItemType.Gate)
        {
            var data1   = data;
            var height1 = height;

            var halfLength = data1.Length * 0.5f;
            var radAngle   = MathF.DegToRad(data1.Rotation);
            var sn         = MathF.Sin(radAngle);
            var cs         = MathF.Cos(radAngle);

            LineSeg0 = new LineSeg(
                new Vertex2D(
                    data1.Center.X - cs * (halfLength + PhysicsConstants.PhysSkin),
                    data1.Center.Y - sn * (halfLength + PhysicsConstants.PhysSkin)
                    ),
                new Vertex2D(
                    data1.Center.X + cs * (halfLength + PhysicsConstants.PhysSkin),
                    data1.Center.Y + sn * (halfLength + PhysicsConstants.PhysSkin)
                    ),
                height1,
                height1 + 2.0f * PhysicsConstants.PhysSkin,
                ItemType.Gate
                );

            LineSeg1 = new LineSeg(
                new Vertex2D(LineSeg0.V2.X, LineSeg0.V2.Y),
                new Vertex2D(LineSeg0.V1.X, LineSeg0.V1.Y),
                height,
                height + 2.0f * PhysicsConstants.PhysSkin,
                ItemType.Gate
                );

            TwoWay = false;
        }
Ejemplo n.º 2
0
 public GateHitGenerator(GateData gateData)
 {
     _gateData = gateData;
 }
Ejemplo n.º 3
0
 public GateMeshGenerator(GateData data)
 {
     _data = data;
 }