Commits

German Larrain committed 66781c3

simulator.Simulation.add_basic_simulation_objects: added 'gravity' optional arg; added complete docstrings.

Comments (0)

Files changed (1)

ars/model/simulator/__init__.py

 		self.coll_engine = coll.OdeEngine()
 		self.phs_engine = phs.OdeEngine()
 
-	def add_basic_simulation_objects(self):
-		"""create the basic simulation objects"""
-		self._contact_group = self.phs_engine.create_joint_group() # for the contact joints generated during collisions
-		self._world = self.phs_engine.world_class() # create a world object (physical)
+	def add_basic_simulation_objects(self, gravity=(0.0,-9.81,0.0)):
+		"""Create the basic simulation objects needed for physics and collision
+		such as a contact group (holds temporary contact joints generated during
+		collisions), a simulation 'world' (where physics objects are processed)
+		and a collision space (the same thing for geoms and their
+		intersections).
+
+		:param gravity: Gravity acceleration.
+		:type gravity: 3 floats tuple.
+
+		"""
+		self._contact_group = self.phs_engine.create_joint_group()
+		self._world = self.phs_engine.world_class(gravity=gravity)
 		self._space = coll.Space()
 
 	def on_idle(self):