|
typedef float | f12[12] |
|
typedef float | f18[18] |
|
Definition at line 26 of file tex_rect.
◆ f12
typedef float tools::sg::tex_rect::f12[12] |
|
protected |
◆ f18
typedef float tools::sg::tex_rect::f18[18] |
|
protected |
◆ tex_rect() [1/2]
tools::sg::tex_rect::tex_rect |
( |
| ) |
|
|
inline |
◆ ~tex_rect()
virtual tools::sg::tex_rect::~tex_rect |
( |
| ) |
|
|
inlinevirtual |
◆ tex_rect() [2/2]
tools::sg::tex_rect::tex_rect |
( |
const tex_rect & |
a_from | ) |
|
|
inline |
◆ _back()
void tools::sg::tex_rect::_back |
( |
f12 & |
back | ) |
|
|
inlineprotected |
Definition at line 290 of file tex_rect.
293 float w2 = aspect*h2;
296 back[0] = w2;back[ 1] = -h2;back[ 2] = d2;
297 back[3] = -w2;back[ 4] = -h2;back[ 5] = d2;
298 back[6] = -w2;back[ 7] = h2;back[ 8] = d2;
299 back[9] = w2;back[10] = h2;back[11] = d2;
◆ _front()
void tools::sg::tex_rect::_front |
( |
f12 & |
front, |
|
|
f12 & |
nms, |
|
|
float |
a_epsil = 0.0f |
|
) |
| |
|
inlineprotected |
Definition at line 249 of file tex_rect.
252 float w2 = aspect*h2;
◆ _tris()
void tools::sg::tex_rect::_tris |
( |
f18 & |
tris, |
|
|
f18 & |
nms |
|
) |
| |
|
inlineprotected |
◆ bbox()
virtual void tools::sg::tex_rect::bbox |
( |
bbox_action & |
a_action | ) |
|
|
inlinevirtual |
◆ cast()
virtual void* tools::sg::tex_rect::cast |
( |
const std::string & |
a_class | ) |
const |
|
inlinevirtual |
Reimplemented from tools::sg::base_tex.
Definition at line 29 of file tex_rect.
30 {
if(
void* p = cmp_cast<tex_rect>(
this,a_class))
return p;}
32 return parent::cast(a_class);
◆ intersect_value()
virtual bool tools::sg::tex_rect::intersect_value |
( |
std::ostream & |
, |
|
|
intersect_type |
, |
|
|
const line< vec3f > & |
a_line, |
|
|
std::string & |
a_s |
|
) |
| const |
|
inlinevirtual |
Implements tools::sg::base_tex.
Definition at line 163 of file tex_rect.
167 if(_img.is_empty()) {a_s.
clear();
return false;}
169 float aspect = float(_img.width())/float(_img.height());
171 float w2 = aspect*h2;
173 plane<vec3f> plane(vec3f(w2,h2,0),vec3f(-w2,h2,0),vec3f(-w2,-h2,0));
175 if(!plane.intersect(a_line,p)) {a_s.clear();
return false;}
177 float imw = (float)_img.width();
178 float imh = (float)_img.height();
181 int ix = int((imw*p.x()/w2+imw)*0.5f);
182 int iy = int((imh*p.y()/h2+imh)*0.5f);
185 std::vector<unsigned char> pixel;
186 if((ix<0)||(iy<0)||!_img.pixel(ix,iy,pixel)) {a_s.clear();
return false;}
189 for(
unsigned int ipix=0;ipix<pixel.size();ipix++) {
191 if(!numas<float>(
float(pixel[ipix])/255.0f,a_s)){}
◆ node_desc_fields()
virtual const desc_fields& tools::sg::tex_rect::node_desc_fields |
( |
| ) |
const |
|
inlinevirtual |
Reimplemented from tools::sg::node.
Definition at line 38 of file tex_rect.
40 static const desc_fields s_v(parent::node_desc_fields(),6,
◆ operator=()
Definition at line 216 of file tex_rect.
217 parent::operator=(a_from);
220 if(&a_from==
this)
return *
this;
◆ pick()
virtual void tools::sg::tex_rect::pick |
( |
pick_action & |
a_action | ) |
|
|
inlinevirtual |
◆ render()
virtual void tools::sg::tex_rect::render |
( |
render_action & |
a_action | ) |
|
|
inlinevirtual |
Reimplemented from tools::sg::node.
Definition at line 60 of file tex_rect.
61 #ifdef TOOLS_SG_TEX_RECT_DEBUG
62 a_action.out() <<
"tools::tex_rect::render : begin : 001 : " << std::endl;
69 #ifdef TOOLS_SG_TEX_RECT_DEBUG
70 a_action.out() <<
"tools::tex_rect::render : touched." << std::endl;
76 #ifdef TOOLS_SG_TEX_RECT_DEBUG
77 a_action.out() <<
"tools::tex_rect::render : m_img is empty." << std::endl;
82 #ifdef TOOLS_SG_TEX_RECT_DEBUG
83 a_action.out() <<
"tools::tex_rect::render : have a m_img. get_tex_id ..." << std::endl;
88 #ifdef TOOLS_SG_TEX_RECT_DEBUG
89 a_action.out() <<
"tools::tex_rect::render : get_tex_id : " << _id <<
"." << std::endl;
92 const state& state = a_action.state();
100 #ifdef TOOLS_SG_TEX_RECT_DEBUG
101 a_action.out() <<
"tools::tex_rect::render : show_border." << std::endl;
106 a_action.color4f(1,0,0,1);
107 a_action.line_width(4);
112 a_action.set_polygon_offset(
true);
114 a_action.color4f(state.m_color);
115 a_action.line_width(state.m_line_width);
118 #ifdef TOOLS_SG_TEX_RECT_DEBUG
119 a_action.out() <<
"tools::tex_rect::render : draw back face." << std::endl;
126 a_action.draw_vertex_normal_array(
gl::triangles(),18,tris,nms);
127 a_action.color4f(state.m_color);}
130 #ifdef TOOLS_SG_TEX_RECT_DEBUG
131 a_action.out() <<
"tools::tex_rect::render : draw_vertex_normal_array_texture." << std::endl;
137 a_action.draw_vertex_normal_array_texture(
gl::triangle_fan(),12,xyzs,nms,_id,tcs);
139 a_action.set_polygon_offset(state.m_GL_POLYGON_OFFSET_FILL);
◆ rendered_size()
void tools::sg::tex_rect::rendered_size |
( |
std::ostream & |
a_out, |
|
|
unsigned int & |
a_w, |
|
|
unsigned int & |
a_h |
|
) |
| |
|
inline |
◆ update_sg()
void tools::sg::tex_rect::update_sg |
( |
std::ostream & |
a_out | ) |
|
|
inlineprotected |
◆ height
sf<float> tools::sg::tex_rect::height |
◆ show_border
sf<bool> tools::sg::tex_rect::show_border |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/sg/tex_rect