Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.1.1: Refactor and Optimize Fizicks Physics System #1

Merged
merged 16 commits into from
Aug 11, 2024
Merged

Conversation

csmangum
Copy link
Collaborator

@csmangum csmangum commented Aug 11, 2024

Description:

This pull request introduces significant updates to the Fizicks module, focusing on refactoring the physics system and improving the overall structure and performance.

Changes Made:

  1. Refactor of Fizicks System:

    • Introduced new classes (Space, Area, Universe) to better represent the simulation environment.
    • Refactored the Motion and Matter classes to separate concerns and improve readability.
    • Added collision detection and resolution for both objects and borders.
  2. Efficiency Improvements:

    • Implemented spatial partitioning to optimize collision detection.
    • Enhanced the Vector class with additional methods like normalize, dot product, and magnitude for better vector operations.
  3. New Features:

    • Added toroidal universe handling for continuous space simulations.
    • Updated the Universe class to manage physical constants and properties more effectively.
  4. Bug Fixes:

    • Resolved issues with force application and velocity calculations in edge cases.
    • Fixed potential errors in vector operations due to incorrect type handling.

Testing:

  • All existing tests were updated to reflect the new structure.
  • New test cases were added for collision detection, vector operations, and the toroidal universe.

csmangum and others added 16 commits August 4, 2024 17:37
- Add Space class to represent the physical environment
- Introduce Fizicks class as a wrapper for physics simulation
- Remove individual law classes (FirstLaw, SecondLaw, ThirdLaw)
- Update Motion class to handle physics updates
- Improve type hinting and documentation
- Add Collision class with detect and resolve methods
- Implement collision detection using distance calculation
- Implement elastic collision resolution using vector decomposition
- Include type hints and docstrings for better code clarity
- Add detect_collision_with_border method to check for collisions
- Add resolve_collision_with_border method to handle collisions
- Include restitution coefficient for energy loss in collisions
- Update type hints and imports
- Rename 'Space' to 'Area' for consistency
- Add collision detection and resolution in Motion.update()
- Minor code style improvements
- Introduce Area class with dimensions and boundary properties
- Dimensions represented by Vector
- Option to set boundaries (default: False for toroidal space)
- Add SpatialPartitioning class for efficient object lookup
- Create ImprovedMotionWithCollision class extending Motion
- Update VisualDebugger to use spatial partitioning in simulation
- Refactor Object class to include debt attribute
- Add SimulationConfig class for centralized configuration
- Rename detect() and resolve() to detect_objects() and resolve_objects()
- Add detect_border() and resolve_border() methods for space boundaries
- Import Vector class directly for use in resolve_objects()
- Implement __mod__ for modular arithmetic
- Add magnitude() method to calculate vector length
- Implement normalize() to get unit vector
- Add dot() method for dot product calculation
- Add type hints and improve docstrings
- Move physics calculations to Fizicks class
- Replace Area with Universe in update method
- Simplify apply_force method
- Remove collision detection and resolution methods
…se support

- Update detect and resolve methods to handle both object-object and object-universe collisions
- Add support for toroidal universe in border collision detection and resolution
- Improve method naming and organization for better clarity
- Update docstrings to reflect new functionality and parameters
- Implement debt system for applying collision forces in next update
- Replace apply_force with add_debt method
- Implement position and velocity as properties
- Add type hint for Vector
- Update class docstring
- Replace Area with Universe in Motion.update
- Add collision detection with universe boundaries
- Update docstrings for clarity and consistency
- Remove redundant code in SecondLaw.apply
- Reorder collision checks in Motion.update
- Introduce Universe class to store universe properties and constants
- Add __iter__ and __call__ methods to Vector class
- Implement copy() method for Vector class
@csmangum csmangum merged commit 071e06a into main Aug 11, 2024
2 checks passed
@csmangum csmangum changed the title V0.1.1 V0.1.1: Refactor and Optimize Fizicks Physics System Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant