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

[Cleanup] truckCollision / PointColDetector #496

Merged
merged 7 commits into from Dec 30, 2015

Conversation

Projects
None yet
3 participants
@ulteq
Contributor

ulteq commented Dec 22, 2015

Beam.cpp:

  • Removed redundant intraPointCD objects
  • Combined the Prepare, Compute and Final methods

Positive side effect: The interPointCD->update() method is now executed in the thread pool

PointColDetector:

  • Simplified the bounding box calculation
  • Removed redundant bounding box intersection checks

ulteq added some commits Dec 21, 2015

[Cleanup] truckCollision code cleanup
* Removed redundant intraPointCD objects

* Combined the Prepare, Compute and Final methods

Positive side effect: The interPointCD->update() method is now executed in the thread pool
[Codechange] Simplified the bounding box calculation
~12 % more fps on the container test map
@Hiradur

This comment has been minimized.

Show comment
Hide comment
@Hiradur

Hiradur Dec 24, 2015

IMO the variable name truckList is not expressive enough, if I understood it correctly it's a vector of trucks where the BB intersects with the BB of the current truck, is that right?

IMO the variable name truckList is not expressive enough, if I understood it correctly it's a vector of trucks where the BB intersects with the BB of the current truck, is that right?

This comment has been minimized.

Show comment
Hide comment
@only-a-ptr

only-a-ptr Dec 29, 2015

Variable truckList:
It's not expressive enough, it doesn't match our coding guidelines (should be collidable_trucks) and most importantly, it's sparse for no reason - trucks are inserted truckList[t] = @ and traversed if (truckList[t]) continue instead of truckList.push_back(@) and smooth traversal. Even if trucknum was needed somewhere, it can still be obtained from rig_t::trucknum

only-a-ptr replied Dec 29, 2015

Variable truckList:
It's not expressive enough, it doesn't match our coding guidelines (should be collidable_trucks) and most importantly, it's sparse for no reason - trucks are inserted truckList[t] = @ and traversed if (truckList[t]) continue instead of truckList.push_back(@) and smooth traversal. Even if trucknum was needed somewhere, it can still be obtained from rig_t::trucknum

ulteq added some commits Dec 26, 2015

[Cleanup] Removed duplicate code
* Added a new private member (m_trucks) which stores all collision relevant trucks

* Resolved a rarely occuring bug where the kdtree would not update properly
@ulteq

This comment has been minimized.

Show comment
Hide comment
@ulteq

ulteq Dec 30, 2015

Contributor

it's sparse for no reason

It's sparse for easy detection of new (colliding) trucks:
https://github.com/ulteq/rigs-of-rods/blob/pointColBBox/source/main/physics/collision/PointColDetector.cpp#L74

Contributor

ulteq commented Dec 30, 2015

it's sparse for no reason

It's sparse for easy detection of new (colliding) trucks:
https://github.com/ulteq/rigs-of-rods/blob/pointColBBox/source/main/physics/collision/PointColDetector.cpp#L74

@only-a-ptr

This comment has been minimized.

Show comment
Hide comment
@only-a-ptr

only-a-ptr Dec 30, 2015

Member

@ulteq OK then.

Member

only-a-ptr commented Dec 30, 2015

@ulteq OK then.

only-a-ptr added a commit that referenced this pull request Dec 30, 2015

Merge pull request #496 from ulteq/pointColBBox
[Cleanup] truckCollision / PointColDetector

@only-a-ptr only-a-ptr merged commit b7b9810 into RigsOfRods:master Dec 30, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ulteq ulteq deleted the ulteq:pointColBBox branch Dec 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment