peng3d/actor/player.py
def get_motion_vector(self):
        """
        Returns the movement vector according to held buttons and the rotation.
        
        :return: 3-Tuple of ``(dx,dy,dz)``
        :rtype: tuple
        """
        if any(self.move):
            x, y = self.actor._rot
            strafe = math.degrees(math.atan2(*self.move))
            y_angle = math.radians(y)
            x_angle = math.radians(x + strafe)
            dy = 0.0
            dx = math.cos(x_angle)
            dz = math.sin(x_angle)
        else:
            dy = 0.0
            dx = 0.0
            dz = 0.0
        return (dx, dy, dz)
def get_motion_vector(self):
        """
        Returns the movement vector according to held buttons and the rotation.
        
        :return: 3-Tuple of ``(dx,dy,dz)``
        :rtype: tuple
        """
        if any(self.move):
            x, y = self.actor._rot
            strafe = math.degrees(math.atan2(*self.move))
            y_angle = math.radians(y)
            x_angle = math.radians(x + strafe)
            dy = 0.0
            dx = math.cos(x_angle)
            dz = math.sin(x_angle)
        else:
            dy = 0.0
            dx = 0.0
            dz = 0.0
        return (dx, dy, dz)
def get_motion_vector ( self ) : if any ( self . move ) : x , y = self . actor . _rot strafe = math . degrees ( math . atan2 ( * self . move ) ) y_angle = math . radians ( y ) x_angle = math . radians ( x + strafe ) dy = 0.0 dx = math . cos ( x_angle ) dz = math . sin ( x_angle ) else : dy = 0.0 dx = 0.0 dz = 0.0 return ( dx , dy , dz )
Returns the movement vector according to held buttons and the rotation.
        
        :return: 3-Tuple of ``(dx,dy,dz)``
        :rtype: tuple
Returns the movement vector according to held buttons and the rotation . : return : 3 - Tuple of ( dx dy dz ) : rtype : tuple