cgv
Loading...
Searching...
No Matches
sphere.h
1#pragma once
2
3#include <cgv/math/vec.h>
4
5namespace cgv {
6 namespace media {
7
13template <typename T,int N>
14class sphere
15{
16public:
19 sphere() : h(0,0,0,1)
20 {
21 }
23 sphere(const cgv::math::vec<T>& c, const T& radius)
24 {
25 h.resize(c.size()+1);
26 for (unsigned int i=0; i<c.size(); ++i)
27 h(i) = c(i);
28 h(c.size()) = radius;
29 }
30};
31
32 }
33}
34
A column vector class.
Definition vec.h:28
void resize(unsigned dim)
resize the vector
Definition vec.h:496
unsigned size() const
number of elements
Definition vec.h:59
A sphere data structure.
Definition sphere.h:15
sphere(const cgv::math::vec< T > &c, const T &radius)
construct from center and radius
Definition sphere.h:23
sphere()
create a unit sphere
Definition sphere.h:19
the cgv namespace
Definition print.h:11