Commits

German Larrain committed e7069be

workaround to revert changes in e195b8a17dc0 and keep them in this branch.

  • Participants
  • Parent commits 2dc63da
  • Branches dev-contrib

Comments (0)

Files changed (1)

ars/model/simulator/__init__.py

 import ars.graphics.adapters as gp
 from ars.lib.pydispatch import dispatcher
 import ars.model.collision.adapters as coll
+#import ars.model.contrib.ragdoll as cb
 import ars.model.physics.adapters as phs
 import ars.model.robot.joints as jo
 import ars.utils.geometry as gemut
 		self._space = None
 
 		self._floor_geom = None
+		#self._ragdoll = None
 
 		self._debug = do_debug
 		self._objects = {}
 
 		if self._debug:
 			print(self.sim_time)
+			#print(self._ragdoll.head.get_position())
 		self.update_actors()
 
 	def toggle_pause(self):
 			self.sim_time += time_step
 			self.num_iter += 1
 
-			# TODO: when "complex" objects are present, "update" them here
+			# TODO: abstract this to a call for each "complex" object present
+			#===================================================================
+			# try:
+			#	# apply internal ragdoll forces
+			#	if self._ragdoll: self._ragdoll.update_internal_forces()
+			# except (ValueError, AttributeError) as err:
+			#	print(err)
+			#===================================================================
 
 			# Remove all contact joints
 			self._contact_group.empty()
 		name = "obstacle"
 		return self.add_object(SimulatedBody(name, obstacle, g_capsule))
 
+#===============================================================================
+#	def add_ragdoll(self, offset, density):
+#		self._ragdoll = cb.RagDoll(self._world, self._space, offset, density)
+#		self._ragdoll.printMass()
+#
+#		for rBody in self._ragdoll.bodies:
+#			actor = gp.Capsule(rBody.length, rBody.radius, rBody.get_position())
+#			name = str(rBody)
+#			self.add_object(SimulatedBody(name, rBody, actor))
+#===============================================================================
+
 	def add_sphere(self, radius, center, mass=None, density=None):
 		body = phs.Sphere(self._world, self._space, radius, mass, density)
 		body.set_position(center)