public CharBuffer asCharBuffer()
    {
        int n = getIndexCount();
        if (getIndexSize() != 2)
        {
            throw new UnsupportedOperationException("Cannot convert integer indices to char array");
        }
        if (n <= 0)
        {
            return null;
        }
        CharBuffer data = ByteBuffer.allocateDirect(2 * n).order(ByteOrder.nativeOrder()).asCharBuffer();
        if (!NativeIndexBuffer.getShortVec(getNative(), data))
        {
            throw new IllegalArgumentException("Cannot convert integer indices to char buffer of size " + n);
        }
        return data;
    }
public CharBuffer asCharBuffer ( ) { int n = getIndexCount ( ) ; if ( getIndexSize ( ) != 2 ) { throw new UnsupportedOperationException ( "Cannot convert integer indices to char array" ) ; } if ( n <= 0 ) { return null ; } CharBuffer data = ByteBuffer . allocateDirect ( 2 * n ) . order ( ByteOrder . nativeOrder ( ) ) . asCharBuffer ( ) ; if ( ! NativeIndexBuffer . getShortVec ( getNative ( ) , data ) ) { throw new IllegalArgumentException ( "Cannot convert integer indices to char buffer of size " + n ) ; } return data ; }
Get the triangle vertex indices of the mesh as a CharBuffer.
<p>
The indices for each
triangle are represented as a packed {@code char} triplet, where
{@code t0} is the first triangle, {@code t1} is the second, etc.:
<p>
<code>
{ t0[0], t0[1], t0[2], t1[0], t1[1], t1[2], ...}
</code>
<p>
Face indices may also be {@code int}. If you have specified
char indices, this function will throw an exception.
@return CharBuffer with the packed triangle index data.
@see #asIntBuffer()
@throws IllegalArgumentException if index buffer is not <i>char</i>