Commit graph

260 commits

Author SHA1 Message Date
Andrew Meadows
326d17072e merge seth/dice-on-table-1 into andrew/nova 2015-05-06 11:50:12 -07:00
Andrew Meadows
c97b11a6e9 no ownership of kinematic objects on collision 2015-05-06 11:48:31 -07:00
Seth Alves
129a3a82da clear incoming flags after adding an entity to simulation. If an entity has a shape-type of none, don't keep asking it for a shape 2015-05-06 11:20:39 -07:00
Andrew Meadows
14f925b48e merge seth/dice-on-table-1 into andrew/nova
Conflicts:
	libraries/physics/src/EntityMotionState.cpp
	libraries/physics/src/ObjectMotionState.h
2015-05-05 16:54:53 -07:00
Andrew Meadows
d4701b4310 namechange getIncomingDF --> getAndClearIncomingDF 2015-05-05 16:49:41 -07:00
Seth Alves
82828f0b93 print when bullet and local octree don't agree on position of an entity 2015-05-05 13:52:10 -07:00
Seth Alves
1cd93b9ec8 pull andrew's branch, add back in visual indicator of an entity being active in bullet 2015-05-05 13:14:22 -07:00
Andrew Meadows
aa5a59c3dc merge upstream/master into andrew/nova
Conflicts:
	libraries/entities/src/EntityItem.cpp
	libraries/physics/src/PhysicsEngine.cpp
2015-05-05 10:24:17 -07:00
Andrew Meadows
0932682c2a remove comment 2015-05-04 13:35:36 -07:00
Andrew Meadows
96acf96b76 entity-entity collision events emit signals again 2015-05-04 13:32:57 -07:00
Andrew Meadows
fef84730bf remake foundation for CollisionEvents 2015-05-03 09:27:15 -07:00
Andrew Meadows
0a102575ee fix simulation ownership infection 2015-05-01 16:56:00 -07:00
Seth Alves
560d89b38a session id can be null. don't crash 2015-05-01 14:56:03 -07:00
Andrew Meadows
42ec39c578 add ObjectMotionType::bump(), use in PhysicsEngine 2015-05-01 14:39:33 -07:00
Andrew Meadows
b023fe582a make things compile 2015-05-01 10:44:50 -07:00
Andrew Meadows
4cb469dd79 cleanup how MotionStates are deleted from physics
also fixed some compile errors
removed cruft
2015-05-01 08:28:32 -07:00
Andrew Meadows
c3901939e6 make some things compile after reorganization 2015-04-30 13:02:18 -07:00
Andrew Meadows
31ab16ac62 move stuff into ObjectMotionState 2015-04-29 16:16:44 -07:00
Andrew Meadows
ab38572620 new PhysicsEngine API is mostly in place
doesn't compile, of course
large code movements are done
non-physical kinematics have been lost --
will readd in PhysicalEntitySimuation class
2015-04-29 09:48:02 -07:00
Andrew Meadows
087d0a027d merge upstream/master into andrew/nova 2015-04-28 10:07:49 -07:00
Andrew Meadows
34974272af proposal for PhysicsEngine API in Application 2015-04-28 10:06:05 -07:00
Andrew Meadows
31e5758422 namechange updateObjectEasy()-->updateBodyEasy() 2015-04-27 13:04:59 -07:00
Andrew Meadows
72deb2e49b merge upstream/master into andrew/thermonuclear
Conflicts:
	libraries/entities/src/EntityItem.h
	libraries/physics/src/EntityMotionState.cpp
2015-04-27 12:54:21 -07:00
Seth Alves
e14b4c6ad4 cleanups 2015-04-27 11:01:48 -07:00
Andrew Meadows
e3d29d74af name changes and preparation for more cleanup 2015-04-26 15:24:30 -07:00
Seth Alves
6e6793cbcc remove debugging prints 2015-04-24 15:18:02 -07:00
Andrew Meadows
3ecf959b3e removed cached copies of damping and restitution 2015-04-24 14:50:37 -07:00
Seth Alves
e7c6ee597a sync 2015-04-24 14:36:05 -07:00
Seth Alves
ea250c037a sync 2015-04-24 14:27:32 -07:00
Seth Alves
6b53fefebe sync 2015-04-24 14:21:59 -07:00
Andrew Meadows
c4395e75bb cleanup and comments 2015-04-24 13:26:26 -07:00
Seth Alves
6d151ee3ed try a different way of identifying when to claim simulation ownership of a moving entity 2015-04-24 09:29:05 -07:00
Seth Alves
cf0499e671 various physics-related experiments 2015-04-23 21:07:04 -07:00
Seth Alves
2ca592de8b fix logic with infectious simulation ownership 2015-04-23 10:02:29 -07:00
Seth Alves
10e5378396 fix mangled if 2015-04-23 09:13:18 -07:00
Seth Alves
9e96026c52 move _accelerationNearlyGravityCount and _shouldClaimSimulationOwnership from EntityItem to EntityMotionState 2015-04-22 21:36:36 -07:00
Seth Alves
4ca076ed94 put PhysicsEngine::bump back in. some things get missed if we just set the one thing active 2015-04-22 18:53:49 -07:00
Seth Alves
5a7f8a2f5a git rid of unneeded bump code. re-indent billiards.js and rez in balls with some y velocity so they fall to the table 2015-04-22 17:06:21 -07:00
Seth Alves
864f8cb3b3 fix comment 2015-04-22 16:10:25 -07:00
Seth Alves
96b4517e6e when removing something from bullet, attempt to wake up anything that was touching it 2015-04-22 16:05:31 -07:00
Seth Alves
07a848c9ce added bump call in physics engine for when an entity is deleted and may have something resting on top of it 2015-04-22 15:50:39 -07:00
Seth Alves
3450597d70 remove some debugging prints 2015-04-22 15:03:23 -07:00
Seth Alves
c30d742f7d experimenting 2015-04-22 14:22:09 -07:00
Seth Alves
36dbbd0c9d experimenting 2015-04-22 14:14:12 -07:00
Seth Alves
cd3ee39fcc experimenting 2015-04-22 13:42:04 -07:00
Seth Alves
ee000f91ae experimenting 2015-04-22 13:27:19 -07:00
Seth Alves
27ed0c4a98 experimenting 2015-04-22 13:21:06 -07:00
Seth Alves
7382b0b19f experimenting 2015-04-22 13:17:20 -07:00
Seth Alves
32673efc80 compute collision events inside lock to avoid a rare crash 2015-04-22 10:51:45 -07:00
Andrew Meadows
65825a4501 Merge pull request #4659 from ericrius1/collision
Filtering triggering of collisions with contact type of "continue"
2015-04-22 09:33:40 -07:00
Seth Alves
23f1767634 cleanup 2015-04-20 16:13:28 -07:00
Seth Alves
d6c8bd94cf clean up some debugging prints 2015-04-20 15:59:33 -07:00
Seth Alves
08d300afcd use a flag to indicate that simulation ownership should be grabbed 2015-04-20 11:49:10 -07:00
Seth Alves
88f289f3c1 small cleanup and some debugging prints 2015-04-20 11:19:48 -07:00
Seth Alves
fbff3627dc attempt to claim simulation ownership of entities the avatar crashes with 2015-04-20 11:13:51 -07:00
Eric Levin
2b4d894ab3 moved the type computation inside the while loop so it is correctly computed each iteration 2015-04-17 08:17:58 -07:00
Eric Levin
096f69961a Filtering triggering of collisions with contact type of "continue" 2015-04-16 16:42:28 -07:00
Andrew Meadows
619d1ba191 rename to measureAcceleration 2015-04-16 14:09:33 -07:00
Andrew Meadows
5180e7e715 measure linear velocity of moving objects 2015-04-16 13:44:17 -07:00
Andrew Meadows
abb40ca080 cleanup: split stats dump out of stepSimulation 2015-04-14 09:00:36 -07:00
Andrew Meadows
40c94fa00e merge upstream/master into andrew/isentropic 2015-04-07 16:23:38 -07:00
Seth Alves
55bab2efd6 put physics into its own logging group 2015-04-06 18:09:45 -07:00
Andrew Meadows
435ce106eb Add DynamicCharacterController prototype 2015-04-06 16:03:13 -07:00
Andrew Meadows
27d6d9f720 add Bullet profiling hooks for physics simulation 2015-04-02 15:20:16 -07:00
Andrew Meadows
94c1cf12f5 deleting _dynamicsWorld doesn't crash on shutdown 2015-03-30 17:12:19 -07:00
Philip Rosedale
f116ac131d Merge pull request #4532 from AndrewMeadows/inertia
fix crash in PhysicsEngine on shutdown
2015-03-30 16:31:34 -07:00
Andrew Meadows
c6b34df06c unlock after character is properly updated 2015-03-30 16:07:56 -07:00
Seth Alves
ee7247a5b4 fix a couple of crashes 2015-03-30 15:56:01 -07:00
Andrew Meadows
9b13f186e3 remove character from PhysicsEngine on shutdown 2015-03-30 15:51:58 -07:00
Seth Alves
7137b41375 free these so it's easier to see other leaks in valgrind 2015-03-30 09:30:37 -07:00
Andrew Meadows
430158c109 updateShapeIfNecessary() is a more correct name 2015-03-24 23:35:09 -07:00
Andrew Meadows
44eca08fa4 PhysicsEngine doesn't need AvatarData
MyAvatar now owns its CharacterController
fix for bug of phantom collision obj when avatar's physics are disabled
2015-03-24 17:38:35 -07:00
Andrew Meadows
6454149536 formatting and comments 2015-03-20 12:45:29 -07:00
Andrew Meadows
90a8844738 merge upstream/master into andrew/bispinor
Conflicts:
	libraries/physics/src/PhysicsEngine.cpp
2015-03-19 16:18:52 -07:00
Brad Davis
91906d619f Removing unmatched QReadWriteLock::unlock() call 2015-03-18 22:32:06 -07:00
Andrew Meadows
c032b29633 proper shape management for ConvexHull shapes 2015-03-18 16:29:57 -07:00
Seth Alves
dd97b54e52 quiet physics log spam 2015-03-18 13:22:29 -07:00
Seth Alves
2dd75fef2c remove some unneeded Q_OBJECT macros, diff minimization 2015-03-17 19:12:26 -07:00
Seth Alves
b76103edb0 clean up debugging spew 2015-03-16 16:44:29 -07:00
Andrew Meadows
78b614f855 move avatar details into CharacterController 2015-03-16 16:24:32 -07:00
Seth Alves
59e4efa651 debugging prints around a deadlock 2015-03-15 07:10:43 -07:00
Seth Alves
250567e315 formatting, diff minimization 2015-03-14 12:09:23 -07:00
Seth Alves
b815c365eb formatting 2015-03-13 18:57:27 -07:00
Seth Alves
87cc710efc more merge madness, calculate 2nd PhysicsEngine hash with qChecksum if url is set 2015-03-13 18:43:24 -07:00
Seth Alves
50798398ff merge from upstream 2015-03-13 18:04:55 -07:00
Seth Alves
2368e6e5b7 collision with a hull sort of works. there is a new memory corruption problem 2015-03-13 15:41:57 -07:00
Andrew Meadows
99e2d799c5 correct math for capsule halfHeight 2015-03-13 09:40:32 -07:00
Seth Alves
89b58e2681 trying to get loaded callback for model hooked up to PhysicsEngine 2015-03-13 09:11:15 -07:00
Seth Alves
a945421d9d still trying to make PhysicsEngine::addEntityInternal be async 2015-03-12 16:38:55 -07:00
Andrew Meadows
a1a12465da able to update avatar controller in PhysicsEngine 2015-03-12 16:36:41 -07:00
Seth Alves
2cf0e1ab25 break PhysicsEngine::addEntityInternal in half, making the 2nd part asynch. This is to allow a ModelEntityItem time to download its collision hull before the 2nd part runs 2015-03-12 15:58:09 -07:00
Andrew Meadows
3d531e8304 add f at end of float literal 2015-03-10 14:24:49 -07:00
Andrew Meadows
fd76eda383 slightly better hardcoded size for avatar capsule
we'll be measuring avatar dimensions more correctly soon
2015-03-09 17:59:45 -07:00
Andrew Meadows
3c05d685d7 avoid assert for zero-length character velocity 2015-03-09 17:37:34 -07:00
Seth Alves
ab8784f1b4 add comment about character capsule being hard-coded 2015-03-09 13:51:08 -07:00
Seth Alves
b2cfed8bca removed unused blob of code 2015-03-08 09:04:00 -07:00
Seth Alves
ac0c4e8512 cap max speed at MAX_WALKING_SPEED 2015-03-04 19:57:06 -08:00
Seth Alves
a8b688d540 move _velocity into base class. walking on a cube works 2015-03-04 15:26:02 -08:00
Seth Alves
b4998e9c53 falling onto an object works 2015-03-04 08:48:48 -08:00
Seth Alves
8eec66c066 merge upstream, avatar can now fall onto a cube 2015-03-03 18:37:16 -08:00
Seth Alves
7e4b597ca3 keep physics specific code in PhysicsEngine 2015-03-03 15:45:10 -08:00
Andrew Meadows
5776df1012 load dynamic obj as inactive when not moving 2015-02-25 12:07:19 -08:00
Andrew Meadows
b4da2ddd52 fix physics crash on disconnect from domainserver 2015-02-05 09:13:32 -08:00
Andrew Meadows
23bd3f90d9 Bullet-style rotation integration for kinematics
and for dead reckoning after wire-transfer
2015-01-27 17:27:15 -08:00
Andrew Meadows
d5c0c200de optimization for when physics engine doesn't step 2015-01-27 15:54:32 -08:00
Andrew Meadows
1ad5f9c7db merge upstream/master into andrew/isentropic
Conflicts:
	libraries/physics/src/ObjectMotionState.cpp
2015-01-23 14:04:26 -08:00
Andrew Meadows
b34189115d Merge branch andrew/isentropic 2015-01-23 13:21:45 -08:00
Andrew Meadows
f2bcdfa2b4 update _lastSimulated for kinematic motion 2015-01-23 13:10:41 -08:00
Andrew Meadows
d173afaa70 add support for non-physical kinematic movement 2015-01-23 11:01:46 -08:00
Andrew Meadows
3997b916c1 remove ground collision hack for physics testing 2015-01-22 09:17:51 -08:00
Andrew Meadows
77c4362991 fix typo 2015-01-21 18:14:24 -08:00
Andrew Meadows
b2e79a0157 don't process results when no simulation 2015-01-21 18:06:19 -08:00
Andrew Meadows
2751fab2c3 don't send collision events for inactive pairs
also throttle collision events to 30/sec
2015-01-21 18:02:13 -08:00
Andrew Meadows
1c38b08e8f remane emitEntityCollision... to entityCollision... 2015-01-21 14:07:23 -08:00
Andrew Meadows
6840daa0b5 removing tabs from formatting 2015-01-21 11:55:28 -08:00
Andrew Meadows
e49c76656f merge upstream/master into andrew/isentropic
Conflicts:
	libraries/physics/src/PhysicsEngine.cpp
2015-01-21 11:35:36 -08:00
Andrew Meadows
86583f3f3f physics collisions emit script collision events 2015-01-21 11:27:32 -08:00
Andrew Meadows
790d07d346 track known contacts and generate collision events 2015-01-20 14:18:10 -08:00
Andrew Meadows
5da38834e2 introduce notion of NumSteps vs NumSubsteps 2015-01-20 11:16:40 -08:00
Andrew Meadows
0154c613d0 change FrameCount to NumSubsteps for more accuracy 2015-01-20 11:02:48 -08:00
Andrew Meadows
549e3fac5f store backpointer to MotionState in btRigidBody 2015-01-20 10:45:58 -08:00
Andrew Meadows
e4f29412d5 cheaper failure adding entity to physics engine 2015-01-19 18:11:14 -08:00
Andrew Meadows
171fead347 remove log about failure to add to physics engine 2015-01-19 15:55:53 -08:00
Andrew Meadows
d5119b3532 merge upstream/master into andrew/bispinor
Conflicts:
	libraries/entities/src/EntityItem.cpp
	libraries/physics/src/EntityMotionState.h
	libraries/physics/src/ObjectMotionState.cpp
	libraries/physics/src/PhysicsEngine.cpp
	libraries/physics/src/PhysicsEngine.h
2015-01-16 14:36:27 -08:00
Andrew Meadows
7c9419aa4e fix non-bullet build 2015-01-16 10:34:52 -08:00
Andrew Meadows
3fed38793e merge andrew/origin/inertia to andrew/local/inertia 2015-01-15 17:55:51 -08:00
Andrew Meadows
250fd98fee support for simple kinematic motion 2015-01-15 17:51:01 -08:00
Andrew Meadows
ff171a5782 Bullet is now required dependency 2015-01-15 10:27:43 -08:00
Andrew Meadows
03b8badd81 EntityItem stores density rather than mass. 2015-01-14 15:00:57 -08:00
Andrew Meadows
dcca5d532a fix for glitchy physics updates
The main problem was: ObjectMotionState::_sentPosition and friends
were not being updated when the EntityServer update arrives.
2015-01-13 14:00:37 -08:00
Andrew Meadows
c37c1515ba EntitySimulation is lockable
also DeleteEntityOperator just removes the entities
and EntityTree does the actual delete
(after properly locking its _simulation)
2015-01-08 10:22:25 -08:00
Andrew Meadows
75a8faec86 purge support for voxels from PhysicsEngine 2015-01-05 15:02:18 -08:00
Andrew Meadows
3b7770f405 change meaning of damping to agree with bullet
0 = no damping
1 = 100% damping

The new formula is: velocity *= (1 - damping)^dt
2015-01-05 11:23:01 -08:00
Andrew Meadows
a97b8b0ea9 fix memory leak of EntityMotionState's 2014-12-29 16:33:41 -08:00
Andrew Meadows
b078850c6a remove personal TODO list from code file 2014-12-29 10:46:56 -08:00
Andrew Meadows
c6afa0f7e1 remove test hack for higher than normal ground 2014-12-17 14:17:30 -08:00
Andrew Meadows
6ea766b48d merge andrew/thermonuclear into andrew/inertia
Conflicts:
	interface/src/Application.cpp
	libraries/entities/src/EntityItem.cpp
	libraries/entities/src/EntityTypes.cpp
2014-12-17 13:21:00 -08:00
Andrew Meadows
905d7f50eb comments on TODO list 2014-12-17 12:39:48 -08:00
Andrew Meadows
31486a81c1 updated TODO notes 2014-12-15 14:41:04 -08:00
Andrew Meadows
b3731e9530 hack for "reliable" packet send when objects stop moving 2014-12-15 14:36:27 -08:00
Andrew Meadows
fd8e3f6169 add moved entities to lists for sorting
and also for outgoing packet updates
2014-12-12 13:28:12 -08:00
Andrew Meadows
ad7641c7e0 repairs to build when Bullet not found 2014-12-11 16:05:45 -08:00
Andrew Meadows
c3f8f8ab98 init PhysicsEngine with an EntityEditPacketSender 2014-12-11 13:29:29 -08:00
Andrew Meadows
4977bfb708 ObjectMotionState puts self on outgoing queue 2014-12-11 12:40:43 -08:00
Andrew Meadows
572ceb75a4 clarification of what outgoing flags are about 2014-12-11 12:07:53 -08:00
Andrew Meadows
cc0e82b97f incoming changes is now QSet<ObjectMotionState*> 2014-12-11 10:56:22 -08:00
Andrew Meadows
d9f183458a _entityMotionStates is Qset of EntityMotionState* 2014-12-11 08:43:01 -08:00
Andrew Meadows
f9ba4d355c implement EntitySimulation API in PhysicsEngine 2014-12-10 17:01:20 -08:00
Andrew Meadows
b0cc3a8509 add logic for when to update moving entity 2014-12-08 17:18:07 -08:00
Andrew Meadows
d6c97be78e using an infinite plane for the ground 2014-12-03 20:17:42 -08:00