コード例 #1
0
        /// <summary>
        /// Initializes instance.
        /// </summary>
        internal unsafe CubismUnmanagedParameters(IntPtr modelPtr)
        {
            var length = 0;


            Count = CubismCoreDll.GetParameterCount(modelPtr);


            length = CubismCoreDll.GetParameterCount(modelPtr);
            Ids    = new string[length];
            var _ids = (IntPtr *)(CubismCoreDll.GetParameterIds(modelPtr));

            for (var i = 0; i < length; ++i)
            {
                Ids[i] = Marshal.PtrToStringAnsi(_ids[i]);
            }


            length        = CubismCoreDll.GetParameterCount(modelPtr);
            MinimumValues = new CubismUnmanagedFloatArrayView(CubismCoreDll.GetParameterMinimumValues(modelPtr), length);

            length        = CubismCoreDll.GetParameterCount(modelPtr);
            MaximumValues = new CubismUnmanagedFloatArrayView(CubismCoreDll.GetParameterMaximumValues(modelPtr), length);

            length        = CubismCoreDll.GetParameterCount(modelPtr);
            DefaultValues = new CubismUnmanagedFloatArrayView(CubismCoreDll.GetParameterDefaultValues(modelPtr), length);

            length = CubismCoreDll.GetParameterCount(modelPtr);
            Values = new CubismUnmanagedFloatArrayView(CubismCoreDll.GetParameterValues(modelPtr), length);
        }
コード例 #2
0
        /// <summary>
        /// Initializes instance.
        /// </summary>
        internal unsafe CubismUnmanagedParts(IntPtr modelPtr)
        {
            var length = 0;


            Count = CubismCoreDll.GetPartCount(modelPtr);


            length = CubismCoreDll.GetPartCount(modelPtr);
            Ids    = new string[length];
            var _ids = (IntPtr *)(CubismCoreDll.GetPartIds(modelPtr));

            for (var i = 0; i < length; ++i)
            {
                Ids[i] = Marshal.PtrToStringAnsi(_ids[i]);
            }


            length    = CubismCoreDll.GetPartCount(modelPtr);
            Opacities = new CubismUnmanagedFloatArrayView(CubismCoreDll.GetPartOpacities(modelPtr), length);
        }
コード例 #3
0
        /// <summary>
        /// Initializes instance.
        /// </summary>
        internal unsafe CubismUnmanagedDrawables(IntPtr modelPtr)
        {
            ModelPtr = modelPtr;


            var length = 0;
            CubismUnmanagedIntArrayView length2;


            Count = CubismCoreDll.GetDrawableCount(modelPtr);


            length = CubismCoreDll.GetDrawableCount(modelPtr);
            Ids    = new string[length];
            var _ids = (IntPtr *)(CubismCoreDll.GetDrawableIds(modelPtr));

            for (var i = 0; i < length; ++i)
            {
                Ids[i] = Marshal.PtrToStringAnsi(_ids[i]);
            }


            length        = CubismCoreDll.GetDrawableCount(modelPtr);
            ConstantFlags = new CubismUnmanagedByteArrayView(CubismCoreDll.GetDrawableConstantFlags(modelPtr), length);

            length       = CubismCoreDll.GetDrawableCount(modelPtr);
            DynamicFlags = new CubismUnmanagedByteArrayView(CubismCoreDll.GetDrawableDynamicFlags(modelPtr), length);

            length         = CubismCoreDll.GetDrawableCount(modelPtr);
            TextureIndices = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableTextureIndices(modelPtr), length);

            length     = CubismCoreDll.GetDrawableCount(modelPtr);
            DrawOrders = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableDrawOrders(modelPtr), length);

            length       = CubismCoreDll.GetDrawableCount(modelPtr);
            RenderOrders = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableRenderOrders(modelPtr), length);

            length    = CubismCoreDll.GetDrawableCount(modelPtr);
            Opacities = new CubismUnmanagedFloatArrayView(CubismCoreDll.GetDrawableOpacities(modelPtr), length);

            length     = CubismCoreDll.GetDrawableCount(modelPtr);
            MaskCounts = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableMaskCounts(modelPtr), length);

            length       = CubismCoreDll.GetDrawableCount(modelPtr);
            VertexCounts = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableVertexCounts(modelPtr), length);

            length      = CubismCoreDll.GetDrawableCount(modelPtr);
            IndexCounts = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableIndexCounts(modelPtr), length);


            length  = CubismCoreDll.GetDrawableCount(modelPtr);
            length2 = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableMaskCounts(modelPtr), length);
            Masks   = new CubismUnmanagedIntArrayView[length];
            var _masks = (IntPtr *)(CubismCoreDll.GetDrawableMasks(modelPtr));

            for (var i = 0; i < length; ++i)
            {
                Masks[i] = new CubismUnmanagedIntArrayView(_masks[i], length2[i]);
            }

            length          = CubismCoreDll.GetDrawableCount(modelPtr);
            length2         = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableVertexCounts(modelPtr), length);
            VertexPositions = new CubismUnmanagedFloatArrayView[length];
            var _vertexPositions = (IntPtr *)(CubismCoreDll.GetDrawableVertexPositions(modelPtr));

            for (var i = 0; i < length; ++i)
            {
                VertexPositions[i] = new CubismUnmanagedFloatArrayView(_vertexPositions[i], length2[i] * 2);
            }

            length    = CubismCoreDll.GetDrawableCount(modelPtr);
            length2   = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableVertexCounts(modelPtr), length);
            VertexUvs = new CubismUnmanagedFloatArrayView[length];
            var _vertexUvs = (IntPtr *)(CubismCoreDll.GetDrawableVertexUvs(modelPtr));

            for (var i = 0; i < length; ++i)
            {
                VertexUvs[i] = new CubismUnmanagedFloatArrayView(_vertexUvs[i], length2[i] * 2);
            }

            length  = CubismCoreDll.GetDrawableCount(modelPtr);
            length2 = new CubismUnmanagedIntArrayView(CubismCoreDll.GetDrawableIndexCounts(modelPtr), length);
            Indices = new CubismUnmanagedUshortArrayView[length];
            var _indices = (IntPtr *)(CubismCoreDll.GetDrawableIndices(modelPtr));

            for (var i = 0; i < length; ++i)
            {
                Indices[i] = new CubismUnmanagedUshortArrayView(_indices[i], length2[i]);
            }
        }