const Vector3r* lowMidHigh[] =
{
&(parentCellBound.positionOfLowerCorner_m),
&(parentCellBound.center_m),
&(parentCellBound.positionOfUpperCorner_m)
};
positionOfLowerCorner_m.set(
lowMidHigh[ subCellIndex & 1]->getX(),
lowMidHigh[(subCellIndex >> 1) & 1]->getY(),
lowMidHigh[(subCellIndex >> 2) & 1]->getZ() );
positionOfUpperCorner_m.set(
(lowMidHigh+1)[ subCellIndex & 1]->getX(),
(lowMidHigh+1)[(subCellIndex >> 1) & 1]->getY(),
(lowMidHigh+1)[(subCellIndex >> 2) & 1]->getZ() );
&是位与操作,如果Index的最低位为1,则结果为1,为0则结果为0 >>为位右移操作,>>1是右移一位,使最低位变成原来的倒数笫二位,以此类推 数组+1是取数组中Index之后一个偏移量的数组元素
C和C++完整教程:https://blog.csdn.net/it_xiangqiang/category_10581430.html