home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
oct93
/
graphics
/
graphtal.lha
/
Graphtal
/
Sphere.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-19
|
1KB
|
50 lines
/*
* Sphere.h - class definition for geometric object sphere.
*
* Copyright (C) 1992, Christoph Streit (streit@iam.unibe.ch)
* University of Berne, Switzerland
* Copyright (C) 1989, 1991, Craig E. Kolb
* All rights reserved.
*
* This software may be freely copied, modified, and redistributed
* provided that this copyright notice is preserved on all copies.
*
* You may not distribute this software, in whole or in part, as part of
* any commercial product without the express consent of the authors.
*
* There is no warranty or other guarantee of fitness of this software
* for any purpose. It is provided solely "as is".
*
*/
#ifndef Sphere_H
# define Sphere_H
#include "GeoObject.h"
#include "Polygon.h"
//___________________________________________________________ Sphere
class Sphere : public GeoObject
{
public:
static GeoObject* create(real, const Vector&);
int intersect(const Ray&, real, real&);
Vector normal(const Vector&) const;
PolygonList* tesselate(const BoundingBox&);
static PolygonList* tesselation(const Vector&, real, int);
static Vector computeSurfacePoint(real, real);
private:
Sphere(real, const Vector&);
private:
real r; // radius
real rsqr; // radius squared
Vector center; // position
};
#endif // Sphere_H