Esempio n. 1
0
        public uint[] GetBoneCRCs()
        {
            CheckValidity();
            IntPtr crcs = APIWrapper.AnimationBank_GetBoneCRCs(NativeInstance, out int numAnims);

            return(MemUtils.IntPtrToArray <uint>(crcs, numAnims));
        }
Esempio n. 2
0
        public ushort[] GetIndexBuffer(Topology requestedTopology = Topology.TriangleList)
        {
            CheckValidity();

            if (requestedTopology != Topology.TriangleList &&
                requestedTopology != Topology.TriangleStrip)
            {
                throw new Exception("Only requestable topologies are tri strip and tri list!");
            }

            if (Topology != Topology.TriangleList &&
                Topology != Topology.TriangleStrip)
            {
                return(new ushort[0]);
            }

            if (Topology == Topology.TriangleList &&
                requestedTopology == Topology.TriangleStrip)
            {
                throw new Exception("Cant convert triangle strip to list yet!");
            }

            ushort[] indices = MemUtils.IntPtrToArray <ushort>(IndexBufferPtr, NumIndices);

            if (requestedTopology == Topology)
            {
                return(indices);
            }
            else
            {
                return(ToTriList(indices));
            }
        }
Esempio n. 3
0
        public byte[] GetBytesRGBA()
        {
            CheckValidity();

            int length = Width * Height * 4;

            return(IsConvertibleFormat ? MemUtils.IntPtrToArray <byte>(NativeRawImageData, length) : new byte[length]);
        }
Esempio n. 4
0
        public bool GetCurve(uint animCRC, uint boneCRC, uint component,
                             out ushort[] inds, out float[] values)
        {
            CheckValidity();
            bool status = APIWrapper.AnimationBank_GetCurve(
                NativeInstance, animCRC, boneCRC, component,
                out IntPtr indexBuffer, out IntPtr valueBuffer,
                out int numKeys);

            inds   = MemUtils.IntPtrToArray <ushort>(indexBuffer, numKeys);
            values = MemUtils.IntPtrToArray <float>(valueBuffer, numKeys);

            return(status);
        }
Esempio n. 5
0
        public bool GetOverriddenProperties(out uint[] properties, out string[] values)
        {
            CheckValidity();
            bool status = APIWrapper.EntityClass_GetOverriddenProperties(NativeInstance, out IntPtr props, out IntPtr vals, out int count);

            if (status)
            {
                properties = MemUtils.IntPtrToArray <uint>(props, count);
                values     = MemUtils.IntPtrToStringList(vals, count).ToArray();
            }
            else
            {
                properties = new uint[0];
                values     = new string[0];
            }

            return(status);
        }
Esempio n. 6
0
 public ushort[] GetIndices()
 {
     CheckValidity();
     return(MemUtils.IntPtrToArray <ushort>(IndexBufferPtr, (int)IndexCount));
 }
Esempio n. 7
0
 public unsafe T[] GetVertices <T>() where T : unmanaged
 {
     CheckValidity();
     return(MemUtils.IntPtrToArray <T>(VertexBufferPtr, ((int)VertexCount * 3 * 4) / sizeof(T)));
 }
Esempio n. 8
0
 public VertexWeight[] GetVertexWeights()
 {
     CheckValidity();
     return(MemUtils.IntPtrToArray <VertexWeight>(VertexWeightsBufferPtr, NumVertexWeights));
 }
Esempio n. 9
0
 public unsafe T[] GetUVBuffer <T>() where T : unmanaged
 {
     CheckValidity();
     return(MemUtils.IntPtrToArray <T>(UVBufferPtr, (NumVertices * 2 * 4) / sizeof(T)));
 }
Esempio n. 10
0
 public unsafe T[] GetNormalsBuffer <T>() where T : unmanaged
 {
     CheckValidity();
     return(MemUtils.IntPtrToArray <T>(normalsBufferPtr, ((int)NumNormals * 3 * 4) / sizeof(T)));
 }
Esempio n. 11
0
 public unsafe T[] GetPositionsBuffer <T>() where T : unmanaged
 {
     CheckValidity();
     return(MemUtils.IntPtrToArray <T>(vertexBufferPtr, ((int)NumVertices * 3 * 4) / sizeof(T)));
 }
Esempio n. 12
0
 public uint[] GetIndexBuffer()
 {
     CheckValidity();
     APIWrapper.Terrain_GetIndexBuffer(NativeInstance, out IntPtr buf, out uint numInds);
     return(MemUtils.IntPtrToArray <uint>(buf, (int)numInds));
 }
Esempio n. 13
0
 public void GetBlendMap(out uint dim, out uint numLayers, out byte[] data)
 {
     CheckValidity();
     APIWrapper.Terrain_GetBlendMap(NativeInstance, out dim, out numLayers, out IntPtr bytesNative);
     data = MemUtils.IntPtrToArray <byte>(bytesNative, (int)(dim * dim * numLayers));
 }
Esempio n. 14
0
 public void GetHeightMap(out uint dim, out uint dimScale, out float[] data)
 {
     CheckValidity();
     APIWrapper.Terrain_GetHeightMap(NativeInstance, out dim, out dimScale, out IntPtr bytesNative);
     data = MemUtils.IntPtrToArray <float>(bytesNative, (int)(dim * dim));
 }