Particles.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
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 #ifndef SURGSIM_PARTICLES_PARTICLES_H
17 #define SURGSIM_PARTICLES_PARTICLES_H
18 
20 #include "SurgSim/Math/Vector.h"
21 
22 
23 namespace SurgSim
24 {
25 namespace Particles
26 {
27 
29 {
31  double lifetime;
32 
35 
39  bool operator==(const ParticleData& rhs) const
40  {
41  return lifetime == rhs.lifetime && velocity.isApprox(rhs.velocity);
42  }
43 
47  bool operator!=(const ParticleData& rhs) const
48  {
49  return !((*this) == rhs);
50  }
51 };
52 
55 
56 };
57 };
58 #endif //SURGSIM_PARTICLES_PARTICLES_H
59 
60 
Definition: CompoundShapeToGraphics.cpp:29
Math::Vector3d velocity
The velocity of the particle [m/s].
Definition: Particles.h:34
bool operator!=(const ParticleData &rhs) const
Inequality operator.
Definition: Particles.h:47
DataStructures::Vertices< ParticleData > Particles
Definition: Particles.h:53
Vertex structure for meshes.
Definition: Vertex.h:44
bool operator==(const ParticleData &rhs) const
Equality operator.
Definition: Particles.h:39
Definitions of small fixed-size vector types.
Particles::VertexType Particle
Definition: Particles.h:54
Definition: Particles.h:28
double lifetime
The lifetime of the particle [s].
Definition: Particles.h:31
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
Base class for mesh structures, handling basic vertex functionality.
Definition: Vertices.h:51