Loading...
Searching...
No Matches
Physics.hh
Go to the documentation of this file.
1/*
2 * Copyright 2018 Open Source Robotics Foundation
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 SDF_PHYSICS_HH_
18#define SDF_PHYSICS_HH_
19
20#include <string>
21
22#include "sdf/Element.hh"
23#include "sdf/Types.hh"
24#include "sdf/sdf_config.h"
25#include "sdf/system_util.hh"
26
27namespace sdf
28{
29 // Inline bracket to help doxygen filtering.
30 inline namespace SDF_VERSION_NAMESPACE {
31 //
32
33 // Forward declare private data class.
34 class PhysicsPrivate;
35
39 {
41 public: Physics();
42
45 public: Physics(const Physics &_physics);
46
49 public: Physics(Physics &&_physics) noexcept;
50
54 public: Physics &operator=(Physics &&_physics);
55
59 public: Physics &operator=(const Physics &_physics);
60
62 public: ~Physics();
63
70 public: Errors Load(ElementPtr _sdf);
71
74 public: std::string Name() const;
75
78 public: void SetName(const std::string &_name) const;
79
84 public: sdf::ElementPtr Element() const;
85
92 public: bool IsDefault() const;
93
96 public: void SetDefault(const bool _default) const;
97
102 public: std::string EngineType() const;
103
106 public: void SetEngineType(const std::string &_type);
107
112 public: double MaxStepSize() const;
113
116 public: void SetMaxStepSize(const double _step);
117
122 public: double RealTimeFactor() const;
123
126 public: void SetRealTimeFactor(const double _factor);
127
129 private: PhysicsPrivate *dataPtr = nullptr;
130 };
131 }
132}
133#endif
The physics element specifies the type and properties of a dynamics engine.
Definition Physics.hh:39
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
std::string Name() const
Get the name of this set of physics parameters.
Physics(const Physics &_physics)
Copy constructor.
void SetName(const std::string &_name) const
Set the name of this set of physics parameters.
void SetDefault(const bool _default) const
Set whether this physics profile is the default.
~Physics()
Destructor.
Physics(Physics &&_physics) noexcept
Move constructor.
Physics & operator=(Physics &&_physics)
Move assignment operator.
void SetEngineType(const std::string &_type)
Set the physics profile dynamics engine type.
bool IsDefault() const
Get whether this physics profile is marked as default.
void SetMaxStepSize(const double _step)
Set the max step size in seconds.
Errors Load(ElementPtr _sdf)
Load the physics based on an element pointer.
void SetRealTimeFactor(const double _factor)
Set the target realtime factor.
double RealTimeFactor() const
Get the target real time factor.
Physics()
Default constructor.
std::string EngineType() const
Get the physics profile dynamics engine type.
Physics & operator=(const Physics &_physics)
Copy assignment operator.
double MaxStepSize() const
Get the max step size in seconds.
std::vector< Error > Errors
A vector of Error.
Definition Types.hh:89
std::shared_ptr< Element > ElementPtr
Definition Element.hh:53
namespace for Simulation Description Format parser
Definition Actor.hh:33
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition system_util.hh:48