コード例 #1
0
ファイル: base_model.py プロジェクト: frlnx/melee
 def tangent_momentum_at(self, local_coordinates: Offsets) -> Offsets:
     if local_coordinates.distance == 0:
         return MutableOffsets(0, 0, 0)
     yaw = local_coordinates.rotated(90) * (
         self._spin.yaw_radian * self.inertia / local_coordinates.distance)
     return yaw
コード例 #2
0
 def test_position_direction_is_90(self):
     assert self.target.position.direction == Offsets(0, -90, 0)
コード例 #3
0
 def setup(self):
     position = Offsets(1, 0, 1)
     forces = Offsets(0, 0, -1)
     self.target = Force(position, forces)
     self.target.force_multiplier = 1.0
コード例 #4
0
 def setup(self):
     self.target = Offsets(1, 0, 0)
コード例 #5
0
 def setup(self):
     position = Offsets(-1, 0, 0)
     forces = Offsets(0, 0, -1)
     self.target = Force(position, forces)
コード例 #6
0
 def test_force_of_summed_forces_is_two_forwards(self):
     assert self.force.forces == Offsets(0, 0, -2)
コード例 #7
0
 def test_position_of_summed_forces_is_origo(self):
     assert self.force.position == Offsets(0, 0, 0)
コード例 #8
0
 def setup(self):
     self.left_force = Force(Offsets(-1, 0, 0), Offsets(0, 0, -1))
     self.right_force = Force(Offsets(1, 0, 0), Offsets(0, 0, -1))
     self.force = self.left_force + self.right_force
     self.force.force_multiplier = 1.0