forked from pythonarcade/arcade
-
Notifications
You must be signed in to change notification settings - Fork 0
Add basic swizzle tests w/o itertools #2
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
Merged
Merged
Conversation
This file contains hidden or 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
DigiDuncan
pushed a commit
that referenced
this pull request
Apr 6, 2024
* Setup primary files for experimental refactor of the Camera, Backgrounds, and Scenes. See the #Possible Scene Improvements #Cameras topics in the arcade-dev forum on the Python Arcade discord server. * Completed the Camera2DOrthographic class with doc strings and comments, and started the Camera2DController, and SimpleCamera classes. See the #Possible Scene Improvements #Cameras topics in the arcade-dev forum on the Python Arcade discord server for more info. * Slight change to Cameras to allow for a perspective projection matrix. Created basic Perspective and Orthographic Cameras. See the #Possible Scene Improvements #Cameras topics in the arcade-dev forum on the Python Arcade discord server for more info. * Completed Orthographic Camera. Had some issues with the view matrix, This has been fixed and applied to both of the base cameras. Added a new get map coordinates function (open to change). Placed framework for backwards compatible simple camera. See the #Possible Scene Improvements #Cameras topics in the arcade-dev forum on the Python Arcade discord server for more info. * Update camera_refactor.py Finished Simple Camera. Is backwards compatible with current Simple Camera implementation. * PR cleanup Cleaning up PR to only include camera refactor * New Camera Code Integration Moved experimental code into new "cinematic" folder within arcade. Also made the default camera in arcade the "DefaultCamera" class. and made it's type be "Projector" * Code inspection Clean up * Inspection Fix 2 * Code inspection fix 3 * Round 4 * Writitng initial Unit Tests Created files for unit tests, and wrote a few. Started work on Camera2D (replacement for simple camera) * Finished base of Camera2D class. The basics for Camera2D have been provided with full doc strings. Other helper methods may be added in the future. * code-inspection clean-up on Camera2D Fixed `mypy`, `pyright`, `ruff` errors. Also added __all__ property to every file for a better importing experience. NOTE arcade/camera.py is still there, and it does not match the current system so the code-inspection still complains. Will resolve later. * Removed all reference to old camera system. This included deleting `arcade/camera.py`, and fixing the ui and sections to use either the Default Ortho Projector. NOTE I removed a quick index to the `camera.rst`. That will need to be fixed. Hey look I linted before pushing for once! * whoops circular imports * circular imports 2 * type checking * Started work on some controllers Made a few function controllers which are mega simple. Also changed name from arcade.cinematic to arcade.camera. Also moved the controllers to arcade.camera.controllers. * fixing silly pycharm muck-up when I changed the file name it didn't update any imports tsk tsk. * removing doc ref Have not setup camera documentation so removing old ref. DO NOT PULL PR UNTIL FIXED. * Updated Orthographic Unit Tests grrrrr pycharm * Fixed all the examples NOTE this is a quick fix. It removed shaking from two examples. CANNOT BE PULLED IN WHILE THIS IS UNRESOLVED. Weirdly the linters didn't pick up on these errors * linting fix 1-million * 1-million and 1 * 1-million and 2 * MOAR example fixing * Setup 4 Splines for SplineController setup lerp, quadratic, cubic, b-spline Contemplating how to do spline controller * Removed splines from this PR Removed Splines Made Isometric Controller Fixed small issue with facing direction doing temp rendering test so don't mind `log.png` * General work * Cleaned up Offscreen renderer Added 'nother default glsl shader. Also cleaned up some linting. * Squashed commit of the following: commit 7d56d39 Author: DragonMoffon <happydog.aja@gmail.com> Date: Fri Aug 18 05:16:55 2023 +1200 Created a camera shake class Created a camera shake class. It isn't exactly like the shake provided before so people might what to have a review. * added screen shake doc * lovely useless doc strings NOTE: The doc strings aren't useless. The code just is. Going to completely change the class. * improving screen shake * touch-ups * Finalised Core camera functionality - Removed all reference to arcade.ser_viewport method - fixed incorrect forward direction for SimpleCamera - Includes projectors, SimpleCamera, and Camera2D - Includes minimal functions for moving cameras. * Removed references to projection_2d * Fixing unit tests * Solved pytest issues in GUI due to Camera Code * Fixed small linting issue * Fixed double brackets caused by find and replace * Whoops didn't run integration tests * Created Camera Shake Controller. Created a camera shake controller to replace the one removed. * Completed Doc Strings * Replacing all references of SimpleCamera with Camera2D * Fixing integration test errors, and examples. Did not get to all examples * attempting to fix gui part 1 * Fixed erroneous ui behaviour with new camera. * fixed linting issues * Fixing Issues from pvcraven´s review resolved pvcraven´s review. Also created a perspective camera demo. setup unit tests. * Fixed issues pointed out by MiCurry thanks MiCurry for the editing on that! Also did linting. Currently fails on the camera_perspective_demo.py because of how I threw it together. Will fix in next commit * Improved Camera Shake and Unit Tests Changed the screen shake to store the shake dir but not vector so it should work with rotating the camera now. Added a `readjust_camera` method to the SceenShakeController. Also finished it´s unit tests. * Improved Orthographic and Perspective Unit Tests * Added cull_mode to spritelists Currently only picks between 'orthographic' and 'disabled' * Started working on simple camera controller unit tests * continue perspective work * Removed unfinished perspective camera To allow the new camera code to be integrated into 3.0 the perspective camera was removed. Unit tests for controller methods have not been finished. * Missing tuple import * hwidth -> width * Revert cull_mode in SpriteList * Add & improve type annotations * Add missing annotations in simple_controller_classes.py * Add missing return annotation to OrthographicProjector.use() * Add missing return annotation to SimpleCamerea.use() * Add Camera Protocol type to arcade.camera.types * Correct overly-wide lines in ViewportProjector.__init__ * Add missing return annotation to ViewportProjector.viewport property * Fix return annotation + overwide lines in ViewportProjector.viewport setter * Add return type annotation to ViewportProjector.use() * Add return annotation to DefaultProjector.use() * Add return annotation to Camera2D.projection_width setter * Add return annotation to Camera2D.angle setter * Add Camera protocol to __all__ in arcade.camera.types * Use recursive definition in Projector Protocol * Remove pos from Camera2D * Add method to duplicate CameraData * Fix typing for linting as always >:) * Working test_strafe * Docstring fixes * Initializer docs should be in the class docstring * Convert all google style docstrings to standard format * Improve camera docs, typing, and style (#2) * Cleanup the docstrings for properties in Camera2D * Simplify projection initialization in Camera2D * Remove redundant bool() calls in Camera2D.__init__ * Further simplify Camera2D.__init__ * Docstring cleanup for arcade.camera.data * Camera2D top-level docstring improvements * Moving protocols and making the PoDs into slots classes * Fixing linting (Thanks Push) * Extract non PoD arguments from the Camera2D init and add a RenderTarget property to Camera2D The render target change was discussed with @einarf. May extend to other camera types later. * Added an easy screenshot method to window commands CURRENTLY DOES NOT WORK NEED TO DEBUG WITH @einarf * created a depth of field example * Revert "created a depth of field example" This reverts commit 1536ecd. * Revert "Added an easy screenshot method to window commands" This reverts commit a54a570. * Updating arcade.math changed lerp_vec to lerp_2d created lerp_3d, and quaternion_rotation methods. Also updated any methods which used lerp_vec * gave arcade.camera.Camera2D default init arguments * Added function to constrain arcade.camera.CameraData * moved arcade.camera.controllers to arcade.camera.grips * updated examples to use new functions for camera control * remove example from arcade.math.quaternion_rotation * improving typing for ui_manager * Revert "improving typing for ui_manager" This reverts commit 3b118c8. * Revert "Merge branch 'development' into Camera-Overhaul-Simple" This reverts commit 94b3128, reversing changes made to bb2c1d8. * update map_coordiantes to map_screen_to_world_coordinates * Adding a temporary README to cameras for documentation * Completed clean-up and sanity check * Revert "Revert "Merge branch 'development' into Camera-Overhaul-Simple"" This reverts commit 788072e. * Fix typing issues in ui manager * Fixed WindowProxy to use modern camera sensibilities * Give the data PoDs __str__ and __repr__ methods * Linting fix for __repr__ methods * Updated unit tests to parameterize window size * Improving the state reset between unit tests --------- Co-authored-by: Einar Forselv <eforselv@gmail.com> Co-authored-by: Darren Eberly <darren@eber.ly> Co-authored-by: pushfoo <36696816+pushfoo@users.noreply.github.com>
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.
No description provided.