Commits

German Larrain committed e423749

physics.adapters: refactored OdeEngine.create_world into '_create_ode_world'; OdeWorld's constructor uses the new function.

Comments (0)

Files changed (1)

ars/model/physics/adapters.py

 
 		"""
 		super(OdeWorld, self).__init__(gravity, *args, **kwargs)
-
-		world = ode.World()
-		world.setGravity(gravity)
-		world.setERP(ERP)
-		world.setCFM(CFM)
-		self._inner_object = world
+		self._inner_object = _create_ode_world(gravity, ERP, CFM)
 
 	@property
 	def gravity(self):
 	@staticmethod
 	def create_joint_group():
 		return ode.JointGroup()
-	
-	@staticmethod
-	def create_world(gravity=(0.0,-9.81,0.0), ERP=0.8, CFM=1E-10):
-		"""Create an ODE world object"""
-		world = ode.World()
-		world.setGravity(gravity)
-		world.setERP(ERP)
-		world.setCFM(CFM)
-		return world
 
 	@staticmethod
 	def create_plane_geom(space, normal, dist):
 # Private functions
 #===============================================================================
 
+
+def _create_ode_world(gravity=(0.0,-9.81,0.0), ERP=0.8, CFM=1E-10):
+	"""Create an ODE world object"""
+	world = ode.World()
+	world.setGravity(gravity)
+	world.setERP(ERP)
+	world.setCFM(CFM)
+	return world
+
+
 def _create_ode_capsule(world, length, radius, mass=None, density=None):
 
 	capsule_direction = 3 # z-axis
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.