Schroedingers-Hat/jsphys — Issue #125: Rewrite extendedobject
Author: Schroedingers-Hat
Created: 2011-12-16 20:05:11+00:00
State: open

Most of the early code I wrote for this is garbage.
Putting a plan here for rewriting extendedObject

1)
Take everything I can and put it into generic helper functions.
- Start by writing a project-to-camera function so that most of the 3d stuff can be treated the same (ie.project(blah) vs blah).
- Turn is/wasInteresting, drawNow, drawPast into separate functions. They shouldn't need to know much about the object.
- sections of calcpastPoints can be moved out and made more generic.

2)
Flatten what remains and pass by argument as much as possible.
- This should fix some performance bottlenecks (namely calcPastPoints). If this is fixed, and the shader works as well as it seems to, then 2k polygons visible in a scene is reasonable on low end hardware.

3)
Replace the (now external) drawing functions with ones based on solids at will. If done correctly, wireframe will remain an option where it is appropriate.

4)
Integrate arbitrarypaths into the refactored code somehow.
- Hyperbolic motion is done, just getting it to report everything (like V) correctly, and perhaps adding nodes for multi-part travel. (ladder paradox?)