pub fn buffer(&self, attributes: Attributes) -> Option<&RawBuffer> {
        for vbuf in self.vbufs.iter() {
            let mut find = attributes.iter();
            let mut next = find.next();
            let mut i = 0;
            let mut j = 0;
            loop {
                let attrs = vbuf.attrs;
                match next {
                    Some(&attr) => {
                        if i == attrs.len() {
                            // try next vbuf
                            break;
                        } else if attrs[(i + j) % attrs.len()] == attr {
                            // match. search next attribute
                            next = find.next();
                            j = i;
                            i = 0;
                        } else {
                            // continue searching
                            i += 1;
                        }
                    }
                    None => {
                        // All atributes found
                        return Some(&vbuf.raw);
                    }
                }
            }
        }

        // None of the vertex buffers match requested attributes
        None
    }
/// Returns the mesh's vertex buffer which matches requested attributes
Returns the mesh's vertex buffer which matches requested attributes
Returns the mesh ' s vertex buffer which matches requested attributes
pub fn buffer(&self, attributes: Attributes) -> Option<&RawBuffer> {
        for vbuf in self.vbufs.iter() {
            let mut find = attributes.iter();
            let mut next = find.next();
            let mut i = 0;
            let mut j = 0;
            loop {
                let attrs = vbuf.attrs;
                match next {
                    Some(&attr) => {
                        if i == attrs.len() {
                            // try next vbuf
                            break;
                        } else if attrs[(i + j) % attrs.len()] == attr {
                            // match. search next attribute
                            next = find.next();
                            j = i;
                            i = 0;
                        } else {
                            // continue searching
                            i += 1;
                        }
                    }
                    None => {
                        // All atributes found
                        return Some(&vbuf.raw);
                    }
                }
            }
        }
        // None of the vertex buffers match requested attributes
        None
    }
pub fn buffer ( & self , attributes : Attributes ) -> Option < & RawBuffer > { for vbuf in self . vbufs . iter ( ) { let mut find = attributes . iter ( ) ; let mut next = find . next ( ) ; let mut i = 0 ; let mut j = 0 ; loop { let attrs = vbuf . attrs ; match next { Some ( & attr ) => { if i == attrs . len ( ) { // try next vbuf break ; } else if attrs [ ( i + j ) % attrs . len ( ) ] == attr { // match. search next attribute next = find . next ( ) ; j = i ; i = 0 ; } else { // continue searching i += 1 ; } } None => { // All atributes found return Some ( & vbuf . raw ) ; } } } } // None of the vertex buffers match requested attributes None }
Returns the mesh's vertex buffer which matches requested attributes
Returns the mesh ' s vertex buffer which matches requested attributes
&self
attributes
Attributes
&self
attributes
Attributes