public uint[] GetBoneCRCs() { CheckValidity(); IntPtr crcs = APIWrapper.AnimationBank_GetBoneCRCs(NativeInstance, out int numAnims); return(MemUtils.IntPtrToArray <uint>(crcs, numAnims)); }
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)); } }
public byte[] GetBytesRGBA() { CheckValidity(); int length = Width * Height * 4; return(IsConvertibleFormat ? MemUtils.IntPtrToArray <byte>(NativeRawImageData, length) : new byte[length]); }
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); }
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); }
public ushort[] GetIndices() { CheckValidity(); return(MemUtils.IntPtrToArray <ushort>(IndexBufferPtr, (int)IndexCount)); }
public unsafe T[] GetVertices <T>() where T : unmanaged { CheckValidity(); return(MemUtils.IntPtrToArray <T>(VertexBufferPtr, ((int)VertexCount * 3 * 4) / sizeof(T))); }
public VertexWeight[] GetVertexWeights() { CheckValidity(); return(MemUtils.IntPtrToArray <VertexWeight>(VertexWeightsBufferPtr, NumVertexWeights)); }
public unsafe T[] GetUVBuffer <T>() where T : unmanaged { CheckValidity(); return(MemUtils.IntPtrToArray <T>(UVBufferPtr, (NumVertices * 2 * 4) / sizeof(T))); }
public unsafe T[] GetNormalsBuffer <T>() where T : unmanaged { CheckValidity(); return(MemUtils.IntPtrToArray <T>(normalsBufferPtr, ((int)NumNormals * 3 * 4) / sizeof(T))); }
public unsafe T[] GetPositionsBuffer <T>() where T : unmanaged { CheckValidity(); return(MemUtils.IntPtrToArray <T>(vertexBufferPtr, ((int)NumVertices * 3 * 4) / sizeof(T))); }
public uint[] GetIndexBuffer() { CheckValidity(); APIWrapper.Terrain_GetIndexBuffer(NativeInstance, out IntPtr buf, out uint numInds); return(MemUtils.IntPtrToArray <uint>(buf, (int)numInds)); }
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)); }
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)); }