_np = bbtNode.getSize(); int np = _np; int nv = np;
_nq = bbtNode.getSize(); int nq = _nq; int nv = 4*nq;
_nt = bbtNode.getSize(); int nt = _nt; int nv = 3*nt;
public PointNode( BoundingBoxTree.Node bbtNode, float[] xyz, float[] rgb) { BoundingBox bb = bbtNode.getBoundingBox(); _bs = new BoundingSphere(bb); _np = bbtNode.getSize(); int np = _np; int nv = np; int nc = np; int[] index = bbtNode.getIndices(); _vb = Direct.newFloatBuffer(3*nv); _cb = (rgb!=null)?Direct.newFloatBuffer(3*nc):null; for (int ip=0,iv=0,ic=0; ip<np; ++ip) { int i = 3*index[ip]; _vb.put(iv++,xyz[i+X]); _vb.put(iv++,xyz[i+Y]); _vb.put(iv++,xyz[i+Z]); if (_cb!=null) { _cb.put(ic++,rgb[i+R]); _cb.put(ic++,rgb[i+G]); _cb.put(ic++,rgb[i+B]); } } }