⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 primitive.c

📁 [Game.Programming].Academic - Graphics Gems (6 books source code)
💻 C
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -