コード例 #1
0
    private void addIntermediateBeizerPoints(int beizerPointIndexOne, int amountOfIntermediatePointsToAdd, keyframeRefs[] keyframeRefData, out IntermediateControlPoint middleControlPoint)
    {
        int countDiff = (amountOfIntermediatePointsToAdd);

        Debug.Log("check countDiff " + countDiff);
        List <BeizerPoint> intermediatePoints = new List <BeizerPoint>();

        for (int i = 0; i < countDiff; i++)
        {
            GameObject g = Instantiate(beizerPathGroup.intermediatePointPrefab, beizerPathGroup.transform);
            g.transform.localScale = new Vector3(1, 1, 1);
            IntermediatePoint newIntermediatePoint = g.GetComponent <IntermediatePoint>();
            newIntermediatePoint.transform.position     = beizerPointPositionFromVideoKeyframeOfBeizerCurves(keyframeRefData[i]);
            newIntermediatePoint.beizerIntermediateTime = keyframeRefData[i].keyframeTime;
            newIntermediatePoint.beizerTime             = keyframeRefData[i].keyframeTime;
            intermediatePoints.Add(newIntermediatePoint);
        }

        middleControlPoint = Instantiate(beizerPathGroup.intermediateControlPointPrefab, beizerPathGroup.transform).GetComponent <IntermediateControlPoint>();
        middleControlPoint.transform.position     = beizerPointPositionFromVideoKeyframeOfBeizerCurves(keyframeRefData[3]);
        middleControlPoint.beizerIntermediateTime = keyframeRefData[3].keyframeTime;
        middleControlPoint.setAnimatedObj(animTrack.animatedObject);

        beizerPoints.InsertRange(beizerPointIndexOne, intermediatePoints);
        sortBeizerPointsByTime();
    }
コード例 #2
0
ファイル: NavigationData.cs プロジェクト: Seaqqull/lazy-bot
 public NavigationPoint(NavigationPoint point)
 {
     this._transferDelay  = point._transferDelay;
     this._minImpactSpeed = point._minImpactSpeed;
     this._type           = point._type;
     this._action         = point._action;
     this._priority       = point._priority;
     this._animationSpeed = point._animationSpeed;
     this._movementSpeed  = point._movementSpeed;
     this._accuracyRadius = point._accuracyRadius;
     this._impactRadius   = point._impactRadius;
     this._point          = point._point;
 }
コード例 #3
0
        public void DeviceFound(IADevice iaDevice, bool ownDevice)
        {
            PairableDevice pairableDevice = new PairableDevice
            {
                Identifier   = iaDevice.Name,
                PairingState = PairingState.NotPaired
            };

            FindDeviceWidthAndHeight(iaDevice);


            if (iaDevice.SupportedRoutes.Contains(Routes.GetLocationRoute))
            {
                IARequest request = new IARequest(Routes.GetLocationRoute);
                IntAirAct.SendRequest(request, iaDevice, delegate(IAResponse response, Exception error)
                {
                    if (response == null || response.StatusCode == 404)
                    {
                        // Device has no location
                    }
                    else if (response.StatusCode == 200)
                    {
                        IntermediatePoint intermediatePoint = response.BodyAs <IntermediatePoint>();
                        Point result = intermediatePoint.ToPoint();

                        Device localDevice = locator.Devices.Find(d => d.Identifier.Equals(iaDevice.Name));

                        if (localDevice != null)
                        {
                            localDevice.Location = result;
                            response.StatusCode  = 201; // created
                        }
                        else
                        {
                            response.StatusCode = 404; // not found
                        }
                    }
                });
            }

            locator.Devices.Add(pairableDevice);

            if (DeviceAdded != null)
            {
                DeviceAdded(this, pairableDevice);
            }
        }
コード例 #4
0
        /// <summary>
        /// Handle a request with updated location for a device.
        /// </summary>
        /// <param name="request">IntAirAct Request</param>
        /// <param name="response">IntAirAct Response</param>
        public void UpdateDeviceLocation(IARequest request, IAResponse response)
        {
            IntermediatePoint intermediatePoint = request.BodyAs <IntermediatePoint>();
            Point             result            = intermediatePoint.ToPoint();

            String name        = request.Parameters["identifier"];
            Device localDevice = locator.Devices.Find(d => d.Identifier.Equals(name));

            if (localDevice != null)
            {
                localDevice.Location = result;
                response.StatusCode  = 201; // created
            }
            else
            {
                response.StatusCode = 404; // not found
            }
        }