public IntBuffer asIntBuffer()
    {
        int n = getIndexCount();
        if (getIndexSize() != 4)
        {
            throw new UnsupportedOperationException("Cannot convert short indices to int array");
        }
        if (n <= 0)
        {
            return null;
        }
        IntBuffer data = ByteBuffer.allocateDirect(4 * n).order(ByteOrder.nativeOrder()).asIntBuffer();
        if (!NativeIndexBuffer.getIntVec(getNative(), data))
        {
            throw new IllegalArgumentException("Cannot convert short indices to int buffer of size " + n);
        }
        return data;
    }
public IntBuffer asIntBuffer ( ) { int n = getIndexCount ( ) ; if ( getIndexSize ( ) != 4 ) { throw new UnsupportedOperationException ( "Cannot convert short indices to int array" ) ; } if ( n <= 0 ) { return null ; } IntBuffer data = ByteBuffer . allocateDirect ( 4 * n ) . order ( ByteOrder . nativeOrder ( ) ) . asIntBuffer ( ) ; if ( ! NativeIndexBuffer . getIntVec ( getNative ( ) , data ) ) { throw new IllegalArgumentException ( "Cannot convert short indices to int buffer of size " + n ) ; } return data ; }
Get the triangle vertex indices of the mesh as a IntBuffer.
<p>
The indices for each
triangle are represented as a packed {@code int} 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 char}. If you have specified
char indices, this function will throw an exception.
@return IntBuffer with the packed triangle index data.
@see #asCharBuffer()
@throws IllegalArgumentException if index buffer is not <i>int</i>