simulation.py 875B

12345678910111213141516171819202122232425262728293031
  1. # coding: utf-8
  2. from synergine2.config import Config
  3. from synergine2.simulation import Simulation as BaseSimulation
  4. from synergine2_xyz.physics import Physics
  5. from synergine2_xyz.subjects import XYZSubjects
  6. from synergine2_xyz.subjects import XYZSubject
  7. class XYZSimulation(BaseSimulation):
  8. accepted_subject_class = XYZSubjects
  9. def __init__(
  10. self,
  11. config: Config,
  12. ) -> None:
  13. super().__init__(config)
  14. self.physics = self.create_physics()
  15. self.physics.load()
  16. def create_physics(self) -> Physics:
  17. return Physics(self.config)
  18. # TODO: Move into physics
  19. def is_possible_subject_position(self, subject: XYZSubject, position: tuple) -> bool:
  20. return self.is_possible_position(position)
  21. # TODO: Move into physics
  22. def is_possible_position(self, position: tuple) -> bool:
  23. return True