Panda3D
panda
src
grutil
fisheyeMaker.I
Go to the documentation of this file.
1
/**
2
* PANDA 3D SOFTWARE
3
* Copyright (c) Carnegie Mellon University. All rights reserved.
4
*
5
* All use of this software is subject to the terms of the revised BSD
6
* license. You should have received a copy of this license along
7
* with this source code in a file named "LICENSE."
8
*
9
* @file fisheyeMaker.I
10
* @author drose
11
* @date 2005-10-03
12
*/
13
14
/**
15
*
16
*/
17
INLINE FisheyeMaker::
18
FisheyeMaker(
const
std::string &name) :
Namable
(name) {
19
reset
();
20
}
21
22
/**
23
*
24
*/
25
INLINE FisheyeMaker::
26
~FisheyeMaker() {
27
}
28
29
/**
30
* Specifies the approximate number of vertices to be used to generate the
31
* rose. This is the approximate number of vertices that will be located
32
* within the rose's unit circle, not counting the inscribing square (if any).
33
* The actual number of vertices used may be +/- 25% of this value.
34
*/
35
INLINE
void
FisheyeMaker::
36
set_num_vertices
(
int
num_vertices) {
37
_num_vertices = num_vertices;
38
}
39
40
/**
41
* Sets the flag that indicates whether the rose should be inscribed within a
42
* square. When this is true, an additional square is generated to inscribed
43
* the circular rose, with the indicated "radius" (the sides of the square
44
* will be 2 * square_radius). The texture coordinates of the square will
45
* uniformly map to the back pole of the cube map.
46
*
47
* This is mainly useful to provide a good uniform background color for a
48
* sphere map so that it does not have a sharp circular edge that might
49
* produce artifacts due to numerical imprecision when mapping.
50
*/
51
INLINE
void
FisheyeMaker::
52
set_square_inscribed
(
bool
square_inscribed, PN_stdfloat square_radius) {
53
_square_inscribed = square_inscribed;
54
_square_radius = square_radius;
55
}
56
57
/**
58
* Sets the flag indicating whether the texture image should be mirrored
59
* (true) or normal (false). When this is true, the 3-D texture coordinates
60
* will be reversed so that the image is appropriate for a reflection. This
61
* is the best choice for generating a sphere map from a cube map. The
62
* default is false.
63
*/
64
INLINE
void
FisheyeMaker::
65
set_reflection
(
bool
reflection) {
66
_reflect = (reflection) ? -1.0 : 1.0;
67
}
FisheyeMaker::set_square_inscribed
void set_square_inscribed(bool square_inscribed, PN_stdfloat square_radius)
Sets the flag that indicates whether the rose should be inscribed within a square.
Definition:
fisheyeMaker.I:52
FisheyeMaker::set_num_vertices
void set_num_vertices(int num_vertices)
Specifies the approximate number of vertices to be used to generate the rose.
Definition:
fisheyeMaker.I:36
FisheyeMaker::reset
void reset()
Resets all the parameters to their initial defaults.
Definition:
fisheyeMaker.cxx:32
Namable
A base class for all things which can have a name.
Definition:
namable.h:26
FisheyeMaker::set_reflection
void set_reflection(bool reflection)
Sets the flag indicating whether the texture image should be mirrored (true) or normal (false).
Definition:
fisheyeMaker.I:65
Generated on Sat Jan 11 2020 15:15:13 for Panda3D by
1.8.17