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