Пример #1
0
    /// <summary>
    /// Recursively applies an encoded skeleton, or part of it, to the shadow
    /// </summary>
    /// <param name="data">The encoded skeleton data</param>
    /// <param name="t">The current transform to apply to</param>
    /// <param name="nameFilter">The filter for names</param>
    /// <param name="bypass">Used for whitelists to take children of
    /// whitelisted transforms</param>
    public static void ReadShadowData(
        ShadowTransform[] data,
        Transform t,
        ShadowCoordinator coordinator,
        FilterList <string> nameFilter,
        bool bypass = false)
    {
        bool allowed   = (bypass == true || nameFilter.Allowed(t.name) == true);
        bool whitelist = (nameFilter.IsWhitelist() == true);

        bypass = (allowed == true && whitelist == true);

        // If this is a valid bone, and is allowed, read it to the skeleton
        int key = coordinator.GetBoneKey(t.name);

        if (allowed == true && ShadowTransform.IsValid(data[key]) == true)
        {
            data[key].WriteTo(t);
        }

        // See if we need to keep searching
        if (whitelist == true || allowed == true)
        {
            foreach (Transform child in t)
            {
                ReadShadowData(data, child, coordinator, nameFilter, bypass);
            }
        }
    }
Пример #2
0
    /// <summary>
    /// Recursively populates a transform data array from this shadow, with
    /// a potential whitelist or blacklist
    /// </summary>
    /// <param name="data">The array to populate</param>
    /// <param name="t">The current subtree root</param>
    /// <param name="coordinator">The coordinator</param>
    /// <param name="nameFilter">The filter for names</param>
    /// <param name="bypass">Used for whitelists to take children of
    /// whitelisted transforms</param>
    public static void WriteShadowData(
        ShadowTransform[] data,
        Transform t,
        ShadowCoordinator coordinator,
        FilterList <string> nameFilter,
        bool bypass = false)
    {
        bool allowed   = (bypass == true || nameFilter.Allowed(t.name) == true);
        bool whitelist = (nameFilter.IsWhitelist() == true);

        bypass = (allowed == true && whitelist == true);

        // If we're permitting this bone through the filter
        if (allowed == true)
        {
            data[coordinator.GetBoneKey(t.name)].ReadFrom(t);
        }

        // See if we need to keep searching
        if (whitelist == true || allowed == true)
        {
            foreach (Transform child in t)
            {
                WriteShadowData(data, child, coordinator, nameFilter, bypass);
            }
        }
    }
Пример #3
0
    /// <summary>
    /// Recursively populates a transform data array from this shadow
    /// </summary>
    /// <param name="data">The array to populate</param>
    /// <param name="t">The current subtree root</param>
    /// <param name="coordinator">The coordinator</param>
    public static void WriteShadowData(
        ShadowTransform[] buffer,
        Transform t,
        ShadowCoordinator coordinator)
    {
        int key = coordinator.GetBoneKey(t.name);

        buffer[key].ReadFrom(t);
        foreach (Transform child in t)
        {
            WriteShadowData(buffer, child, coordinator);
        }
    }
Пример #4
0
    /// <summary>
    /// Recursively applies an encoded skeleton, or part of it, to the shadow
    /// </summary>
    /// <param name="data">The encoded skeleton data</param>
    /// <param name="t">The current transform to apply to</param>
    public static void ReadShadowData(
        ShadowTransform[] data,
        Transform t,
        ShadowCoordinator coordinator)
    {
        int key = coordinator.GetBoneKey(t.name);

        if (ShadowTransform.IsValid(data[key]) == true)
        {
            data[key].WriteTo(t);
        }
        foreach (Transform child in t)
        {
            ReadShadowData(data, child, coordinator);
        }
    }
Пример #5
0
    /// <summary>
    /// Recursively populates a transform data array from this shadow, with
    /// a potential whitelist or blacklist
    /// </summary>
    /// <param name="data">The array to populate</param>
    /// <param name="t">The current subtree root</param>
    /// <param name="coordinator">The coordinator</param>
    /// <param name="nameFilter">The filter for names</param>
    /// <param name="bypass">Used for whitelists to take children of 
    /// whitelisted transforms</param>
    public static void WriteShadowData(
        ShadowTransform[] data,
        Transform t,
        ShadowCoordinator coordinator,
        FilterList<string> nameFilter,
        bool bypass = false)
    {
        bool allowed = (bypass == true || nameFilter.Allowed(t.name) == true);
        bool whitelist = (nameFilter.IsWhitelist() == true);
        bypass = (allowed == true && whitelist == true);

        // If we're permitting this bone through the filter
        if (allowed == true)
            data[coordinator.GetBoneKey(t.name)].ReadFrom(t);

        // See if we need to keep searching
        if (whitelist == true || allowed == true)
            foreach (Transform child in t)
                WriteShadowData(data, child, coordinator, nameFilter, bypass);
    }
Пример #6
0
 /// <summary>
 /// Recursively populates a transform data array from this shadow
 /// </summary>
 /// <param name="data">The array to populate</param>
 /// <param name="t">The current subtree root</param>
 /// <param name="coordinator">The coordinator</param>
 public static void WriteShadowData(
     ShadowTransform[] buffer,
     Transform t,
     ShadowCoordinator coordinator)
 {
     int key = coordinator.GetBoneKey(t.name);
     buffer[key].ReadFrom(t);
     foreach (Transform child in t)
         WriteShadowData(buffer, child, coordinator);
 }
Пример #7
0
    /// <summary>
    /// Recursively applies an encoded skeleton, or part of it, to the shadow
    /// </summary>
    /// <param name="data">The encoded skeleton data</param>
    /// <param name="t">The current transform to apply to</param>
    /// <param name="nameFilter">The filter for names</param>
    /// <param name="bypass">Used for whitelists to take children of 
    /// whitelisted transforms</param>
    public static void ReadShadowData(
        ShadowTransform[] data,
        Transform t,
        ShadowCoordinator coordinator,
        FilterList<string> nameFilter,
        bool bypass = false)
    {
        bool allowed = (bypass == true || nameFilter.Allowed(t.name) == true);
        bool whitelist = (nameFilter.IsWhitelist() == true);
        bypass = (allowed == true && whitelist == true);

        // If this is a valid bone, and is allowed, read it to the skeleton
        int key = coordinator.GetBoneKey(t.name);
        if (allowed == true && ShadowTransform.IsValid(data[key]) == true)
            data[key].WriteTo(t);

        // See if we need to keep searching
        if (whitelist == true || allowed == true)
            foreach (Transform child in t)
                ReadShadowData(data, child, coordinator, nameFilter, bypass);
    }
Пример #8
0
 /// <summary>
 /// Recursively applies an encoded skeleton, or part of it, to the shadow
 /// </summary>
 /// <param name="data">The encoded skeleton data</param>
 /// <param name="t">The current transform to apply to</param>
 public static void ReadShadowData(
     ShadowTransform[] data,
     Transform t,
     ShadowCoordinator coordinator)
 {
     int key = coordinator.GetBoneKey(t.name);
     if (ShadowTransform.IsValid(data[key]) == true)
         data[key].WriteTo(t);
     foreach (Transform child in t)
         ReadShadowData(data, child, coordinator);
 }