本文整理汇总了C++中Plane3::zAt方法的典型用法代码示例。如果您正苦于以下问题:C++ Plane3::zAt方法的具体用法?C++ Plane3::zAt怎么用?C++ Plane3::zAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plane3
的用法示例。
在下文中一共展示了Plane3::zAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePolyhedron
void updatePolyhedron(const Vec3& current) {
const Grid& grid = m_tool->grid();
const Math::Axis::Type axis = m_plane.normal.firstComponent();
const Plane3 swizzledPlane(swizzle(m_plane.anchor(), axis), swizzle(m_plane.normal, axis));
const Vec3 theMin = swizzle(grid.snapDown(min(m_initialPoint, current)), axis);
const Vec3 theMax = swizzle(grid.snapUp (max(m_initialPoint, current)), axis);
const Vec2 topLeft2(theMin.x(), theMin.y());
const Vec2 topRight2(theMax.x(), theMin.y());
const Vec2 bottomLeft2(theMin.x(), theMax.y());
const Vec2 bottomRight2(theMax.x(), theMax.y());
const Vec3 topLeft3 = unswizzle(Vec3(topLeft2, swizzledPlane.zAt(topLeft2)), axis);
const Vec3 topRight3 = unswizzle(Vec3(topRight2, swizzledPlane.zAt(topRight2)), axis);
const Vec3 bottomLeft3 = unswizzle(Vec3(bottomLeft2, swizzledPlane.zAt(bottomLeft2)), axis);
const Vec3 bottomRight3 = unswizzle(Vec3(bottomRight2, swizzledPlane.zAt(bottomRight2)), axis);
Polyhedron3 polyhedron = m_oldPolyhedron;
polyhedron.addPoint(topLeft3);
polyhedron.addPoint(bottomLeft3);
polyhedron.addPoint(bottomRight3);
polyhedron.addPoint(topRight3);
m_tool->update(polyhedron);
}