Beispiel #1
0
        internal void ValidateWeights(Validation.ValidationContext result, int jwset)
        {
            result = result.GetContext(this);

            SourceBufferView.ValidateBufferUsageGPU(result, BufferMode.ARRAY_BUFFER);
            result.CheckLinkMustBeAnyOf(nameof(Encoding), Encoding, EncodingType.UNSIGNED_BYTE, EncodingType.UNSIGNED_SHORT, EncodingType.FLOAT);
            result.CheckLinkMustBeAnyOf(nameof(Dimensions), Dimensions, DimensionType.VEC4);

            var weights = this.AsVector4Array();

            for (int i = 0; i < weights.Count; ++i)
            {
                result.CheckIsInRange(i, weights[i], 0, 1);

                // theoretically, the sum of all the weights should give 1, ASSUMING there's only one weight set.
                // but in practice, that seems not to be true.
            }
        }