Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
y
z
Variables
a
b
c
d
e
f
h
i
k
l
m
n
s
t
v
w
Typedefs
a
b
c
d
e
f
h
i
l
m
n
p
q
s
u
v
w
Enumerations
Enumerator
c
d
f
h
l
m
n
r
s
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
m
n
o
p
r
s
t
u
v
Enumerations
b
c
d
f
l
n
o
p
r
s
t
v
Enumerator
_
c
d
f
h
k
n
q
r
s
t
v
x
y
Related Functions
b
c
d
o
r
s
u
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
Enumerator
b
c
d
e
f
k
l
n
p
s
t
u
w
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
app
android
jni
tango-gl
grid.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2014 Google Inc. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#include "
tango-gl/grid.h
"
18
19
namespace
tango_gl
{
20
21
// Initialize Grid with x and y grid count,
22
// qx, quantity in x
23
// qy, quantity in y.
24
Grid::Grid
(
float
density
,
int
qx,
int
qy) :
Line
(1.0
f
, GL_LINES) {
25
SetShader
();
26
27
// 3 float in 1 vertex, 2 vertices form a line.
28
// Horizontal line and vertical line forms the grid.
29
float
width =
density
* qx / 2;
30
float
height =
density
* qy / 2;
31
32
// Horizontal line.
33
for
(
int
i
= 0;
i
< (qy + 1);
i
++) {
34
for
(
int
j
= 0;
j
< (qx + 1);
j
++) {
35
vec_vertices_
.push_back(
glm::vec3
(-width +
j
*
density
, 0.0
f
, -height +
i
*
density
));
36
vec_vertices_
.push_back(
glm::vec3
(-width+ + (
j
+1)*
density
, 0.0f, -height +
i
*
density
));
37
}
38
}
39
40
for
(
int
i
= 0;
i
< (qx + 1);
i
++) {
41
for
(
int
j
= 0;
j
< (qy + 1);
j
++) {
42
vec_vertices_
.push_back(
glm::vec3
(-width +
i
*
density
, 0.0
f
, -height +
j
*
density
));
43
vec_vertices_
.push_back(
glm::vec3
(-width +
i
*
density
, 0.0
f
, -height + (
j
+1)*
density
));
44
}
45
}
46
}
47
}
// namespace tango_gl
tango_gl::Line
Definition:
line.h:23
grid.h
glm::detail::tvec3
Definition:
type_mat.hpp:37
tango_gl::Grid::Grid
Grid(float density=1.0f, int qx=50, int qy=50)
Definition:
grid.cpp:24
j
std::ptrdiff_t j
density
f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
tango_gl::DrawableObject::SetShader
void SetShader()
Definition:
drawable_object.cpp:22
tango_gl
Definition:
axis.cpp:20
tango_gl::Line::vec_vertices_
std::vector< glm::vec3 > vec_vertices_
Definition:
line.h:34
i
int i
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Feb 13 2025 03:44:55