Пример #1
0
        public SpinnerHit(SpinnerData data, float height) : base(ItemType.Spinner)
        {
            var halfLength = data.Length * 0.5f;

            var radAngle = MathF.DegToRad(data.Rotation);
            var sn       = MathF.Sin(radAngle);
            var cs       = MathF.Cos(radAngle);

            var v1 = new Vertex2D(
                data.Center.X - cs * (halfLength + PhysicsConstants.PhysSkin),                 // through the edge of the
                data.Center.Y - sn * (halfLength + PhysicsConstants.PhysSkin)                  // spinner
                );
            var v2 = new Vertex2D(
                data.Center.X + cs * (halfLength + PhysicsConstants.PhysSkin),                 // oversize by the ball radius
                data.Center.Y + sn * (halfLength + PhysicsConstants.PhysSkin)                  // this will prevent clipping
                );

            LineSeg0 = new LineSeg(v1, v2, height, height + 2.0f * PhysicsConstants.PhysSkin, ItemType.Spinner);
            LineSeg1 = new LineSeg(v2.Clone(), v1.Clone(), height, height + 2.0f * PhysicsConstants.PhysSkin, ItemType.Spinner);
        }
Пример #2
0
 public SpinnerMeshGenerator(SpinnerData data)
 {
     _data = data;
 }
Пример #3
0
 public SpinnerHitGenerator(SpinnerData data)
 {
     _data = data;
 }