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

Culling of both cameras #1198

Merged
merged 1 commit into from
Jun 13, 2016

Conversation

tomluchowski
Copy link
Member

As in title , now the code due to boost::geometry::convex_hull can cull both camera views at once .

@hwoarangmy
Copy link
Contributor

hwoarangmy commented Jun 6, 2016

@tomluchowski Could you please merge the commits so that there is only 1 functionality per commit ?
As I already said, splitting into several commits is a good habit but each commit should represent one functionality. For example, you could have one for culling in the main map and one in the minimap.
Then, if there are code changes requested, you can add commits to adapt (to avoid too much editing).

But with PRs like this one, history of the files will become a mess in only a few days and reading code to understand better what's going on when looking for some regression becomes not possible.
I will review the code when the commits are merged. In the meanwhile, I will test to see how it behaves.

@tomluchowski tomluchowski force-pushed the development branch 2 times, most recently from 527fa61 to 9e34cd9 Compare June 7, 2016 10:31
@tomluchowski
Copy link
Member Author

: naah by choice I appended to the akien's mga " Add changelog for 0.7.0"
Hopefully it's not a great blunder.

@hwoarangmy
Copy link
Contributor

"Add changelog for 0.7.0" is not the best name I could think about for such a commit. Please rename it so the history is not broken. Keep in mind that if we look for file history, commits must be a minimum meaningfull. And in this case, it is missleading as I wouldn't expect such a commit to be culling code.

@hwoarangmy
Copy link
Contributor

It seems also like your PR do not compile

@akien-mga
Copy link
Member

Also I appear as author, and it contains my whole changelog additions, which are already in the development branch.

I would do:

git format-patch -1  // keep the 0001-*.patch file around
git remote add upstream https://github.com/OpenDungeons/OpenDungeons
git fetch upstream
git reset --hard upstream/development
// edit the patch to remove the part about RELEASE-NOTES.md
git apply 0001-*.patch  // reapply the patch, without committing, solve the conflict with RELEASE-NOTES.md
git status  // check that the changes are fine
git commit -a "Good name for a commit about culling"

@tomluchowski
Copy link
Member Author

Well just look why travis is broken , it cannot upgrade it's repos :
The command "sudo apt-get update -qq; sudo apt-get install -y libcegui-0.8-dev" failed and exited with 100 during .

I will fix my commit to meaningful name when I am back home.

@hwoarangmy
Copy link
Contributor

yes but appveyor complains at least of constexpr. Since we also support MSVS2013 and MinGW compilers, we must not use not supported c++11 features.

And since you are going to redo your commit, also note that you have uploaded a file EntityBase.cpp and .h that are not in use anymore.

@tomluchowski
Copy link
Member Author

BTW : Could you and akien-mga relate to the issues I posted on our forum ?

@tomluchowski
Copy link
Member Author

ok , hopefully I am done .

@@ -271,6 +271,9 @@ set(OD_SOURCEFILES

${SRC}/camera/CameraManager.cpp
${SRC}/camera/HermiteCatmullSpline.cpp
${SRC}/camera/CullingManager.cpp
${SRC}/camera/DummyArrayClass.cpp
Copy link
Member

Choose a reason for hiding this comment

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

This file does not exist, so the build fails:

CMake Error at CMakeLists.txt:652 (add_executable):
  Cannot find source file:
    /home/travis/build/OpenDungeons/OpenDungeons/source/camera/DummyArrayClass.cpp
  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx

@tomluchowski tomluchowski force-pushed the development branch 2 times, most recently from 9e99e62 to 7d5c1f8 Compare June 9, 2016 12:01
@@ -62,7 +66,7 @@ class CameraManager
fullStop
};

CameraManager(Ogre::SceneManager* sceneManager, TileContainer* gameMap, Ogre::RenderWindow* renderWindow);
CameraManager(Ogre::SceneManager* sceneManager, GameMap* gameMap, Ogre::RenderWindow* renderWindow);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you change TileContainer to GameMap ? TileContainer is not a very useful abstract level since it is almost not used but why did you change ?

Copy link
Member Author

Choose a reason for hiding this comment

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

That was a choice it seems./

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, then it is a random change. Hopefully, GameMap is compatible with TileContainer. Seems like luck is on our side...

rightVerticesIndex++;
mRightSlopeIndex++;
return rightVerticesIndex == rightVertices.end();

Copy link
Contributor

Choose a reason for hiding this comment

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

empty line

@hwoarangmy
Copy link
Contributor

I've not signaled all the random empty lines because there were too many. Please at least remove when there are too many or when they hurt readability (like in a constructor init list).

@hwoarangmy
Copy link
Contributor

I've had a quick look and seen that
SlopeWalk::mLeftVertexPassed
SlopeWalk::mRightVertexPassed

are set but not used. Is it some forgotten test variables ?

@tomluchowski
Copy link
Member Author

tomluchowski commented Jun 12, 2016

@hwoarangmy : They are used in bool SlopeWalk::notifyOnMoveDown(int64_t newyIndex)
EDIT : but not too much . :P

@tomluchowski tomluchowski force-pushed the development branch 2 times, most recently from cb853c6 to a7e687f Compare June 12, 2016 21:14

// index numbers in myArray of Vertices
// belonging to the right path
std::deque<int32_t> rightVertices;
Copy link
Contributor

Choose a reason for hiding this comment

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

you really don't want to follow code guidelines...

Copy link
Member Author

Choose a reason for hiding this comment

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

What have I missed in code guidelines that I fail to implement in here ?

Copy link
Contributor

Choose a reason for hiding this comment

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

class member variables names must start with m. That is, you should rename this variable to mRightVertices.

@hwoarangmy
Copy link
Contributor

hwoarangmy commented Jun 13, 2016

@tomluchowski It can be done later but do you think it would be hard to split the CullingManager so that we can use one instance for the main screen and another for the minimap ?
That would decrease coupling between the CullingManager and the rest of the classes.

@tomluchowski
Copy link
Member Author

That would be increadibly hard if not impossible. The whole algorithm needs to compute the convex_hull of ALL points exactly ONCE.

@tomluchowski
Copy link
Member Author

Could you also answer my post on the forum ?

mVertices.mMyArray.clear();

boost::geometry::convex_hull(polygon, hull);
boost::geometry::for_each_point(boost::geometry::exterior_ring(hull), [this](Point &p){this->mVertices.mMyArray.push_back(p);});
Copy link
Contributor

Choose a reason for hiding this comment

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

For the next time, please split this into several lines to make clear there is a function here. Not blocking

@hwoarangmy
Copy link
Contributor

hwoarangmy commented Jun 13, 2016

I would have prefered to merge that after the release but at our current pace, that may be long. I have a PR almost done for allowing to change the minimap (switching from the old and the camera one) and if it gets merged before yours, you will have to make sure it works. I guess you would curse me for many generations if that was to happen ^^

Sorry for all the requested changes but the code looks much better now and is mergeable as for me

Could you also answer my post on the forum ?

Which one ?

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.

None yet

3 participants