Commit Graph

135 Commits (e506341fdb9f3b6996d3c97de007f2b142fcddd3)

Author SHA1 Message Date
Robert Adams db6c0363f0 BulletSim: tweeking avatar capsule code in an attempt to have
asymmetrical avatar capsule work now that rotation is being passed
from the simulator. Turns out the Bullet capsule is just not very
functional: it doesn't scale properly, the implementation only half
does asymmetry and, in general, is hard to work with.
Avatar shape is about what it was before these changes.
Added initial data structures for avatar shape mesh.
2012-12-29 08:03:57 -08:00
Robert Adams 7266eeca6e BulletSim: add 'AvatarAlwaysRunFactor' parameter and use in setTargetVelocity
to implement the 'always run' feature.
2012-12-28 12:01:57 -08:00
Robert Adams 70e0a86601 BulletSim: fix problem of avatars appearing to walk through walls
by moving the movement motor to a pre-step action and out of its
questionable previous home in UpdateProperties.
2012-12-28 11:56:07 -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 e98e223927 BulletSim: complete applyImpulse function in BSCharacter (like I said
I did last time).
2012-12-27 22:12:25 -08:00
Robert Adams 5f71ee57c4 BulletSim: stop avatar from sliding VERY slowly after walking by
only zeroing the movement motor in the UpdateProperties routine.
2012-12-25 23:54:10 -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 a54392d7cc BulletSim: remove the movement decay while flying. Made flying slow down over time. 2012-12-21 23:05:05 -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 ae4d932e7f BulletSim: Move all the parameter variables, tables and get and fetch logic to a separate, static class for easier addition and to remove all that bulk from the BSScene class. 2012-12-21 13:35:44 -08:00
Robert Adams 2e3e95e846 BulletSim: small fix to avatar movement motor use which keeps avatar from flying up forever. This doesn't fix the overall problem but keeps avatar flying from being totally unusable. 2012-12-21 10:04:12 -08:00
Robert Adams 8c99f63239 BulletSim: avatar movement smoothed with motor that modifies avatar velocity to target velocity. Fails in incorporating physical world effects (gravity) so avatar doesn't fly correctly. 2012-12-21 10:00:03 -08:00
Robert Adams 7ed860d3ac BulletSim: add check for border crossing in character position sanity check. 2012-12-16 21:19:12 -08:00
Robert Adams 3b2b785a46 BulletSim: Add 'BulletSimData' which separates structures created
for the operation of BulletSim and those defintiions/structures defined
so they can be used in the unmanaged world.
Consolidate setting of collision flags so implementation is not scattered.
2012-12-13 16:32:06 -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 d4e0e98c00 BulletSim: protect character property setting to remove crash from taints setting properties after the destroy character taint. 2012-12-11 13:54:26 -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 787636b97a BulletSim: Reduce idle region physics overhead where there are MANY
static objects by more restrictive selection of objects that collide
    with static objects.
Rename collision mask fuctions from 'filter' to 'group' so it is clear
    what is being set.
Rename BulletSimAPI.SetCollisionFilterMask() to SetCollisionGroupMask to match above.
Restore passing of time step to linear and angular motion component routines.
Use buffering vehicle physical parameter get/set routines consistantly.
Make range enforcement clearer by using ClampInRange() function for parameter setting.
Remove commented out experimental vehicle calculations.
2012-12-03 16:25:51 -08:00
Robert Adams 0a66317fa6 BulletSim: move GetWaterLevelAtXYZ from BSScene to BSPhysTerrain. 2012-11-28 09:48:33 -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 cbc7e7bf85 BulletSim: Make avatar capsule so it is not circular.
Simple attempt to make avatars better shaped.
Replace parameter 'avatarCapsuleRadius' with 'avatarCapsuleWidth'
and 'avatarCapsuleDepth'.
More tweeking to avatar height calculation. A little better but
short avatar's feet are above the terrain and tall avatar's feet
are a little below the ground.
2012-11-21 16:43:53 -08:00
Robert Adams 8dd5813889 BulletSim: rename SHAPE_AVATAR to SHAPE_CAPSULE with the eye to eventually having mesh avatars. 2012-11-21 16:43:06 -08: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 2f5fe4b88e BulletSim: tweek avatar capsule parameters so avatar feet don't go below ground. This solves the bouncing, short avatar problem (Mantis 6403). 2012-11-21 16:42:34 -08:00
Robert Adams 22be36be69 BulletSim: fix the problem with flying being disabled when crossing region boundries. 2012-11-18 22:57:26 -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 b83449ae9a BulletSim: correct spelling of Bullet call. It's 'swept' not 'sweep'. 2012-11-03 21:12:54 -07:00
Robert Adams 804b332d45 BulletSim: Add banking and other new code to vechile dynamics. Add third party license and contributor in for for Aurora-Sim project for physics code. 2012-11-03 21:12:46 -07:00
Robert Adams b6fc5bad00 BulletSim: fix problem with avatars sinking into the ground.
Change terrain activation state to DISABLE_SIMULATION for better performance.
2012-10-23 17:30:43 -07:00
Robert Adams 65c131c4a3 BulletSim: remove trailing spaces to make git happy. 2012-10-22 22:24:44 -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 fc33afddd3 BulletSim: remove code in ShapeCollection that hinted at shape sharing.
Add new function to ParameterDefn for calling BulletSimAPI to set values.
Tweaking to BSCharacter parameter setting to try and have avatars stand.
2012-10-19 10:52:14 -07:00
Robert Adams eaccfa6d99 BulletSim: Fix small problems with last patch: BSScene.World properly initialized and setting of C++ parameters commented out. Comments and logging added. 2012-10-19 10:52:06 -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 a791620622 BulletSim: cosmetic changes (comments and renaming). Give mass to terrain to improve interactions. 2012-10-11 14:01:10 -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 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 f2c78281ce BulletSim: fix the FloatOnWater code so avatars can normally go underwater. 2012-10-02 11:13:39 -07:00
Robert Adams 33617e09a1 BulletSim: impliment FloatOnWater OS function. 2012-10-02 11:13:32 -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 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
Robert Adams 189f51233e BulletSim: PhysicsActorType() now returns the correct value rather than 'unknown'. 2012-09-07 16:05:16 -07:00
Robert Adams ffdc798720 BulletSim: Update BulletSimAPI to match the DLL interface.
Major rework of terrain management which finally makes mega-regions work.
Update heightmap of terrain by rebuilding the terrain's body and shape.
    There is a problem with just replacing the shape so this workaround
    will do for the moment but it will need to be resolved for
    mesh and hull switching.
2012-08-31 11:41:33 -07:00
Robert Adams ae852bb873 BulletSim: clean up some variable naming for consistancy.
Update DLL API for new terrain and shape/body pattern methods.
Terrain creation and modification uses new shape/body pattern.
Move debug logging callback set to initialization call so logging
   is per physics engine.
2012-08-31 11:41:28 -07:00
Robert Adams 7c140570db BulletSim: Changes to terrain storage and management so mega-regions work.
Moved all terrain code out of BSScene and into new BSTerrainManager.
Added logic to manage multiple terrains for mega-regions.
Added new functions to BulletSimAPI to match the library.
Moved all of the terrain creation and setup logic from C++ code to C# code.
    The unused code has not yet been removed from either place. Soon.
Moved checks for avatar above ground and in bounds into BSCharacter.
2012-08-31 11:41:18 -07:00
Robert Adams 7b6987ce83 BulletSim: unify physical objects under BSPhysObjects. Now BSScene and BSLinkset only know of BSPhysObject's and there is only one list to search in BSScene. 2012-08-31 11:41:12 -07:00
Robert Adams 03d76e9403 BulletSim: restore most of the Detail logging statements. Will have
no effect on non-logging running.
Capture region name that is passed to the physics engine and use
    it for detail logging file name prefix.
Fix problem with avatars dropping when flying across region boundries.
2012-08-17 13:34:22 -07:00
Robert Adams 68f112888b BulletSim: clean up detail logging by adding many more debug log statements and then commenting out most of the additions. 2012-08-15 12:08:13 -07:00
Robert Adams 6f1f299619 BulletSim: Add the class BSCharacter to the DetailLog output 2012-08-15 12:07:53 -07:00
Robert Adams 0c7ce4fc98 BulletSim: many, many detailed logging messages for physical linkset
debugging.
Linkset bugs fixed where accounting of children would get lost.
Moved scene based vehicle tracking logic from prim to the scene.
Added GetCollisionFlags2 method to BulletSimAPI.
Updated DLLs and SOs.
2012-08-10 16:22:44 -07:00
Robert Adams 3ca770cd2c BulletSim: Add module names to DetailLog output. Fix some problems with linksets that were caused by checking data structures that are changed regularly from taint time code -- resulted in linksets not being unlinked properly. 2012-08-10 08:33:09 -07:00
Robert Adams 320982cae3 BulletSim: add an identifier to the TaintObject call so exceptions that happen when the taint is invoked can be debugged 2012-08-09 15:17:19 -07:00
Robert Adams 5ab151c2d6 BulletSim: add avatar code to keep avatars from ending up trapped under the terrain 2012-08-08 13:48:49 -07:00
Robert Adams 19417fca41 BulletSim: Added avatar capsule scaling for size of avatar.
This also fixes computation of avatar mass.
Added parameter MaxPersistantManifoldPoolSize.
Fixed a parameter setting bug which caused crashes of there were
  more than 400 or so physical objects. I tested up to 5000.
Updated BulletSim DLLs and SOs.
2012-08-07 17:15:06 -07:00
Robert Adams 4adb3471ac BulletSim: update SOs and DLLs to run on more Linux versions. Correct multiple buoyancy settings when character flying. Remove chatty log message on prim destruction. 2012-08-06 12:55:52 -07:00
Robert Adams e7ad6ed3a3 BulletSim: pass collision subscription information to the C++ code so collisions on objects that don't care are not reported up. 2012-08-03 15:09:56 -07:00
Robert Adams ea36d4a4cf BulletSim: Add AddObjectForce to BulletSim API.
Add interface 2 enhancements to BSCharacter.
Modify AddForce and SetForce to use the new Bullet interface.
More DetailLog statements for character.
2012-08-03 15:09:52 -07:00
Robert Adams c400918c84 BulletSim: Add PID variables to physical scene. Not PIDing yet, but soon.
Cleaned up code and got rid of compile warnings.
2012-07-20 14:02:24 -07:00
Robert Adams e4a6611865 Clean up collision reporting code so they are properly passed to
the simulator in batches.
More comments.
2012-07-06 15:09:19 -07:00
Robert Adams 872d513daa BulletSim: make avatar animations update properly.
It seems that ODE calls the avatar collision handling routine even
if there are no collisions. This causes the animation to be updated.
So, for instance, going from HOVER to FLY is caused by the physics engine
calling the collision routine each frame with 0 collisions.
2012-03-26 17:36:33 -07:00
Robert Adams 1a738caeca BulletSim: update TODO list. Rearrange code for readability. Add per object friction and restitution runtime settable parameters. 2012-03-23 13:15:18 -07:00
Robert Adams de24feb275 BulletSim: Add AvatarRestitution parameter. Centralize computation of buoyancy for flying. Tweek avatar default friction and resititution 2012-03-23 13:15:17 -07:00
Robert Adams 6ecdadb329 BulletSim: set buoyancy in only one place 2012-03-23 13:15:16 -07:00
Dan Lake a1dc4e830d Remove unused SetAcceleration and add set on Acceleration parameter 2011-12-20 13:40:24 -08:00
Justin Clark-Casey (justincc) 0f83f87233 Remove unused fields from CollisionEventUpdate 2011-10-25 22:39:08 +01:00
Robert Adams fef73a1a10 BulletSim: add runtime setting of physics parameters. Update default values. 2011-08-18 14:32:09 -07:00
Robert Adams 7640b5abf6 BulletSim: Parameters settable from ini file. Linksets. Physical property value tuning 2011-08-05 11:01:27 -07:00
Robert Adams 869883f2dc BulletSim: fix buoyancy for prims. Start of configurable physics parameters. 2011-07-22 15:23:57 -07:00
Robert.Adams 5ffec1cd64 Pass collisions and updates in pinned memory (saves marshaling).
Fix folding feet by using collision normals.
Add constraint specification.
2011-07-22 10:23:40 -07:00
Robert Adams 302d72701d BulletSim initial checkin 2011-06-20 17:24:42 -07:00