本文整理汇总了C++中Vec3d::getPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ Vec3d::getPointer方法的具体用法?C++ Vec3d::getPointer怎么用?C++ Vec3d::getPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vec3d
的用法示例。
在下文中一共展示了Vec3d::getPointer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawRays
void DebuggingView::drawRays()
{
glDisable( GL_LIGHTING );
// Now draw all the rays
for( std::vector< std::pair<ray, isect> >::const_iterator rayItr =
raytracer->getScene().intersectCache.begin();
rayItr != raytracer->getScene().intersectCache.end();
++rayItr )
{
switch( rayItr->first.type() )
{
case ray::VISIBILITY:
if( !m_showVisibilityRays ) continue;
glColor4f( 0.4f, 0.4f, 1.0f, 1.0f );
break;
case ray::REFLECTION:
if( !m_showReflectionRays ) continue;
glColor4f( 1.0f, 1.0f, 0.0f, 1.0f );
break;
case ray::REFRACTION:
if( !m_showRefractionRays ) continue;
glColor4f( 1.0f, 1.0f, 0.0f, 1.0f );
break;
case ray::SHADOW:
if( !m_showShadowRays ) continue;
glColor4f( 0.20f, 0.45f, 0.72f, 1.0f );
break;
}
Vec3d p = rayItr->first.getPosition();
Vec3d d = rayItr->first.getDirection();
Vec3d isectPoint = p + rayItr->second.t*d;
glEnable( GL_LINE_STIPPLE );
glLineStipple( 1, 0x3333 );
glBegin( GL_LINES );
glVertex3dv( p.getPointer() );
glVertex3dv( isectPoint.getPointer() );
glEnd();
glDisable(GL_LINE_STIPPLE);
if( m_showNormals )
{
glPushMatrix();
glTranslatef( isectPoint[0], isectPoint[1], isectPoint[2] );
glBegin( GL_LINES );
glColor4f( 0.5f, 1.0f, 0.5f, 1.0f );
glVertex3d( 0.0, 0.0, 0.0 );
glVertex3dv( rayItr->second.N.getPointer() );
glEnd();
glPopMatrix();
}
}
glEnd();
glEnable( GL_LIGHTING );
}