trace.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/trace.h"
18 
19 namespace tango_gl {
20 
21 static const int kMaxTraceLength = 5000;
22 static const float kDistanceCheck = 0.05f;
23 
24 Trace::Trace() : Line(3.0f, GL_LINE_STRIP) { SetShader(); }
25 
27  if (vec_vertices_.size() == 0) {
28  vec_vertices_.push_back(v);
29  } else {
30  float dist = glm::distance(vec_vertices_[vec_vertices_.size() - 1], v);
31  if (dist >= kDistanceCheck) {
32  vec_vertices_.push_back(v);
33  }
34  }
35 }
36 
38 } // namespace tango_gl
tango_gl::Trace::Trace
Trace()
Definition: trace.cpp:24
trace.h
tango_gl::Line
Definition: line.h:23
glm::distance
GLM_FUNC_DECL genType::value_type distance(genType const &p0, genType const &p1)
glm::detail::tvec3
Definition: type_mat.hpp:37
tango_gl::Trace::ClearVertexArray
void ClearVertexArray()
Definition: trace.cpp:37
tango_gl::kDistanceCheck
static const float kDistanceCheck
Definition: trace.cpp:22
tango_gl::kMaxTraceLength
static const int kMaxTraceLength
Definition: trace.cpp:21
f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
tango_gl::DrawableObject::SetShader
void SetShader()
Definition: drawable_object.cpp:22
v
Array< int, Dynamic, 1 > v
tango_gl::Trace::UpdateVertexArray
void UpdateVertexArray(const glm::vec3 &v)
Definition: trace.cpp:26
tango_gl
Definition: axis.cpp:20
tango_gl::Line::vec_vertices_
std::vector< glm::vec3 > vec_vertices_
Definition: line.h:34
dist
dist


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:22