Commits

German Larrain committed 0acc64e

model: added docstrings to all get/set position/rotation methods.

Comments (0)

Files changed (5)

ars/model/collision/adapters.py

 	#==========================================================================
 
 	def get_position(self):
+		"""Get the position of the geom.
+
+		:return: position
+		:rtype: 3-sequence of floats
+
+		"""
 		return self._inner_object.getPosition()
 
 	def get_rotation(self):
+		"""Get the orientation of the geom.
+
+		:return: rotation matrix
+		:rtype: 9-sequence of floats
+
+		"""
 		return self._inner_object.getRotation()
 
 	def set_position(self, pos):
+		"""Set the position of the geom.
+
+		:param pos: position
+		:type pos: 3-sequence of floats
+
+		"""
 		self._inner_object.setPosition(pos)
 
 	def set_rotation(self, rot):
+		"""Set the orientation of the geom.
+
+		:param rot: rotation matrix
+		:type rot: 9-sequence of floats
+
+		"""
 		self._inner_object.setRotation(rot)
 
 

ars/model/collision/base.py

 
 	@abstractmethod
 	def get_position(self):
+		"""Get the position of the geom.
+
+		:return: position
+		:rtype: 3-sequence of floats
+
+		"""
 		pass
 
 	@abstractmethod
 	def get_rotation(self):
+		"""Get the orientation of the geom.
+
+		:return: rotation matrix
+		:rtype: 9-sequence of floats
+
+		"""
 		pass
 
 	@abstractmethod
 	def set_position(self, pos):
+		"""Set the position of the geom.
+
+		:param pos: position
+		:type pos: 3-sequence of floats
+
+		"""
 		pass
 
 	@abstractmethod
 	def set_rotation(self, rot):
+		"""Set the orientation of the geom.
+
+		:param rot: rotation matrix
+		:type rot: 9-sequence of floats
+
+		"""
 		pass
 
 

ars/model/physics/adapters.py

 	#==========================================================================
 
 	def get_position(self):
+		"""Get the position of the body.
+
+		:return: position
+		:rtype: 3-sequence of floats
+
+		"""
 		return self._inner_object.getPosition()
 
 	def get_linear_velocity(self):
 		return self._inner_object.getLinearVel()
 
 	def get_rotation(self):
+		"""Get the orientation of the body.
+
+		:return: rotation matrix
+		:rtype: 9-sequence of floats
+
+		"""
 		return self._inner_object.getRotation()
 
 	def get_angular_velocity(self):
 		return self._inner_object.getMass().I
 
 	def set_position(self, pos):
+		"""Set the position of the body.
+
+		Sends :data:`signals.BODY_PRE_SET_POSITION` and
+		:data:`signals.BODY_POST_SET_POSITION`.
+
+		:param pos: position
+		:type pos: 3-sequence of floats
+
+		"""
 		dispatcher.send(signals.BODY_PRE_SET_POSITION, sender=self)
 		self._inner_object.setPosition(pos)
 		dispatcher.send(signals.BODY_POST_SET_POSITION, sender=self)
 
 	def set_rotation(self, rot):
+		"""Set the orientation of the body.
+
+		Sends :data:`signals.BODY_PRE_SET_ROTATION` and
+		:data:`signals.BODY_POST_SET_ROTATION`.
+
+		:param rot: rotation matrix
+		:type rot: 9-sequence of floats
+
+		"""
 		dispatcher.send(signals.BODY_PRE_SET_ROTATION, sender=self)
 		self._inner_object.setRotation(rot)
 		dispatcher.send(signals.BODY_POST_SET_ROTATION, sender=self)

ars/model/physics/base.py

 
 	@abstractmethod
 	def get_position(self):
+		"""Get the position of the body.
+
+		:return: position
+		:rtype: 3-sequence of floats
+
+		"""
 		raise NotImplementedError()
 
 	@abstractmethod
 
 	@abstractmethod
 	def get_rotation(self):
+		"""Get the orientation of the body.
+
+		:return: rotation matrix
+		:rtype: 9-sequence of floats
+
+		"""
 		raise NotImplementedError()
 
 	@abstractmethod
 
 	@abstractmethod
 	def set_position(self, pos):
-		"""Subclasses implementing this method must send the correponding
-		signals, defined in :mod:`ars.model.physics.signals`.
+		"""Set the position of the body.
+
+		Sends :data:`signals.BODY_PRE_SET_POSITION` and
+		:data:`signals.BODY_POST_SET_POSITION`.
+
+		:param pos: position
+		:type pos: 3-sequence of floats
 
 		"""
 		raise NotImplementedError()
 
 	@abstractmethod
 	def set_rotation(self, rot):
-		"""Subclasses implementing this method must send the correponding
-		signals, defined in :mod:`ars.model.physics.signals`.
+		"""Set the orientation of the body.
+
+		Sends :data:`signals.BODY_PRE_SET_ROTATION` and
+		:data:`signals.BODY_POST_SET_ROTATION`.
+
+		:param rot: rotation matrix
+		:type rot: 9-sequence of floats
 
 		"""
 		raise NotImplementedError()

ars/model/robot/sensors.py

 
 		Useful mainly when it is not attached to a body.
 
+		:param pos: position
+		:type pos: 3-sequence of floats
+
 		"""
 		# TODO: if mounted, w.r.t what?
 		self._ray.set_position(pos)
 
 		Useful mainly when it is not attached to a body.
 
+		:param rot: rotation matrix
+		:type rot: 9-sequence of floats
+
 		"""
 		# TODO: if mounted, w.r.t what?
 		self._ray.set_rotation(rot)
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.