Commits

German Larrain  committed 712f850

collision.adapters.Engine: added 'calc_collision'; removed old comments section.

  • Participants
  • Parent commits e9fa47d

Comments (0)

Files changed (1)

File ars/model/collision/adapters.py

 
 	"""Adapter to the ODE collision engine."""
 
-	#==========================================================================
-	# Functions and methods not overriding base class functions and methods
-	#==========================================================================
+	@classmethod
+	def calc_collision(cls, geom1, geom2):
+		"""Calculate information of the collision between these geoms.
+
+		Check if ``geom1`` and ``geom2`` actually collide and
+		create a list of contact data objects if they do.
+
+		:param geom1:
+		:type geom1: :class:`ode.GeomObject`
+		:param geom2:
+		:type geom2: :class:`ode.GeomObject`
+		:return: contacts information
+		:rtype: list of :class:`ode.Contact`
+
+		"""
+		return ode.collide(geom1, geom2)
 
 	@classmethod
 	def near_callback(cls, args, geom1, geom2):
 		# create contact joints
 		#======================================================================
 		# check if the objects collide
-		contacts = ode.collide(geom1, geom2)
+		contacts = cls.calc_collision(geom1, geom2)
 		for c in contacts:
 
 			if ray_geom is not None: