simulation.py 815B

1234567891011121314151617181920212223242526272829
  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. def is_possible_subject_position(self, subject: XYZSubject, position: tuple) -> bool:
  19. return self.is_possible_position(position)
  20. def is_possible_position(self, position: tuple) -> bool:
  21. return True