cgv
Loading...
Searching...
No Matches
sphere.h
1
#pragma once
2
3
#include <cgv/math/vec.h>
4
5
namespace
cgv
{
6
namespace
media {
7
13
template
<
typename
T,
int
N>
14
class
sphere
15
{
16
public
:
17
cgv::math::vec<T>
h;
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
cgv::math::vec
A column vector class.
Definition
vec.h:28
cgv::math::vec::resize
void resize(unsigned dim)
resize the vector
Definition
vec.h:496
cgv::math::vec::size
unsigned size() const
number of elements
Definition
vec.h:59
cgv::media::sphere
A sphere data structure.
Definition
sphere.h:15
cgv::media::sphere::sphere
sphere(const cgv::math::vec< T > &c, const T &radius)
construct from center and radius
Definition
sphere.h:23
cgv::media::sphere::sphere
sphere()
create a unit sphere
Definition
sphere.h:19
cgv
the cgv namespace
Definition
print.h:11
cgv
media
sphere.h
Generated by
1.9.8