app
android
jni
tango-gl
include
tango-gl
band.h
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
#ifndef TANGO_GL_BAND_H_
18
#define TANGO_GL_BAND_H_
19
20
#include <stdlib.h>
21
#include <vector>
22
23
#include "
tango-gl/drawable_object.h
"
24
25
namespace
tango_gl
{
26
class
Band
:
public
DrawableObject
{
27
public
:
28
enum
BandMode
{
29
kNormal
= 0,
30
kKeepLeft
= 1,
31
kKeepRight
= 2
32
};
33
34
Band
(
const
unsigned
int
max_legnth);
35
36
void
SetWidth
(
const
float
width);
37
// Render a Band with arrow head, pass in the mode for rendering,
38
// kKeepLeft is left turn, kKeepRight is right turn,
39
// when making a turn, vertices only get updated in one side to avoid overlapping.
40
void
UpdateVertexArray
(
const
glm::mat4
m,
BandMode
mode);
41
void
UpdateVertexArray
(
const
glm::mat4
m);
42
void
SetVertexArray
(
const
std::vector<glm::vec3>& v,
const
glm::vec3
& up);
43
void
ClearVertexArray
();
44
void
Render
(
const
glm::mat4
& projection_mat,
const
glm::mat4
& view_mat)
const
;
45
46
private
:
47
float
band_width_
;
48
unsigned
int
max_length_
;
49
std::vector<glm::vec3>
vertices_v_
;
50
// Current band head's left and right position in world frame.
51
glm::vec3
pivot_left
;
52
glm::vec3
pivot_right
;
53
};
54
}
// namespace tango_gl
55
#endif // TANGO_GL_BAND_H_
tango_gl::Band::Band
Band(const unsigned int max_legnth)
Definition:
band.cpp:25
tango_gl::Band::kKeepRight
@ kKeepRight
Definition:
band.h:31
tango_gl::Band::kNormal
@ kNormal
Definition:
band.h:29
glm::detail::tvec3
Definition:
type_mat.hpp:37
glm::detail::tmat4x4
Definition:
type_mat.hpp:47
tango_gl::Band::SetWidth
void SetWidth(const float width)
Definition:
band.cpp:33
tango_gl::Band::pivot_left
glm::vec3 pivot_left
Definition:
band.h:51
drawable_object.h
tango_gl::DrawableObject
Definition:
drawable_object.h:27
tango_gl::Band::max_length_
unsigned int max_length_
Definition:
band.h:48
tango_gl::Band::UpdateVertexArray
void UpdateVertexArray(const glm::mat4 m, BandMode mode)
Definition:
band.cpp:37
tango_gl::Band::BandMode
BandMode
Definition:
band.h:28
tango_gl::Band::band_width_
float band_width_
Definition:
band.h:47
tango_gl::Band::ClearVertexArray
void ClearVertexArray()
Definition:
band.cpp:130
tango_gl::Band
Definition:
band.h:26
tango_gl
Definition:
axis.cpp:20
tango_gl::Band::kKeepLeft
@ kKeepLeft
Definition:
band.h:30
tango_gl::Band::Render
void Render(const glm::mat4 &projection_mat, const glm::mat4 &view_mat) const
Definition:
band.cpp:132
tango_gl::Band::SetVertexArray
void SetVertexArray(const std::vector< glm::vec3 > &v, const glm::vec3 &up)
Definition:
band.cpp:104
tango_gl::Band::pivot_right
glm::vec3 pivot_right
Definition:
band.h:52
tango_gl::Band::vertices_v_
std::vector< glm::vec3 > vertices_v_
Definition:
band.h:49
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:06