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

Get rid of Ancestor bodies for constraint calculations #178

Open
5 tasks
sherm1 opened this issue Jun 27, 2014 · 0 comments
Open
5 tasks

Get rid of Ancestor bodies for constraint calculations #178

sherm1 opened this issue Jun 27, 2014 · 0 comments
Assignees

Comments

@sherm1
Copy link
Member

sherm1 commented Jun 27, 2014

Constraints act on a subset of bodies. Tracing each of those bodies through its parent along the path towards Ground (G), the first body that is present on all the paths is called the "Ancestor" (A) body for that constraint. A might turn out to be G, but often it is another body.

Currently all constraint calculations are done relative to A. The idea was to minimize roundoff error for small topological loops that are far from G in the tree. When A!=G, this requires computing new Transforms for A and each of the constrained bodies. That is an expensive operation (I've profiled it) and I now think it was not necessary. The code would be simpler and faster if the calculations were simply performed in G.

So the tasks here are

  • Make Ground the ancestor for all constraints for purposes of calculation.
  • Eliminate all the dead code associated with A!=G, including the specialized methods in ConstraintImpl and the cache entries holding the A-relative computations.
  • Continue to determine A for each constraint for purposes of sparse calculations; none of the mobilities between G and A can affect the constraint errors.
  • Verify speedup.
  • Test carefully.

This should not require any changes to the Constraint implementations. Although those are written relative to A, they don't know which body that is and should work fine if A==G.

@sherm1 sherm1 self-assigned this Jul 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant