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
f
GLM_FUNC_DECL genType::value_type distance(genType const &p0, genType const &p1)
static const float kDistanceCheck
Definition: trace.cpp:22
static const int kMaxTraceLength
Definition: trace.cpp:21
void UpdateVertexArray(const glm::vec3 &v)
Definition: trace.cpp:26
void ClearVertexArray()
Definition: trace.cpp:37
std::vector< glm::vec3 > vec_vertices_
Definition: line.h:34


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:43:40