Esempio n. 1
0
            //Updates local and world transform, and feeds the joint variable configuration forward to all childs
            public void FeedForwardConfiguration(double[] configuration, bool updateWorld = false)
            {
                //Assume no local update is required
                bool updateLocal = false;

                if (XEnabled && configuration[XIndex] != XValue)
                {
                    XValue      = configuration[XIndex];
                    updateLocal = true;
                }
                if (YEnabled && configuration[YIndex] != YValue)
                {
                    YValue      = configuration[YIndex];
                    updateLocal = true;
                }
                if (ZEnabled && configuration[ZIndex] != ZValue)
                {
                    ZValue      = configuration[ZIndex];
                    updateLocal = true;
                }

                //Only update local transformation if a joint value has changed
                if (updateLocal)
                {
                    Joint.ComputeLocalTransformation(XValue, YValue, ZValue, out LPX, out LPY, out LPZ, out LRX, out LRY, out LRZ, out LRW);
                    updateWorld = true;
                }

                //Only update world transformation if local transformation (in this or parent node) has changed
                if (updateWorld)
                {
                    ComputeWorldTransformation();
                }

                //Feed forward the joint variable configuration
                foreach (Node child in Childs)
                {
                    child.FeedForwardConfiguration(configuration, updateWorld);
                }
            }