示例#1
0
/**
 * Template method configures GL scaling of normals, based on
 * whether the scaling of this node is uniform or not.
 */
void CC3MeshNode::configureNormalization( CC3NodeDrawingVisitor* visitor )
{
	CC3OpenGL* gl = visitor->getGL();
	switch (getEffectiveNormalScalingMethod())
	{
		case kCC3NormalScalingNormalize:		// Enable normalizing & disable re-scaling
			gl->enableNormalize( true );
			gl->enableRescaleNormal( false );
			break;
		case kCC3NormalScalingRescale:			// Enable rescaling & disable normalizing
			gl->enableNormalize( false );
			gl->enableRescaleNormal( true );
			break;
		case kCC3NormalScalingNone:				// Disable both rescaling & normalizing
		default:
			gl->enableNormalize( false );
			gl->enableRescaleNormal( false );
			break;
	}
}