Esempio n. 1
0
        unsafe private static vec3[] GetNormals(EZMVertexbuffer vertexbuffer)
        {
            Passbuffer passbuffer = vertexbuffer.GetBuffer("normal");
            IntPtr     address    = passbuffer.Mapbuffer();
            vec3 *     pointer    = (vec3 *)address.ToPointer();
            int        length     = passbuffer.Length();
            var        normals    = new vec3[length];

            for (int i = 0; i < length; i++)
            {
                normals[i] = pointer[i];
            }
            passbuffer.Unmapbuffer();
            return(normals);
        }
Esempio n. 2
0
        unsafe private static vec2[] GetTexCoords(EZMVertexbuffer vertexbuffer)
        {
            Passbuffer passbuffer = vertexbuffer.GetBuffer("texcoord1");
            IntPtr     address    = passbuffer.Mapbuffer();
            vec2 *     pointer    = (vec2 *)address.ToPointer();
            int        length     = passbuffer.Length();
            var        texCoords  = new vec2[length];

            for (int i = 0; i < length; i++)
            {
                texCoords[i] = pointer[i];
            }
            passbuffer.Unmapbuffer();
            return(texCoords);
        }
Esempio n. 3
0
        unsafe private static uvec4[] GetBoneIndexes(EZMVertexbuffer vertexbuffer)
        {
            Passbuffer passbuffer  = vertexbuffer.GetBuffer("blendindices");
            IntPtr     address     = passbuffer.Mapbuffer();
            uvec4 *    pointer     = (uvec4 *)address.ToPointer();
            int        length      = passbuffer.Length();
            var        boneIndexes = new uvec4[length];

            for (int i = 0; i < length; i++)
            {
                boneIndexes[i] = pointer[i];
            }
            passbuffer.Unmapbuffer();
            return(boneIndexes);
        }
Esempio n. 4
0
        unsafe private static vec4[] GetBoneWeights(EZMVertexbuffer vertexbuffer)
        {
            Passbuffer passbuffer  = vertexbuffer.GetBuffer("blendweights");
            IntPtr     address     = passbuffer.Mapbuffer();
            vec4 *     pointer     = (vec4 *)address.ToPointer();
            int        length      = passbuffer.Length();
            var        boneWeights = new vec4[length];

            for (int i = 0; i < length; i++)
            {
                boneWeights[i] = pointer[i];
            }
            passbuffer.Unmapbuffer();
            return(boneWeights);
        }
Esempio n. 5
0
        unsafe private static vec3[] GetPositions(EZMVertexbuffer vertexbuffer)
        {
            Passbuffer passbuffer = vertexbuffer.GetBuffer("position");
            IntPtr     address    = passbuffer.Mapbuffer();
            vec3 *     pointer    = (vec3 *)address.ToPointer();
            int        length     = passbuffer.Length();
            var        vertexes   = new vec3[length];

            for (int i = 0; i < length; i++)
            {
                vertexes[i] = pointer[i];
            }
            passbuffer.Unmapbuffer();
            return(vertexes);
        }