예제 #1
0
파일: body.py 프로젝트: diegor2/FGAme
    def orientation(self, theta=0.0):
        '''Retorna um vetor unitário na direção em que o objeto está orientado.
        Pode aplicar um ângulo adicional a este vetor fornecendo o parâmetro
        _theta.'''

        theta += self._theta
        return Vec2(cos(theta), sin(theta))
예제 #2
0
파일: poly.py 프로젝트: gutioliveira/FGAme
 def _vertices(self, N, pos):
     length = self.length
     alpha = pi / N
     theta = 2 * alpha
     b = length / (2 * sin(alpha))
     P0 = Vec2(b, 0)
     pos = Vec2(*pos)
     return [(P0.rotate(n * theta)) + pos for n in range(N)]
예제 #3
0
 def _vertices(self, N, pos):
     length = self.length
     alpha = pi / N
     theta = 2 * alpha
     b = length / (2 * sin(alpha))
     P0 = Vec2(b, 0)
     pos = Vec2(*pos)
     return [(P0.rotate(n * theta)) + pos for n in range(N)]