本文整理汇总了C++中std::shared_ptr::Area方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::Area方法的具体用法?C++ shared_ptr::Area怎么用?C++ shared_ptr::Area使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::shared_ptr
的用法示例。
在下文中一共展示了shared_ptr::Area方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AreaLight
// DiffuseAreaLight Method Definitions
DiffuseAreaLight::DiffuseAreaLight(const Transform &LightToWorld,
const MediumInterface &mediumInterface,
const Spectrum &Lemit, int nSamples,
const std::shared_ptr<Shape> &shape)
: AreaLight(LightToWorld, mediumInterface, nSamples),
Lemit(Lemit),
shape(shape),
area(shape->Area()) {}
示例2: AreaLight
// DiffuseAreaLight Method Definitions
DiffuseAreaLight::DiffuseAreaLight(const Transform &LightToWorld,
const MediumInterface &mediumInterface,
const Spectrum &Lemit, int nSamples,
const std::shared_ptr<Shape> &shape,
bool twoSided)
: AreaLight(LightToWorld, mediumInterface, nSamples),
Lemit(Lemit),
shape(shape),
twoSided(twoSided),
area(shape->Area()) {
// Warn if light has transformation with non-uniform scale, though not
// for Triangles, since this doesn't matter for them.
if (WorldToLight.HasScale() &&
dynamic_cast<const Triangle *>(shape.get()) == nullptr)
Warning(
"Scaling detected in world to light transformation! "
"The system has numerous assumptions, implicit and explicit, "
"that this transform will have no scale factors in it. "
"Proceed at your own risk; your image may have errors.");
}