Ejemplo n.º 1
0
        private double CalcRouteDistance(WWRoom room, int speakerCh, WWRoute route, WWLineSegment lastSegment, Point3D hitPos)
        {
            var    speakerToHitPos = hitPos - room.SpeakerPos(speakerCh);
            double distance        = speakerToHitPos.Length;

            for (int i = 0; i < route.Count(); ++i)
            {
                var lineSegment = route.GetNth(i);
                distance += lineSegment.Length;
            }
            distance += lastSegment.Length;
            return(distance);
        }
Ejemplo n.º 2
0
        private void DrawRoute(WWRoute route)
        {
            Brush[] brushes = new Brush[] {
                new SolidColorBrush(Colors.Cyan),
                new SolidColorBrush(Colors.Magenta)
            };

            for (int i = 0; i < route.Count(); ++i)
            {
                var     lineSegment = route.GetNth(i);
                Point3D p0          = Point3D.Multiply(lineSegment.StartPos, mWorldProjectionMatrix);
                Point3D p1          = Point3D.Multiply(lineSegment.StartPos + lineSegment.Length * lineSegment.Direction, mWorldProjectionMatrix);

                Brush b = brushes[route.EarCh].Clone();
                b.Opacity = IntensityToOpacity(lineSegment.Intensity);
                AddNewLine(p0, p1, b);

                Point3D pSL = Point3D.Multiply(mRoom.SpeakerPos(0), mWorldProjectionMatrix);
                Point3D pSR = Point3D.Multiply(mRoom.SpeakerPos(1), mWorldProjectionMatrix);
                AddNewLine(pSL, p1, b);
                AddNewLine(pSR, p1, b);
            }
        }
Ejemplo n.º 3
0
        private void DrawRoute(WWRoute route)
        {
            Brush[] brushes = new Brush[] {
                new SolidColorBrush(Colors.Cyan),
                new SolidColorBrush(Colors.Magenta)
            };

            for (int i = 0; i < route.Count(); ++i) {
                var lineSegment = route.GetNth(i);
                Point3D p0 = Point3D.Multiply(lineSegment.StartPos, mWorldProjectionMatrix);
                Point3D p1 = Point3D.Multiply(lineSegment.StartPos + lineSegment.Length * lineSegment.Direction, mWorldProjectionMatrix);

                Brush b = brushes[route.EarCh].Clone();
                b.Opacity = IntensityToOpacity(lineSegment.Intensity);
                AddNewLine(p0, p1, b);

                Point3D pSL = Point3D.Multiply(mRoom.SpeakerPos(0), mWorldProjectionMatrix);
                Point3D pSR = Point3D.Multiply(mRoom.SpeakerPos(1), mWorldProjectionMatrix);
                AddNewLine(pSL, p1, b);
                AddNewLine(pSR, p1, b);
            }
        }
Ejemplo n.º 4
0
 private double CalcRouteDistance(WWRoom room, int speakerCh, WWRoute route, WWLineSegment lastSegment, Point3D hitPos)
 {
     var speakerToHitPos = hitPos - room.SpeakerPos(speakerCh);
     double distance = speakerToHitPos.Length;
     for (int i = 0; i < route.Count(); ++i) {
         var lineSegment = route.GetNth(i);
         distance += lineSegment.Length;
     }
     distance += lastSegment.Length;
     return distance;
 }