NTRT Simulator  v1.1
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
tgWorld.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012, United States Government, as represented by the
3  * Administrator of the National Aeronautics and Space Administration.
4  * All rights reserved.
5  *
6  * The NASA Tensegrity Robotics Toolkit (NTRT) v1 platform is licensed
7  * under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * http://www.apache.org/licenses/LICENSE-2.0.
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific language
16  * governing permissions and limitations under the License.
17 */
18 
19 
20 #ifndef TG_WORLD_H
21 #define TG_WORLD_H
22 
29 // Forward declarations
30 class tgWorldImpl;
31 class tgGround;
32 
37 class tgWorld
38 {
39 public:
40 
45  struct Config
46  {
47  Config(double g = 9.81, double ws = 1000);
53  double gravity;
58  double worldSize;
59  };
60 
62  tgWorld();
63 
68  tgWorld(const Config& config);
69 
76  tgWorld(const Config& config, tgGround* ground);
77 
79  ~tgWorld();
80 
82  void reset();
83 
88  void reset(const Config& config);
89 
95  void step(double dt) const;
96 
103  {
104  return *m_pImpl;
105  }
106 
107 private:
108 
110  bool invariant() const;
111 
112  private:
113 
117  Config m_config;
118 
120  tgGround* m_pGround;
121 
123  tgWorldImpl * m_pImpl;
124 };
125 
126 #endif //TG_BULLET_WORLD_H
~tgWorld()
Definition: tgWorld.cpp:84
double gravity
Definition: tgWorld.h:53
void step(double dt) const
Definition: tgWorld.cpp:109
tgWorldImpl & implementation() const
Definition: tgWorld.h:102
tgWorld()
Definition: tgWorld.cpp:49
double worldSize
Definition: tgWorld.h:58
void reset()
Definition: tgWorld.cpp:90