primitive.c
来自「[Game.Programming].Academic - Graphics G」· C语言 代码 · 共 38 行
C
38 行
#include "Primitive.h"Primitive::~Primitive(){};/************************************************************************* ** This method receives as parameter a list of intersections and the ** number of intersections in the list. It scans the list and returns ** the closest positive intersection, or 0.0 if no such intersection ** exists. ** *************************************************************************/double Primitive::closest_intersection(double *x, int x_num){int i;double x_min = (x_num) ? x[0] : 0.0;for (i=1; i<x_num; i++) if (x[i] < x_min) x_min = x[i];return x_min;}/************************************************************************* ** Input from stream. ** *************************************************************************/istream& operator >> (istream& s, Primitive& a){s >> *((Object3D*) &a);s >> a.col;s >> a.ph;return s;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?