BulletSimTODO.txt 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. CURRENT PROBLEMS TO FIX AND/OR LOOK AT
  2. =================================================
  3. Script changing rotation of child prim while vehicle moving (eg turning wheel) causes
  4. the wheel to appear to jump back. Looks like sending position from previous update.
  5. Vehicle ride, get up, ride again. Second time vehicle does not act correctly.
  6. Have to rez new vehicle and delete the old to fix situation.
  7. Hitting RESET on Nebadon's vehicle while riding causes vehicle to get into odd
  8. position state where it will not settle onto ground properly, etc
  9. Two of Nebadon vehicles in a sim max the CPU. This is new.
  10. Enable vehicle border crossings (at least as poorly as ODE)
  11. Terrain skirts
  12. Avatar created in previous region and not new region when crossing border
  13. Vehicle recreated in new sim at small Z value (offset from root value?) (DONE)
  14. Deleting a linkset while standing on the root will leave the physical shape of the root behind.
  15. Not sure if it is because standing on it. Done with large prim linksets.
  16. Linkset child rotations.
  17. Nebadon spiral tube has middle sections which are rotated wrong.
  18. Select linked spiral tube. Delink and note where the middle section ends up.
  19. Refarb compound linkset creation to create a pseudo-root for center-of-mass
  20. Let children change their shape to physical indendently and just add shapes to compound
  21. Vehicle angular vertical attraction
  22. vehicle angular banking
  23. Center-of-gravity
  24. Vehicle angular deflection
  25. Preferred orientation angular correction fix
  26. when should angular and linear motor targets be zeroed? when selected?
  27. Need a vehicle.clear()? Or an 'else' in prestep if not physical.
  28. Teravus llMoveToTarget script debug
  29. Mixing of hover, buoyancy/gravity, moveToTarget, into one force
  30. Setting hover height to zero disables hover even if hover flags are on (from SL wiki)
  31. limitMotorUp calibration (more down?)
  32. llRotLookAt
  33. llLookAt
  34. Avatars walking up stairs (HALF DONE)
  35. Avatar movement
  36. flying into a wall doesn't stop avatar who keeps appearing to move through the obstacle (DONE)
  37. walking up stairs is not calibrated correctly (stairs out of Kepler cabin) (DONE)
  38. avatar capsule rotation completed (NOT DONE - Bullet's capsule shape is not the solution)
  39. Vehicle script tuning/debugging
  40. Avanti speed script
  41. Weapon shooter script
  42. Move material definitions (friction, ...) into simulator.
  43. Add material densities to the material types.
  44. One sided meshes? Should terrain be built into a closed shape?
  45. When meshes get partially wedged into the terrain, they cannot push themselves out.
  46. It is possible that Bullet processes collisions whether entering or leaving a mesh.
  47. Ref: http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=4869
  48. VEHICLES TODO LIST:
  49. =================================================
  50. LINEAR_MOTOR_DIRECTION values should be clamped to reasonable numbers.
  51. What are the limits in SL?
  52. Same for other velocity settings.
  53. UBit improvements to remove rubber-banding of avatars sitting on vehicle child prims:
  54. https://github.com/UbitUmarov/Ubit-opensim
  55. Border crossing with linked vehicle causes crash
  56. 20121129.1411: editting/moving phys object across region boundries causes crash
  57. getPos-> btRigidBody::upcast -> getBodyType -> BOOM
  58. Vehicles (Move smoothly)
  59. Some vehicles should not be able to turn if no speed or off ground.
  60. What to do if vehicle and prim buoyancy differ?
  61. Cannot edit/move a vehicle being ridden: it jumps back to the origional position.
  62. Neb car jiggling left and right
  63. Happens on terrain and any other mesh object. Flat cubes are much smoother.
  64. This has been reduced but not eliminated.
  65. Implement referenceFrame for all the motion routines.
  66. For limitMotorUp, use raycast down to find if vehicle is in the air.
  67. Verify llGetVel() is returning a smooth and good value for vehicle movement.
  68. llGetVel() should return the root's velocity if requested in a child prim.
  69. Implement function efficiency for lineaar and angular motion.
  70. After getting off a vehicle, the root prim is phantom (can be walked through)
  71. Need to force a position update for the root prim after compound shape destruction
  72. Linkset explosion after three "rides" on Nebadon lite vehicle (LinksetConstraint)
  73. Remove vehicle angular velocity zeroing in BSPrim.UpdateProperties().
  74. A kludge that isn't fixing the real problem of Bullet adding extra motion.
  75. Incorporate inter-relationship of angular corrections. For instance, angularDeflection
  76. and angularMotorUp will compute same X or Y correction. When added together
  77. creates over-correction and over-shoot and wabbling.
  78. Vehicle attributes are not restored when a vehicle is rezzed on region creation
  79. Create vehicle, setup vehicle properties, restart region, vehicle is not reinitialized.
  80. GENERAL TODO LIST:
  81. =================================================
  82. Explore btGImpactMeshShape as alternative to convex hulls for simplified physical objects.
  83. Regular triangle meshes don't do physical collisions.
  84. Resitution of a prim works on another prim but not on terrain.
  85. The dropped prim doesn't bounce properly on the terrain.
  86. Add a sanity check for PIDTarget location.
  87. Level-of-detail for mesh creation. Prims with circular interiors require lod of 32.
  88. Is much saved with lower LODs? At the moment, all set to 32.
  89. Collisions are inconsistant: arrows are supposed to hit and report collision. Often don't.
  90. If arrow show at prim, collision reported about 1/3 of time. If collision reported,
  91. both arrow and prim report it. The arrow bounces off the prim 9 out of 10 times.
  92. Shooting 5m sphere "arrows" at 60m/s.
  93. llMoveToTarget objects are not effected by gravity until target is removed.
  94. Compute CCD parameters based on body size
  95. Can solver iterations be changed per body/shape? Can be for constraints but what
  96. about regular vehicles?
  97. Implement llSetPhysicalMaterial.
  98. extend it with Center-of-mass, rolling friction, density
  99. Implement llSetForceAndTorque.
  100. Change BSPrim.moveToTarget to used forces rather than changing position
  101. Changing position allows one to move through walls
  102. Implement an avatar mesh shape. The Bullet capsule is way too limited.
  103. Consider just hand creating a vertex/index array in a new BSShapeAvatar.
  104. Verify/fix phantom, volume-detect objects do not fall to infinity. Should stop at terrain.
  105. Revisit CollisionMargin. Builders notice the 0.04 spacing between prims.
  106. Duplicating a physical prim causes old prim to jump away
  107. Dup a phys prim and the original become unselected and thus interacts w/ selected prim.
  108. Scenes with hundred of thousands of static objects take a lot of physics CPU time.
  109. BSPrim.Force should set a continious force on the prim. The force should be
  110. applied each tick. Some limits?
  111. Gun sending shooter flying.
  112. Collision margin (gap between physical objects lying on each other)
  113. Boundry checking (crashes related to crossing boundry)
  114. Add check for border edge position for avatars and objects.
  115. Verify the events are created for border crossings.
  116. Avatar rotation (check out changes to ScenePresence for physical rotation)
  117. Avatar running (what does phys engine need to do?)
  118. Small physical objects do not interact correctly
  119. Create chain of .5x.5x.1 torui and make all but top physical so to hang.
  120. The chain will fall apart and pairs will dance around on ground
  121. Chains of 1x1x.2 will stay connected but will dance.
  122. Chains above 2x2x.4 are more stable and get stablier as torui get larger.
  123. Add PID motor for avatar movement (slow to stop, ...)
  124. setForce should set a constant force. Different than AddImpulse.
  125. Implement raycast.
  126. Implement ShapeCollection.Dispose()
  127. Implement water as a plain so raycasting and collisions can happen with same.
  128. Add collision penetration return
  129. Add field passed back by BulletSim.dll and fill with info in ManifoldConstact.GetDistance()
  130. Add osGetPhysicsEngineName() so scripters can tell whether BulletSim or ODE
  131. Also osGetPhysicsEngineVerion() maybe.
  132. Linkset.Position and Linkset.Orientation requre rewrite to properly return
  133. child position. LinksetConstraint acts like it's at taint time!!
  134. Implement LockAngularMotion -- implements llSetStatus(ROTATE_AXIS_*, T/F)
  135. Should the different PID factors have non-equal contributions for different
  136. values of Efficiency?
  137. Selecting and deselecting physical objects causes CPU processing time to jump
  138. http://www.youtube.com/watch?v=Hjg57fWg8yI&hd=1
  139. put thousand physical objects, select and deselect same. CPU time will be large.
  140. Re-implement buoyancy as a separate force on the object rather than diddling gravity.
  141. Register a pre-step event to add the force.
  142. More efficient memory usage when passing hull information from BSPrim to BulletSim
  143. Avatar movement motor check for zero or small movement. Somehow suppress small movements
  144. when avatar has stopped and is just standing. Simple test for near zero has
  145. the problem of preventing starting up (increase from zero) especially when falling.
  146. Physical and phantom will drop through the terrain
  147. LINKSETS
  148. ======================================================
  149. Child prims do not report collisions
  150. Allow children of a linkset to be phantom:
  151. http://opensim-dev.2196679.n2.nabble.com/Setting-a-single-child-prim-to-Phantom-tp7578513.html
  152. Add OS_STATUS_PHANTOM_PRIM to llSetLinkPrimitaveParamsFast.
  153. Editing a child of a linkset causes the child to go phantom
  154. Move a child prim once when it is physical and can never move it again without it going phantom
  155. Offset the center of the linkset to be the geometric center of all the prims
  156. Not quite the same as the center-of-gravity
  157. Linksets should allow collisions to individual children
  158. Add LocalID to children shapes in LinksetCompound and create events for individuals
  159. LinksetCompound: when one of the children changes orientation (like tires
  160. turning on a vehicle, the whole compound object is rebuilt. Optimize this
  161. so orientation/position of individual children can change without a rebuild.
  162. Verify/think through scripts in children of linksets. What do they reference
  163. and return when getting position, velocity, ...
  164. Confirm constraint linksets still work after making all the changes for compound linksets.
  165. Use PostTaint callback to do rebuilds for constraint linksets to reduce rebuilding
  166. Add 'changed' flag or similar to reduce the number of times a linkset is rebuilt.
  167. For compound linksets, add ability to remove or reposition individual child shapes.
  168. Speed up creation of large physical linksets
  169. For instance, sitting in Neb's car (130 prims) takes several seconds to become physical.
  170. REALLY bad for very large physical linksets (freezes the sim for many seconds).
  171. Eliminate collisions between objects in a linkset. (LinksetConstraint)
  172. Have UserPointer point to struct with localID and linksetID?
  173. Objects in original linkset still collide with each other?
  174. MORE
  175. ======================================================
  176. Compute avatar size and scale correctly. Now it is a bit off from the capsule size.
  177. Create tests for different interface components
  178. Have test objects/scripts measure themselves and turn color if correct/bad
  179. Test functions in SL and calibrate correctness there
  180. Create auto rezzer and tracker to run through the tests
  181. Do we need to do convex hulls all the time? Can complex meshes be left meshes?
  182. There is some problem with meshes and collisions
  183. Hulls are not as detailed as meshes. Hulled vehicles insides are different shape.
  184. Debounce avatar contact so legs don't keep folding up when standing.
  185. Implement LSL physics controls. Like STATUS_ROTATE_X.
  186. Add border extensions to terrain to help region crossings and objects leaving region.
  187. Use a different capsule shape for avatar when sitting
  188. LL uses a pyrimidal shape scaled by the avatar's bounding box
  189. http://wiki.secondlife.com/wiki/File:Avmeshforms.png
  190. Performance test with lots of avatars. Can BulletSim support a thousand?
  191. Optimize collisions in C++: only send up to the object subscribed to collisions.
  192. Use collision subscription and remove the collsion(A,B) and collision(B,A)
  193. Check whether SimMotionState needs large if statement (see TODO).
  194. Implement 'top colliders' info.
  195. Avatar jump
  196. Performance measurement and changes to make quicker.
  197. Implement detailed physics stats (GetStats()).
  198. Measure performance improvement from hulls
  199. Test not using ghost objects for volume detect implementation.
  200. Performance of closures and delegates for taint processing
  201. Are there faster ways?
  202. Is any slowdown introduced by the existing implementation significant?
  203. Is there are more efficient method of implementing pre and post step actions?
  204. See http://www.codeproject.com/Articles/29922/Weak-Events-in-C
  205. Physics Arena central pyramid: why is one side permiable?
  206. In SL, perfect spheres don't seem to have rolling friction. Add special case.
  207. Enforce physical parameter min/max:
  208. Gravity: [-1, 28]
  209. Friction: [0, 255]
  210. Density: [1, 22587]
  211. Restitution [0, 1]
  212. http://wiki.secondlife.com/wiki/Physics_Material_Settings_test
  213. Avatar attachments have no mass? http://forums-archive.secondlife.com/54/f0/31796/1.html
  214. Keep avatar scaling correct. http://pennycow.blogspot.fr/2011/07/matter-of-scale.html
  215. INTERNAL IMPROVEMENT/CLEANUP
  216. =================================================
  217. Can the 'inTaintTime' flag be cleaned up and used? For instance, a call to
  218. BSScene.TaintedObject() could immediately execute the callback if already in taint time.
  219. Create the physical wrapper classes (BulletBody, BulletShape) by methods on
  220. BSAPITemplate and make their actual implementation Bullet engine specific.
  221. For the short term, just call the existing functions in ShapeCollection.
  222. Consider moving prim/character body and shape destruction in destroy()
  223. to postTimeTime rather than protecting all the potential sets that
  224. might have been queued up.
  225. Remove unused fields from ShapeData (not used in API2)
  226. Remove unused fields from pinned memory shared parameter block
  227. Create parameter variables in BSScene to replace same.
  228. Breakout code for mesh/hull/compound/native into separate BSShape* classes
  229. Standardize access to building and reference code.
  230. The skeleton classes are in the sources but are not complete or linked in.
  231. Make BSBody and BSShape real classes to centralize creation/changin/destruction
  232. Convert state and parameter calls from BulletSimAPI direct calls to
  233. calls on BSBody and BSShape
  234. Generalize Dynamics and PID with standardized motors.
  235. Generalize Linkset and vehicles into PropertyManagers
  236. Methods for Refresh, RemoveBodyDependencies, RestoreBodyDependencies
  237. Potentially add events for shape destruction, etc.
  238. Better mechanism for resetting linkset set and vehicle parameters when body rebuilt.
  239. BSPrim.CreateGeomAndObject is kludgy with the callbacks, etc.
  240. Implement linkset by setting position of children when root updated. (LinksetManual)
  241. Linkset implementation using manual prim movement.
  242. LinkablePrim class? Would that simplify/centralize the linkset logic?
  243. BSScene.UpdateParameterSet() is broken. How to set params on objects?
  244. Add floating motor for BS_FLOATS_ON_WATER so prim and avatar will
  245. bob at the water level. BSPrim.PositionSanityCheck()
  246. Should taints check for existance or activeness of target?
  247. When destroying linksets/etc, taints can be generated for objects that are
  248. actually gone when the taint happens. Crashes don't happen because the taint closure
  249. keeps the object from being freed, but that is just an accident.
  250. Possibly have an 'active' flag that is checked by the taint processor?
  251. Parameters for physics logging should be moved from BSScene to BSParam (at least boolean ones)
  252. Can some of the physical wrapper classes (BulletBody, BulletWorld, BulletShape) be 'sealed'?
  253. There are TOO MANY interfaces from BulletSim core to Bullet itself
  254. Think of something to eliminate one or more of the layers
  255. THREADING
  256. =================================================
  257. Do taint action immediately if not actually executing Bullet.
  258. Add lock around Bullet execution and just do taint actions if simulation is not happening.
  259. DONE DONE DONE DONE
  260. =================================================
  261. Cleanup code in BSDynamics by using motors. (Resolution: started)
  262. Consider implementing terrain with a mesh rather than heightmap. (Resolution: done)
  263. Would have better and adjustable resolution.
  264. Build terrain mesh so heighmap is height of the center of the square meter.
  265. Resolution: NOT DONE: SL and ODE define meter square as being at one corner with one diagional.
  266. Terrain as mesh. (Resolution: done)
  267. How are static linksets seen by the physics engine?
  268. Resolution: they are not linked in physics. When moved, all the children are repositioned.
  269. Convert BSCharacter to use all API2 (Resolution: done)
  270. Avatar pushing difficult (too heavy?)
  271. Use asset service passed to BulletSim to get sculptie bodies, etc. (Resolution: done)
  272. Remove old code in DLL (all non-API2 stuff). (Resolution: done)
  273. Measurements of mega-physical prim performance (with graph) (Resolution: done, email)
  274. Debug Bullet internal stats output (why is timing all wrong?)
  275. Resolution: Bullet stats logging only works with a single instance of Bullet (one region).
  276. Implement meshes or just verify that they work. (Resolution: they do!)
  277. Do prim hash codes work for sculpties and meshes? (Resolution: yes)
  278. Linkset implementation using compound shapes. (Resolution: implemented LinksetCompound)
  279. Compound shapes will need the LocalID in the shapes and collision
  280. processing to get it from there.
  281. Light cycle not banking (Resolution: It doesn't. Banking is roll adding yaw.)
  282. Package Bullet source mods for Bullet internal stats output
  283. (Resolution: move code into WorldData.h rather than relying on patches)
  284. Single prim vehicles don't seem to properly vehiclize.
  285. (Resolution: mass was not getting set properly for single prim linksets)
  286. Add material type linkage and input all the material property definitions.
  287. Skeleton classes and table are in the sources but are not filled or used.
  288. (Resolution:
  289. Neb vehicle taking > 25ms of physics time!!
  290. (Resolution: compound linksets were being rebuild WAY too often)
  291. Avatar height off after unsitting (floats off ground)
  292. Editting appearance then moving restores.
  293. Must not be initializing height when recreating capsule after unsit.
  294. (Resolution: confusion of scale vs size for native objects removed)
  295. Light cycle falling over when driving (Resolution: implemented angularMotorUp)
  296. Should vehicle angular/linear movement friction happen after all the components
  297. or does it only apply to the basic movement?
  298. (Resolution: friction added before returning newly computed motor value.
  299. What is expected by some vehicles (turning up friction to moderate speed))
  300. Tune terrain/object friction to be closer to SL.
  301. (Resolution: added material type with friction and resolution)
  302. Smooth avatar movement with motor (DONE)
  303. Should motor update be all at taint-time? (Yes, DONE)
  304. Fix avatar slowly sliding when standing (zero motion when stopped) (DONE)
  305. (Resolution: added BSVMotor for avatar starting and stopping)
  306. llApplyImpulse()
  307. Compare mass/movement in OS and SL. Calibrate actions. (DONE)
  308. (Resolution: tested on SL and OS. AddForce scales the force for timestep)
  309. llSetBuoyancy() (DONE)
  310. (Resolution: Bullet resets object gravity when added to world. Moved set gravity)
  311. Avatar density is WAY off. Compare and calibrate with what's in SL. (DONE)
  312. (Resolution: set default density to 3.5 (from 60) which is closer to SL)
  313. Redo BulletSimAPI to allow native C# implementation of Bullet option (DONE)
  314. (Resolution: added BSAPITemplate and then interfaces for C++ Bullet and C# BulletXNA
  315. Meshes rendering as bounding boxes (DONE)
  316. (Resolution: Added test for mesh/sculpties in native shapes so it didn't think it was a box)
  317. llMoveToTarget (Resolution: added simple motor to update the position.)
  318. Angular motor direction is global coordinates rather than local coordinates (DONE)
  319. Add vehicle collisions so IsColliding is properly reported. (DONE)
  320. Needed for banking, limitMotorUp, movementLimiting, ...
  321. (Resolution: added CollisionFlags.BS_VEHICLE_COLLISION and code to use it)
  322. VehicleAddForce is not scaled by the simulation step but it is only
  323. applied for one step. Should it be scaled? (DONE)
  324. (Resolution: use force for timed things, Impulse for immediate, non-timed things)
  325. Complete implemention of preStepActions (DONE)
  326. Replace vehicle step call with prestep event.
  327. Is there a need for postStepActions? postStepTaints?
  328. Disable activity of passive linkset children. (DONE)
  329. Since the linkset is a compound object, the old prims are left lying
  330. around and need to be phantomized so they don't collide, ...
  331. Remove HeightmapInfo from terrain specification (DONE)
  332. Since C++ code does not need terrain height, this structure et al are not needed.
  333. Surfboard go wonky when turning (DONE)
  334. Angular motor direction is global coordinates rather than local coordinates?
  335. (Resolution: made angular motor direction correct coordinate system)
  336. Mantis 6040 script http://opensimulator.org/mantis/view.php?id=6040 (DONE)
  337. Msg Kayaker on OSGrid when working
  338. (Resolution: LINEAR_DIRECTION is in vehicle coords. Test script does the
  339. same in SL as in OS/BulletSim)
  340. Boats float low in the water (DONE)
  341. Boats floating at proper level (DONE)
  342. When is force introduced by SetForce removed? The prestep action could go forever. (DONE)
  343. (Resolution: setForce registers a prestep action which keeps applying the force)
  344. Child movement in linkset (don't rebuild linkset) (DONE 20130122))
  345. Avatar standing on a moving object should start to move with the object. (DONE 20130125)
  346. Angular motion around Z moves the vehicle in world Z and not vehicle Z in ODE.
  347. Verify that angular motion specified around Z moves in the vehicle coordinates.
  348. DONE 20130120: BulletSim properly applies force in vehicle relative coordinates.
  349. Nebadon vehicles turning funny in arena (DONE)
  350. Lock axis (DONE 20130401)
  351. Terrain detail: double terrain mesh detail (DONE)
  352. Use the HACD convex hull routine in Bullet rather than the C# version.
  353. Speed up hullifying large meshes. (DONE)