Commit Graph

52 Commits (dd08e1fba6e154002a7fe8f46c8c01e6e61d39db)

Author SHA1 Message Date
Robert Adams c44a8e9f92 BulletSim: finish the post step event for physical object actions. Modify vehicle to use post step event for logging. 2013-01-27 12:50:04 -08:00
Robert Adams 471c477863 BulletSim: allow changing position and rotation of a child of a linkset
without rebuilding the whole compound shape. Should make vehicles move
smoother.
2013-01-21 15:58:22 -08:00
Robert Adams c6b6c94ccb BulletSim: reduce jitter in avatar velocity when walking or flying.
OpenSimulator is VERY sensitive to changes in avatar velocity and
will send an avatar update message when velocity changes more than
0.001m/s. This significantly reduces the number of avatar update messages by
smoothing the avatar velocity returned by Bullet.
2013-01-18 11:39:24 -08:00
Robert Adams 75f710f1e7 BulletSim: Add one function that all actors who act on the physical
can use to know if the object is currently active.
Code cleaning including use of Util.ClampV function.
2013-01-17 14:47:35 -08:00
Robert Adams 4e1ca890c2 BulletSim: fix not moving physical objects below terrain to over terrain.
Add locking on register prestep action list preventing potential race conditions.
Little comment and formatting changes.
2013-01-14 15:46:46 -08:00
Robert Adams 459fcd81c9 BulletSim: move center of gravity of linkset to its geometric center.
Necessitated allowing simulator and physical position of a body to
get out of sync since Bullet assumes that <0,0,0> is the center of mass.
Update DLLs and SOs for the UpdateChildTransform so positions of
  individual prim in a linkset can be implemented.
2013-01-11 16:47:53 -08:00
Robert Adams 93adc4cb66 BulletSim: Add IsSelected attribute to physical objects. Have vehicles check to see if physical before trying to step. Replace vehicle gravity application. Previously relying on Bullet to apply gravity but since vehicles over-ride the velocity calculation, gravity never had a chance to accelerate the body down. Added AddForceImpulse as well as AddForce for those who need to apply immediate velocity updates. Use the impulse to apply the linear motion. 2013-01-11 16:47:20 -08:00
Robert Adams 8452c0a870 BulletSim: add function to push avatar up when hitting stairs.
It looks like BulletSim and ODE rely on penetration correction to cause
the avatar to move up and thus allowing walking up stairs. Object
penetration was minimized for walking and flying (so one doesn't go
through walls) and this stopped stairs from working. This commit
introduces avatar movement code to check for collisions at the
feet while walking and attempts to raise the avatar for the steps.
Not yet perfect but movement is better.
2013-01-07 16:05:02 -08:00
Robert Adams 92a6958b6d BulletSim: fix problem where pre-step actions would not replaced
by new registrations thus causing multiple instances of an action.
2013-01-04 17:06:49 -08:00
Robert Adams 9218748321 BulletSim: another round of conversion: dynamics world and collision object functions. 2012-12-31 19:57:22 -08:00
Robert Adams 203588e3c0 BulletSim: change physical data structures to classes. Add default
instantiations for PhysBody and PhysShape when BSPhysObject is created
to account for them being classes and not structures.
Update TODO list.
2012-12-31 19:57:21 -08:00
Robert Adams 7a5f598399 BulletSim: move logic for IsColliding, CollidingGround and CollidingObj from individual sub-classes and up to parent BSPhysObject class. 2012-12-27 22:12:27 -08:00
Robert Adams 80cee1b85a BulletSim: Fix single physical prim reporting its mass as zero.
Properly return root mass as mass of just the root prim rather
than the mass of the linkset. SOG has the logic to add the masses
together to get the linkset mass.
Update TODO list.
2012-12-24 08:56:02 -08:00
Robert Adams 30807b81cc BulletSim: modify avatar motor code to make falling movement better. Clean up some usages. Disable motor when done. 2012-12-22 17:09:40 -08:00
Robert Adams 37fb691ba5 BulletSim: Fix llApplyImpulse so it works after the first impulse. The problem was Bullet deactivating the object between the pushes (when, as far as the physics engine is concerned, it isn't moving). 2012-12-21 23:03:27 -08:00
Robert Adams 3d659fe97d BulletSim: add BSPhysObject code to manage registrations of preStep events. Use same to implement setForce and setTorque so the values are restored at the beginning of each step (since Bullet zeros forces applied last step). Simplify implementation of AddForce and AddTorque by relying on the addition of forces in Bullet. 2012-12-21 17:27:53 -08:00
Robert Adams 2b8efa24dd BulletSim: add parameter to UpdateProperties call into the linkset so changes from the physics engine can be differentiated from changes made by the user. This eliminates a linkset rebuild loop. Also add logic to not rebuild or freak out when the object/linkset crosses a terrain boundry. 2012-12-16 21:19:13 -08:00
Robert Adams e1814aa827 BulletSim: fix problem of avatar's floating off the ground after unsitting. Reworked size/scale logic so physical scale is kept in Bullet and physObject scale is the preferred size -- usually same as size but avatars are computed differently. 2012-12-12 16:51:43 -08:00
Robert Adams bb6eeb5429 BulletSim: do not return the current velocity for targetVelocity. 2012-12-12 11:01:36 -08:00
Robert Adams 9df85eadf4 BulletSim: Fix crash on the destruction of physical linksets.
While fixing the above, add methods to physical body and shape pointer
wrapper so routines won't have to know that IntPtr.Zero means no
physical instance.
Fix problem with physical linksets failing after a few sits and
unsits by properly restoring child prom positions for compound
linksets after multiple selection and deselections.
2012-12-10 15:35:53 -08:00
Robert Adams ce5083a504 BulletSim: adjust friction and restitution based on material type. 2012-12-09 22:32:46 -08:00
Melanie 3b2caa63b0 Rename BulletSim's PhysicsShapeType to BSPhysicsShapeType because it
conflicts with PhysicsShape type defined in later libOMV
2012-11-22 14:45:41 +00:00
Robert Adams d6db0d5740 BulletSim: uplevel PhysicsShapeType out of ShapeData structure (since it is getting simplified out of existance someday) and update all the references to that enum. 2012-11-21 16:42:50 -08:00
Robert Adams 6c961d8add BulletSim: Use base class constructors for initialization of BSShape and other classes. 2012-11-18 22:58:36 -08:00
Robert Adams 76cc303031 BulletSim: Add ZeroAngularMotion method to physical objects. Add inTaint flag to ZeroMotion method. Update the references to those functions. 2012-11-06 18:16:35 -08:00
Robert Adams b0eccd5044 BulletSim: debugging of compound shape implementation of linksets.
Add compound shape creation and freeing in shape manager.
Add optional taint-time execution method and update code to use it.
Add API2 linkage for more compound shape methods (get num, get/remove by index, ...)
Modify perferred shape return so linkset children can have differet shapes than root.
Add Position and Orientation calls to linksets so children can be moved around by
    the linkset by its own calculation. Allows for very general linkset implementations.
2012-11-03 21:15:30 -07:00
Robert Adams f53b4e7a21 BulletSim: Add RawPosition and RawOrientation to BSPhysObject and rename MassRaw to RawMass. Fix BSShapeCollection to use Raw* for creating the body to eliminate exception from referencing the physical body before it has been created. 2012-11-03 21:15:22 -07:00
Robert Adams 39c02dcc8c BulletSim: Remove use of shapeData in ShapeCollection and rely on the available BSPhysObject varaiables. Fix line endings in BSLinksetCompound. 2012-11-03 21:15:14 -07:00
Robert Adams 364a7c3088 BulletSim: rename BSBody and BSShape to PhysBody and PhysShape. Add skeleton of BSLinksetCompound. 2012-11-03 21:15:06 -07:00
Robert Adams e20bad12cc BulletSim: centralize mass/inertia computation with UpdatePhysicalMassProperties() function. Didn't add setMassRaw because assignment with side effect is dirty. 2012-11-03 21:13:35 -07:00
Robert Adams 65c131c4a3 BulletSim: remove trailing spaces to make git happy. 2012-10-22 22:24:44 -07:00
Robert Adams a61f20ac74 BulletSim: Create LinkSet abstract class and sparate constraint based linksets into own subclass. Will eventually add manual movement linkset subclass. 2012-10-22 22:24:30 -07:00
Robert Adams d94c4646cc BulletSim: add asset fetching so BulletSim works with new physics asset handling.
Refactor some names to make them available for the asset tracking and fetching.
2012-10-19 15:43:31 -07:00
Robert Adams f422b9b388 BulletSim: reorder avatar collision checking to eliminate double collision_end.
Various tweekings to avatar shape/mass/inertia/etc.
Remove change from avatar radius to diameter. But still the avatar sinks.
Collision_end now happens immediately rather than at the next subscription time.
2012-10-19 10:52:31 -07:00
Robert Adams e87a179c89 BulletSim: change nonimal physics frame rate to 55 to give same numbers as ODE.
Change character scaling to represent size of capsule (diameter rather than radius)
Modify create capsule call to pass radius and height.
Eliminate errors when calculating shape inertia (should have some type checking).
2012-10-19 10:52:23 -07:00
Robert Adams fd7a097849 BulletSim: Update BSCharacter to use API2 interface.
Add capsule shape to BSShapeCollection().
Remember last updated values so inter frame diffs can be computed.
Parameterize avatarStandingFriction and reduce to 10 from 999.
    The latter high value made avatars very hard to push.
Set CCD parameters for prims and characters of specified.
2012-10-19 10:51:58 -07:00
Robert Adams 68698975f1 BulletSim: Add Force* operations to objects to allow direct push to engine.
Update BSDynamics to use same (don't want to delay updates til next taint-time.
Suppress queuing a taint update for position and orientation calls if value
    does not change.
Move Bullet timing statistics call from C# back to C++ code.
Throttle taints per simulation step and add parameter to set.
By default, don't create hulls for physical objects. Add a
    parameter to turn on and off.
2012-10-11 14:01:07 -07:00
Robert Adams 87825b0abe BulletSim: Fix crash when linking large physical linksets.
Properly remove and restore linkage constraints when upgrading
    a prim's mesh to a hull.
Lots more debug logging.
Definitions and use of Bullet structure dumping.
Centralize detail logging so a Flush() can be added for debugging.
2012-10-11 14:01:03 -07:00
Robert Adams ce47d0c454 BulletSim: Add ForcePosition and ForceOrientation to BSPhysObject and to its children of BSPrim and BSCharacter. 2012-10-02 11:14:09 -07:00
Robert Adams 7b65985047 BulletSim: remove the trailing spaces from lines to make git happier 2012-09-27 22:02:03 -07:00
Robert Adams f82b903dee BulletSim: Fix linkset crash. Caused by the different body and shape
pointers at runtime and at taint-time. Now passes the body into the
    taint.
Vehicles zero inertia when active to eliminate Bullet's contribution
    to vehicle motion.
2012-09-27 22:01:52 -07:00
Robert Adams 4589bc84a3 BulletSim: Terrain sets proper collision flags on creation.
Static objects are set to ISLAND_SLEEPING rather than DISABLE_SIMULATION.
    Might reconsider this and, alternatively, have dynamic objects force activation.
Clean up use of DetailLog().
2012-09-27 22:01:47 -07:00
Robert Adams 735d89e369 BulletSim: btGhostObjects working to make 'volume detect' work.
Rearrangement and cleanup of shape collection code. Much more readable.
Enabling and use of collision filters and masks.
Addition of ID to body creation BulletSimAPI calls so always set in
    shape for collision reporting.
Change default of ShouldSplitSimulationIslands and ShouldRandomizeSolverOrder
    from 'false' to 'true'. When 'false', this suppresses NO_CONTACT_RESPONSE
    which makes volume detect fail.
2012-09-27 22:01:42 -07:00
Robert Adams d016051fa0 BulletSim: renamed members of BulletShape, BulletSim and BulletBody
so the members case is consistant. Caused modifications everywhere.
New logic in BSShapeCollection to track use and sharing of shapes.
    I just reslized, though, that shapes cannot be shared because the
    shape's UserPointer is the localID of the prim and is required
    for tracking collisions. More changes coming.
Added DuplicateCollisionShape2() to API and changed BuildNativeShape2
    to take a ShapeData structure so don't have to pass so many parameters.
    This matches the latest version of BulletSim.dll.
Additions and removal of DetailLog() statements for debugging.
2012-09-27 22:01:37 -07:00
Robert Adams 22290ef35a BulletSim: complete code for managed code shape and body tracking. Not debugged.
Eliminate some null exceptions created adding the above code.
Add and remove some detailed logging statements.
2012-09-27 22:01:26 -07:00
Robert Adams 91efccabdc BulletSim: Convert BSCharacter to use common BSPhysObject code and variables.
Fix avatar height calculation to properly account for the capsule ends.
Rearrange some locking in TerrainManager to eliminate possible race conditions.
Move DetailLog() definition into common BSPhysObject class.
Some variable renaming to make usage clearer (refactor.rename makes this so easy).
2012-09-27 22:01:16 -07:00
Robert Adams ee7cda261c BulletSim: move a bunch of common logic out of BSPrim and BSCharacter
and into the parent class BSPhysObject.
Rework collision logic to enable extra collision after done colliding.
Rename 'Scene' to 'PhysicsScene' to differentiate it from the simulator 'Scene'.
2012-09-27 22:01:11 -07:00
Robert Adams 6632eb7c05 BulletSim: Remove calculation and passing of unused collied object type.
Fix collision code to properly sense mega-region children regions as terrain.
When setting an object physical, reset all the physical properties (friction, ...).
2012-09-15 15:31:54 -07:00
Robert Adams 2c5ff93990 BulletSim: Way too many changes in one commit.
Many changes to BSDynamic for readability and commentary.
Linkset hacking for vehicles: don't over mass the root prim.
Add parameter for link constraint solver iterations.
Correct uses of timestep in timescale calculations for vehicles.
Reorganize code/logic for making objects static and dynamic for readability
    and use of API2.
Changed most calls in BSPrim to use API2 calls (the new way).
Avatars do not generate default Bullet collision events but do call up
    to the simulator for every avatar. Reduces overhead.
Objects added to collision list only if they are processing collisions.
    Reduces overhead especially for large numbers of avatars.
Generalize call for water height to GetWaterHeightAtXYZ().
Catch and correct exception getting terrain height when out of bounds.
Correct race condition in Terrain Manager where creation wasn't at taint-time.
Add API calls for constructing compound shapes.
Move NeedsMeshing() logic into object class.
Reorganize logic for object meshing to reduce rebuilding of meshs/hulls.
2012-09-15 15:31:29 -07:00
Robert Adams 126eae7100 BulletSim: Add Bullet body and shape to BSPhysObject and rename
'Body' to 'BSBody' for disambiguation when reading code.
Complete the API2 interface so nearly all methods on bullet
    classes are available to the managed code. The efficient
    single call simulation step is kept in place while all
    other creation/destruction/parameterization can be done
    in the managed code.
2012-09-07 16:05:28 -07:00