本文整理汇总了C++中Intersection::Position方法的典型用法代码示例。如果您正苦于以下问题:C++ Intersection::Position方法的具体用法?C++ Intersection::Position怎么用?C++ Intersection::Position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Intersection
的用法示例。
在下文中一共展示了Intersection::Position方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetShadowRay
//------------------------------------------------------------------------------
void PointLight::GetShadowRay( const Intersection& _intersection, RayList& o_shadowRays, DisList& o_disList, float& o_attenuation ) const
{
Vector lightDir = Position() - _intersection.Position();
float dis = lightDir.Length();
o_disList.push_back(dis);
float attenuation = m_intensity /( dis*dis );
Clamp( attenuation, 0, 1);
o_attenuation = attenuation;
Normalise( lightDir );
o_shadowRays.push_back( Ray( _intersection.Position() + lightDir * EPSILON, lightDir, g_air ) );
}
示例2: GetShadowRay
//------------------------------------------------------------------------------
void AreaLight::GetShadowRay ( const Intersection& _intersection, RayList& o_shadowRays, DisList& o_disList, float& o_attenuation ) const
{
std::vector<Vector>::const_iterator iter = m_lightSamplesTransformed.begin ();
while( iter != m_lightSamplesTransformed.end() )
{
Vector lightDir = *iter - _intersection.Position();
float dis = lightDir.Length ();
o_disList.push_back( dis );
float attenuation = m_intensity / ( dis * dis );
Clamp(attenuation, 0, 1);
o_attenuation = attenuation;
Normalise( lightDir );
o_shadowRays.push_back ( Ray ( _intersection.Position () + _intersection.Normal () * 0.01, lightDir, g_air ) );
++iter;
}
}