Commit 6e777fc
Camera overhaul simple (#1965)
* 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>1 parent 99e5b36 commit 6e777fc
File tree
75 files changed
+3103
-1325
lines changed- arcade
- camera
- grips
- examples
- gl
- experimental
- clock
- gui
- widgets
- resources/system/shaders/util
- texture_atlas
- doc
- api_docs
- tutorials
- lights
- raycasting
- views
- tests
- unit
- camera
- gl
- gui
- texture
- window
- util
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
75 files changed
+3103
-1325
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | | - | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| |||
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
| 222 | + | |
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
| |||
243 | 242 | | |
244 | 243 | | |
245 | 244 | | |
246 | | - | |
247 | | - | |
248 | 245 | | |
249 | 246 | | |
250 | 247 | | |
| |||
358 | 355 | | |
359 | 356 | | |
360 | 357 | | |
361 | | - | |
362 | 358 | | |
363 | 359 | | |
364 | 360 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
214 | 218 | | |
215 | | - | |
| 219 | + | |
| 220 | + | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| |||
606 | 607 | | |
607 | 608 | | |
608 | 609 | | |
609 | | - | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
614 | | - | |
615 | | - | |
| 610 | + | |
| 611 | + | |
616 | 612 | | |
617 | 613 | | |
618 | 614 | | |
| |||
676 | 672 | | |
677 | 673 | | |
678 | 674 | | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | 675 | | |
700 | 676 | | |
701 | 677 | | |
702 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
703 | 688 | | |
704 | 689 | | |
705 | 690 | | |
| |||
0 commit comments