本文整理汇总了C++中BoundingBox::getMaxSize方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundingBox::getMaxSize方法的具体用法?C++ BoundingBox::getMaxSize怎么用?C++ BoundingBox::getMaxSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundingBox
的用法示例。
在下文中一共展示了BoundingBox::getMaxSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addNormal
// add 3 identical normal vectors to normals array using newell method
// also add line segments to normalLines
void addNormal(vec4 a, vec4 b, vec4 c) {
vec4 normal(0, 0, 0, 0);
// newell method
vec4 verts[3] = {a, b, c};
for(int i = 0; i < 3; i++) {
vec4 current = verts[i];
vec4 next = verts[(i + 1) % 3];
normal.x += (current.y - next.y)*(current.z + next.z);
normal.y += (current.z - next.z)*(current.x + next.x);
normal.z += (current.x - next.x)*(current.y + next.y);
}
normal = normalize(normal);
normals[pointIndex] = normals[pointIndex + 1] = normals[pointIndex + 2] = normal;
// add a line to normalLines by finding center of face,
// adding a line through center along normal extending out by maxSize
if(maxSize == 0) {
maxSize = box->getMaxSize();
}
vec4 center = (a + b + c) / 3;
normalLines[lineIndex] = center;
normalLines[++lineIndex] = center + (maxSize/20 * normal);
lineIndex++;
}