-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Refactor of
Fizicks
System:Space
,Area
,Universe
) to better represent the simulation environment.Motion
andMatter
classes to separate concerns and improve readability.Efficiency Improvements:
Vector
class with additional methods likenormalize
,dot product
, andmagnitude
for better vector operations.New Features:
Universe
class to manage physical constants and properties more effectively.Bug Fixes:
Testing: