Skip to content

Conversation

@nikitavbv
Copy link
Collaborator

No description provided.

@nikitavbv
Copy link
Collaborator Author

Camera controls & scenes

1 similar comment
@nikitavbv
Copy link
Collaborator Author

Camera controls & scenes

@codecov-io
Copy link

codecov-io commented Jun 9, 2019

Codecov Report

Merging #8 into dev will decrease coverage by 11.23%.
The diff coverage is 39.21%.

Impacted file tree graph

@@              Coverage Diff              @@
##                dev       #8       +/-   ##
=============================================
- Coverage     84.17%   72.93%   -11.24%     
- Complexity      147      176       +29     
=============================================
  Files            23       31        +8     
  Lines           455      606      +151     
  Branches         38       44        +6     
=============================================
+ Hits            383      442       +59     
- Misses           69      161       +92     
  Partials          3        3
Impacted Files Coverage Δ Complexity Δ
...s/introtoprogramming/lab5/gui/MouseController.java 0% <0%> (ø) 0 <0> (?)
...oprogramming/lab5/scene/BasicRaytracingRender.java 90.47% <0%> (-9.53%) 10 <0> (ø)
.../introtoprogramming/lab5/gui/InputKeyListener.java 0% <0%> (ø) 0 <0> (?)
.../java/labs/introtoprogramming/lab5/gui/Window.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...c/main/java/labs/introtoprogramming/lab5/Main.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...trotoprogramming/lab5/gui/SceneRendererWindow.java 0% <0%> (ø) 0 <0> (?)
...n/java/labs/introtoprogramming/lab5/gui/Input.java 100% <100%> (ø) 17 <17> (?)
...labs/introtoprogramming/lab5/scenes/DemoScene.java 100% <100%> (ø) 1 <1> (?)
...ava/labs/introtoprogramming/lab5/scene/Camera.java 100% <100%> (ø) 7 <1> (+1) ⬆️
...java/labs/introtoprogramming/lab5/scene/Scene.java 100% <100%> (ø) 2 <2> (?)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d1adb3...321c84d. Read the comment docs.


public class Input {

private boolean forwardKeyDown = false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assignment is redundant. Is it made for clarity?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, to make it clear that my default all keys are not down.


public abstract void addSceneObject(SceneObject obj);

public void addSceneObjects(SceneObject... obj) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make this function abstract and make abstract class as interface?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method implementation is likely to stay the same for all implementations. So doesn't make a lot of scene to make it abstract.

return false;
}

public void setInput(Input input) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of object are static and this functionality is redundant for them. Maybe is it more reasonable to get data from input and than apply it to object via transform?

private Input input;

public SceneRendererWindow(Scene scene) {
this(new BasicRaytracingRender(scene.getCamera().orElseThrow(NoCameraException::new).raster()), scene);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe is it better to refactor SceneRender to only accept scene, if raster can be obtain from camera now? Or is it out of place for this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple constructors increase flexibility. There should be a way to set custom scene render.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am talking about basicRaytracingRender. Maybe is it better to add constructor that only accept scene as argument and take raster from camera?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, right then.

@nikitavbv nikitavbv merged commit 066d43a into dev Jun 11, 2019
@nikitavbv nikitavbv deleted the scene-view branch June 11, 2019 17:12
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.

4 participants