Commits

German Larrain committed 0dee782

simulator.SimulatedPhysicsObject:
-implemented method 'offset_by_position' instead of being abstract,
-removed it from subclasses 'SimulatedBody' and 'SimulatedJoint'.

Comments (0)

Files changed (1)

ars/model/simulator/__init__.py

 		rot_final = mu.matrix_as_tuple(mu.matrix3_multiply(rot_to_apply, rot_now))
 		self.set_rotation(rot_final)
 
-	@abstractmethod
 	def offset_by_position(self, offset_pos):
-		pass
+		pos = self.get_position()
+		new_pos = mu.add3(offset_pos, pos)
+		self.set_position(new_pos)
 
 	def offset_by_object(self, object_):
 		offset_pos = object_.get_position()
 		self._body = body
 		self._geom = geom # we might need it in the future
 
-	def offset_by_position(self, offset_pos):
-		pos = self._body.get_position()
-		new_pos = mu.add3(offset_pos, pos)
-		self.set_position(new_pos)
-
 	#def has_body(self):
 	#	return not self._body is None
 
 		super(SimulatedJoint, self).__init__(name, actor)
 		self._joint = joint
 
-	def offset_by_position(self, offset_pos):
-		raise NotImplementedError()
-
 	#===========================================================================
 	# DYNAMIC AND KINEMATIC INTERACTION
 	#===========================================================================