Commit graph

1571 commits

Author SHA1 Message Date
luiscuenca
b2e02e20cc Fix inaccurate delta rotation axis 2018-07-05 11:47:10 -07:00
Andrew Meadows
ff6c309d8b add comment 2018-07-02 15:20:51 -07:00
Andrew Meadows
9c32a38fb6 fix deactivation slow-spinning kinematics 2018-07-02 15:04:11 -07:00
Andrew Meadows
5e2a08b3c2 handle deactivation of avatar entities differently 2018-06-25 10:37:54 -07:00
Sam Gondelman
850e2d5cf5
Merge branch 'master' into particleFix 2018-06-21 17:32:24 -07:00
John Conklin II
4088035b3b
Merge pull request #13411 from sabrina-shanman/crash-delete-cube
Fix crash when deleting objects in serverless mode
2018-06-21 14:39:07 -07:00
SamGondelman
8f411ad6c8 CR 2018-06-20 16:13:10 -07:00
sabrina-shanman
59833d8f28 Do not use boolean for variable definitions. Use bool instead. 2018-06-20 15:54:19 -07:00
Andrew Meadows
4424a8df11
Merge pull request #13303 from highfidelity/workload
workload project part 1
2018-06-20 15:39:01 -07:00
sabrina-shanman
c039d20304 Fix objects snapping back when selected 2018-06-20 13:55:38 -07:00
Andrew Meadows
44c3620b6e remove cruft 2018-06-18 17:45:58 -07:00
sabrina-shanman
67c605c10a Do not use ownership tracking in serverless mode in PhysicalEntitySimulation 2018-06-18 16:12:38 -07:00
John Conklin II
9ace80c709
Merge pull request #13407 from AndrewMeadows/0.69.0-colliding-avatars
RC69: avatars collide again (again)
2018-06-18 15:21:47 -07:00
Andrew Meadows
a18ba36dd2 merge 'master' into 'workload' 2018-06-18 13:40:08 -07:00
Andrew Meadows
085130e3c9 avatars collide again again 2018-06-18 13:17:32 -07:00
Andrew Meadows
6d422e4678 Merge 'master' into 'workload' 2018-06-18 10:30:13 -07:00
John Conklin II
87d26a9d86
Merge pull request #13304 from sabrina-shanman/btghostraytest
Use optimized Bullet raytest function in CharacterGhostObject::rayTest()
2018-06-18 10:22:17 -07:00
Andrew Meadows
670e07bbf5 fix crash for computing inertia for btBvhTriangleMeshShape 2018-06-15 14:31:51 -07:00
Andrew Meadows
93ac70ead4 avoid crash in inertia calculation of btBvhTriangleMeshShape 2018-06-15 10:28:12 -07:00
sabrina-shanman
baf0df05cd Remove unnecessary 'this->' in rayTest parent function call 2018-06-14 13:16:46 -07:00
Clement
920263ef49 Merge branch 'stable' of https://github.com/highfidelity/hifi into new-master 2018-06-12 17:00:25 -07:00
Andrew Meadows
d31ee52d79 revert PR-13162 from RC68 2018-06-12 03:51:55 -07:00
sabrina-shanman
d4d8f36e44 Change CharacterGhostObject to use base btGhostObject class instead of btPairCachingGhostObject 2018-06-11 15:40:39 -07:00
Seth Alves
a2399ea1f6 keep small masses from introducing NaN into bullet's calculations 2018-06-08 16:07:01 -07:00
sabrina-shanman
9ac1443b83 Use optimized Bullet raytest function in CharacterGhostObject::rayTest() 2018-06-05 11:17:17 -07:00
Andrew Meadows
4329ea5240 Merge master' into 'workload' 2018-06-04 16:11:25 -07:00
Andrew Meadows
db3520b332 also update queryAACube for 'Held' things 2018-06-01 16:38:57 -07:00
Andrew Meadows
7e44b9b3ae motionState needs correct region when adding to physics 2018-05-31 10:23:49 -07:00
Andrew Meadows
62df4999ef declare method const 2018-05-31 10:22:22 -07:00
Andrew Meadows
c2f5d19ddb add TODO about optimizing character ray tracing 2018-05-31 10:21:14 -07:00
Andrew Meadows
003e444246 Merge branch 'master' into 'workload' 2018-05-30 16:04:13 -07:00
Andrew Meadows
bc57003cfb activate body before disconnecting action from entity 2018-05-29 17:56:41 -07:00
Andrew Meadows
5d3502ed88 activate body when removing action 2018-05-29 17:56:41 -07:00
Andrew Meadows
1612d90cd3 minor DynamicsWorld optimizations and track global steps count therein 2018-05-25 08:31:09 -07:00
Andrew Meadows
ed62a2fc37 _lastKinematicStep now mutable, avoids explicit const_cast 2018-05-25 08:31:09 -07:00
samcake
559d436dfa Fixing the merge conflicts 2018-05-24 16:57:10 -07:00
Andrew Meadows
31dd59d212 double bits in collision groups 2018-05-24 11:28:52 -07:00
Andrew Meadows
84a2e5e443 fix yeild behavior for owned things outside of R1 2018-05-18 11:23:56 -07:00
Andrew Meadows
a9c193b672 merge 'workload-014' into 'workload' 2018-05-18 10:12:04 -07:00
Andrew Meadows
a23126a6b2 Merge 'master' into 'workload' 2018-05-18 07:38:02 -07:00
Andrew Meadows
00e360aff0 reduce sim ownership priority when releasing grab 2018-05-17 17:25:07 -07:00
Andrew Meadows
2cf6e9007b remove unsused data member 2018-05-16 13:57:51 -07:00
Sam Gateau
523d57d948
Merge pull request #13162 from AndrewMeadows/avatar-collisions
avatars collide again
2018-05-16 09:25:05 -07:00
Andrew Meadows
c7c4324b3c Merge 'master' into 'workload' 2018-05-15 10:22:50 -07:00
John Conklin II
c57b0a957d
Merge pull request #13138 from AndrewMeadows/avoid-div-by-zero
avoid div by zero when measuring RigidBody effective acceleration
2018-05-14 13:41:08 -07:00
Andrew Meadows
6de175e794 avatars collide again 2018-05-11 17:01:48 -07:00
Seth Alves
85a6e2555f don't assert when unserializing a 'spring' action 2018-05-11 13:55:29 -07:00
John Conklin II
4129664368
Merge pull request #13145 from highfidelity/stable
Merge RC67 stable into master
2018-05-10 17:07:20 -07:00
Andrew Meadows
b8d34f4b8f more correct variable name 2018-05-09 12:13:27 -07:00
Andrew Meadows
f454dac709 avoid div by zero when measuring acceleration 2018-05-09 12:04:44 -07:00
Seth Alves
db03265a6b when in serverless mode, short-circuit simulation ownership bids 2018-05-09 10:53:46 -07:00
Clement
da9fb9c751 Fix non self-sufficient headers 2018-05-04 16:26:41 -07:00
Andrew Meadows
b1fcb43246 send ownership removal packet when dynamic object leaves bullet 2018-05-03 16:23:13 -07:00
Andrew Meadows
99a75c5a87 Merge 'master' into 'workload' 2018-05-02 17:28:36 -07:00
Anthony J. Thibault
4fa9af5534 Added items to the developer menu for debugging physics
Hooked up Bullet's internal debug draw functionality to our client.
Under the Developer > Physics Menu there are five new items:

  * Show Bullet Collision - will draw all collision shapes in wireframe. WARNING: can be slow on large scenes.
  * Show Bullet Bounding Boxes - will draw axis aligned bounding boxes around all physics shapes.
  * Show Bullet Contact Points - will draw all contact points where two or more objects are colliding.
  * Show Bullet Constraints - will render wire frame axes for each constraint connecting bodies together.
  * Show Bullet Constraint Limits - will render the joint limits for each constraint.
2018-05-02 10:51:00 -07:00
Sam Gateau
22e5465767
Merge pull request #13013 from AndrewMeadows/avoid-update-flood
fix bug: interface sends too many updates on settle
2018-05-02 08:52:58 -07:00
Andrew Meadows
003ea5ae36 remove unused crufty debug variable 2018-05-01 13:15:37 -07:00
Andrew Meadows
26db9ec09e yield ownership outside workload R1 2018-05-01 13:15:37 -07:00
samcake
b3408ae4c0 Merge branch 'master' of https://github.com/highfidelity/hifi into upstream-workload 2018-05-01 11:39:54 -07:00
Seth Alves
f1e1c6a348 fix physics related crash-on-exit 2018-05-01 09:15:44 -07:00
Andrew Meadows
03e03727db fix bug: interface sends too many updates on settle 2018-04-26 12:55:28 -07:00
samcake
5b5cad38e8 Merge branch 'master' of https://github.com/highfidelity/hifi into workload 2018-04-25 10:03:42 -07:00
Andrew Meadows
ae186d46c6 don't try to build convex hulls with nan data 2018-04-23 14:46:23 -07:00
samcake
b554aec317 Trying more drastic changes and learnign to use std::chrono the right way 2018-04-20 17:53:24 -07:00
samcake
9b1a887469 Starting to move dynamically yeah 2018-04-19 17:43:14 -07:00
samcake
a6bd589f4f Merging upstream 2018-04-19 12:20:10 -07:00
Stephen Birarda
c4ad93bafb
Merge pull request #12782 from SimonWalton-HiFi/qregexp
Replace LogHandler repeated regex scheme with assigned ID tracking scheme
2018-04-18 17:28:48 -07:00
John Conklin II
87f60e1e25
Merge pull request #12894 from sethalves/fix-tractor-action-crazy
fix bug that caused tractor action to go crazy
2018-04-18 14:13:56 -07:00
Andrew Meadows
4d3109b849 cleanup some comments 2018-04-16 13:31:36 -07:00
Andrew Meadows
ace32193b4 more correct stat names 2018-04-16 13:31:36 -07:00
Seth Alves
22fd4a7116 fix bug that caused tractor action to go crazy if only one of the two entities it connected were known to interface 2018-04-14 12:27:58 -07:00
Andrew Meadows
060c391d47 more correct stat names 2018-04-12 14:23:48 -07:00
samcake
e2f9eef5e2 Merge branch 'master' of https://github.com/highfidelity/hifi into workload 2018-04-12 12:27:27 -07:00
John Conklin II
e47dca77ec
Merge pull request #12773 from AndrewMeadows/expire-simulation-ownership
entity-server will expire stale simulation ownership
2018-04-12 12:04:52 -07:00
Sam Gateau
6a7ae55d9c Merge branch 'master' of https://github.com/highfidelity/hifi into workload 2018-04-11 19:08:57 -07:00
Andrew Meadows
a0f3e3a031 add simulation ownership expiry 2018-04-11 09:40:32 -07:00
SamGondelman
8f65813924 fix asserts on domain switch 2018-04-09 17:10:49 -07:00
samcake
694baa81e8 removing logging around physics 2018-04-06 16:12:02 -07:00
Andrew Meadows
2cfb835b56 only add to physics simulation that when necessary 2018-04-06 15:26:33 -07:00
Andrew Meadows
ed1761945c add/remove entities to physics using workload output 2018-04-06 07:22:05 -07:00
Simon Walton
ed3347a89b Repeated logging - reviewer fixes 2018-04-04 14:11:10 -07:00
Simon Walton
692ccfc09b Create HIFI_FCDEBUG(_ID) variants that require a category
Original macros use default settings.
2018-04-04 09:49:15 -07:00
Andrew Meadows
f0fcfc432c fix typo in comment 2018-04-03 22:16:10 -07:00
Andrew Meadows
6d7574cab9 use std::numeric_limtis<uint64_t>::max() instead of -1 2018-04-03 22:13:25 -07:00
Andrew Meadows
70d6aa99e8 more 'const uint64_t&' purges 2018-04-03 21:55:31 -07:00
Andrew Meadows
bd2bfb6807 DRY: simpler removal of element from middle of std::vector 2018-04-03 18:28:07 -07:00
Andrew Meadows
0a2b4a8d1d add comment about returning smart pointer by ref 2018-04-03 18:26:43 -07:00
Simon Walton
7d16ca9c1c Remove uses of addRepeatedMessageRegex() and its implementation
Change to new log-message ID scheme.
2018-04-03 17:54:01 -07:00
Andrew Meadows
59abc1d5b5 DRY sendBid() and sendUpdate() 2018-03-30 17:04:31 -07:00
Andrew Meadows
766077204e fix typo inside assert() 2018-03-30 16:35:16 -07:00
Andrew Meadows
a924bd4eb0 set correct _bidPriority on first ownership update 2018-03-30 13:18:32 -07:00
Andrew Meadows
5a5376c3d5 untangle 'bidding' from 'owned' 2018-03-30 13:18:32 -07:00
Andrew Meadows
170ec83870 remove unnecessary assert 2018-03-30 13:18:32 -07:00
Andrew Meadows
eb07f6732f add reminder comment 2018-03-30 13:18:32 -07:00
Andrew Meadows
49dce6fa1a remove some redundancy checks
no need to assert(_entity) : guaranteed by ctor and dtor logic
moved some checks around to avoid redundant work
2018-03-30 13:18:32 -07:00
Andrew Meadows
4e0f307dc0 quint8 --> uint8_t 2018-03-30 13:18:32 -07:00
Andrew Meadows
2be0f0fa22 better comments 2018-03-30 13:18:32 -07:00
Andrew Meadows
c61a226bb5 delete default EntityMotionState ctor 2018-03-30 13:18:32 -07:00
Andrew Meadows
73fa6d3d2f slightly simpler EntityMotionState delete logic 2018-03-30 13:18:32 -07:00
Andrew Meadows
6746e08206 faster EntitySimulation::takeDeadEntities() 2018-03-30 13:18:32 -07:00
Andrew Meadows
e1d2a5e5f3 more cleanup for deleting entities 2018-03-30 13:18:32 -07:00
Andrew Meadows
0596497930 more correct comments 2018-03-30 13:18:32 -07:00
Andrew Meadows
6837d042ad move entityCollisionWithEntity to PhysicalEntitySimulation 2018-03-30 13:18:32 -07:00
MiladNazeri
e054f16c46
Merge pull request #12526 from ctrlaltdavid/21709
Entities API JSDoc
2018-03-12 14:40:09 -07:00
NissimHadar
9b9b62d0e4 Transition to hover if falling and height above ground is greater than the threshold. 2018-03-09 15:20:51 -08:00
David Rowe
1fb02d15d7 Entities actions JSDoc 2018-02-27 14:12:20 +13:00
Andrew Meadows
672520f3bf quickfix for velocity spike for Tractor action 2018-02-06 12:06:27 -08:00
Seth Alves
639f7a52d8 remove unneeded/repeated line 2018-02-02 18:24:38 -08:00
Andrew Meadows
83ab994181 avoid initial bad measure of tractor target's velocity 2018-02-02 16:42:51 -08:00
Andrew Meadows
75b5635d2f less word salad 2018-01-18 17:43:22 -08:00
Andrew Meadows
3d3bfcf7a3 check dirty flags when harvesting physics results 2018-01-18 17:43:22 -08:00
humbletim
b91d536dd0 rename model:: -> graphics:: 2018-01-16 12:46:16 -05:00
humbletim
08ccda9cfc rename libraries/model(src/model) -> libraries/graphics(src/graphics) 2018-01-16 12:44:44 -05:00
Howard Stearns
724db93389
Merge pull request #12002 from howard-stearns/consistent-goToUser
Consistent go to user
2018-01-07 11:07:39 -08:00
Andrew Meadows
623a29b14a add ownership infection for constraints 2018-01-04 16:48:06 -08:00
Andrew Meadows
01fd6dc8f6 add comments to make code more clear 2018-01-04 15:53:03 -08:00
Andrew Meadows
6638b1deae fix bug causing sim ownership thrash 2018-01-04 15:53:03 -08:00
howard-stearns
16a58ddf5a Merge branch 'master' of https://github.com/highfidelity/hifi into consistent-goToUser 2017-12-19 10:48:34 -08:00
howard-stearns
813a94a79e function => macro to conditionally take debug arg 2017-12-15 17:12:44 -08:00
howard-stearns
d730b7b87b consistent goToUser behavior in PAL, and be able to go to flying user. 2017-12-15 17:00:54 -08:00
Andrew Meadows
406bf7898d cleanup prof stats and trace context names 2017-12-11 11:31:00 -08:00
Andrew Meadows
2538204b1e expose physics simulation stats to Test JS API 2017-12-11 11:31:00 -08:00
Andrew Meadows
4540e9e483 add ability to save simulation stats to file 2017-12-11 11:31:00 -08:00
Andrew Meadows
fcff9d7e36 use class hierarchy instead of lambdas 2017-12-11 11:31:00 -08:00
Andrew Meadows
068d04c58d abstraction of recursion through bullet perf stats 2017-12-11 11:31:00 -08:00
Dante Ruiz
1e6b5c0c75 make requested changes 2017-12-01 17:09:00 -08:00
Dante Ruiz
a1d90b5dd9 added extra bit 2017-12-01 15:41:13 -08:00
ZappoMan
04ee1adabd Merge branch 'master' of https://github.com/highfidelity/hifi into entityItemCleanup 2017-11-19 14:40:31 -08:00
ZappoMan
b5199220ab cleanup SpatiallyNestable Velocity to match WorldVelocity naming 2017-11-02 17:07:53 -07:00
ZappoMan
f63db42c0e migrate SpatiallyNestable::getOrientation to getWorldOrientation, remove redundant getRotation 2017-10-28 10:14:25 -07:00
ZappoMan
a7a0f03ede rename SpatiallyNestable::getPosition() to SpatiallyNestable::getWorldPosition() 2017-10-27 18:39:17 -07:00
Andrew Meadows
137fccbd91 cleanup ShapeFactory implementation 2017-10-27 08:56:26 -07:00
Andrew Meadows
d45febf1db add description of ShapeManager in comments 2017-10-27 08:55:41 -07:00
Andrew Meadows
45e571dd02 cleanup ShapeInfo::getHash() 2017-10-27 07:52:51 -07:00
Andrew Meadows
2d0b94817c Merge pull request #11336 from 1P-Cusack/21389_PR2
WL21389 PR2: Representation of collision shapes need updating (details below).
2017-10-25 10:41:21 -07:00
LaShonda Hopper
8cc20e6b71 Minor: Fixes comment typo.
Changes to be committed:
    modified:   libraries/physics/src/ObjectMotionState.h
2017-10-24 14:16:24 -04:00
LaShonda Hopper
5b50b362f1 [WL21389] WL21389 PR2: Representation of collision shapes need updating (details below).
This commit adds support for the polyhedrons and polygons sans
Torus and Quad which aren't currently supported within GeometryCache.

* Moves GeometryCache::_shapes from public to private scope
    * Nothing aside from the class should be directly altering this, only querying
    * Updated instances of direct referencing which looks to have been limited to prior
      testing of instancing and shapes.
* Adds an accessor function for ShapeData to GeometryCache
* Consolidates point list generation to helper function
    * GeometryCache::computeSimpleHullPointListForShape
* Moves GeometryCache::Shape to entity::Shape mapping to GeometryCache from
  RenderableShapeEntityItem
    * Adds conversion accessor to GeometryCache, GeometryCache::Shape getShapeForEntityShape
* Sets ShapeEntityItem::ShapeInfoCalculator callback committed earlier.
    * This helps circumvent the issue with library inclusion.  entity-render knows about
      entity; however, entity doesn't know about entity-renderer; however, GeometryCache
      data is needed within entity::ShapeEntityItem to compose the ShapeInfo point list data.
    * This callback is set up within Application::init of the Interface as it knows about
      both halves of the equation, and the callback needs to be setup prior to any entities
      collision data getting generated.
* Removes _type reset within ShapeInfo::setPointCollection
    * This should avoid any issues due to subversively setting the type or
      incorrectly setting the type as a tangential operation.
        * Audited instances of ShapeInfo::setPointCollection and all seemed to be
          calling the function immediately after having set the type via
          ShapeInfo::setParams
* Adds new ShapeType: SHAPE_TYPE_CIRCLE
    * This type is reserved for the circle which is now treated as a special
      type of Cylinder_Y with regard to collision as opposed to a simple hull.
    * Fixes the issue where jumping on a circle, at times, would
      result in the avatar sliding off towards an edge as if atop a
      squished cone.
* Also updates ShapeInfo::getType() to return ShapeType as opposed to int
    * Auditing calls showed that majority of places were comparing against ShapeType
    * ShapeType::_type is a ShapeType so returning the type explicitly
      is more consistent.
        * ShapeInfo file houses ShapeType enum so any file aware of ShapeInfo is aware of
          ShapeType enumeration.
* entity::Quad defaults to SHAPE_TYPE_ELLIPSOID
    * Like entity::Shape::Torus, entity::Shape::Quad is currently unsupported within
      GeometryCache::buildShapes.
    * Also it appears that a Quad shape can't be created within world via the creation menu.
        * There's no explicit option at present to create one.
        * Trying subvert the Cube/Box creation option to generate one results in an enforced
          stubby box as opposed to a quad.
    * Given the aforementioned points, entity::Shape::Quad will default to
      SHAPE_TYPE_ELLIPSOID as opposed to SHAPE_TYPE_BOX.
        * Added Todo regarding the shape being unsupported along with a notation to create
          a special ShapeType, SHAPE_TYPE_QUAD, for it should it be added in the future.
* Adds some comments and has some minor clean up.

Reviewed-by: Leander Hasty <leander@1stplayable.com>

Changes Committed:
	modified:   interface/src/Application.cpp
	modified:   interface/src/Util.cpp
	modified:   interface/src/Util.h
	modified:   libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
	modified:   libraries/entities/src/ShapeEntityItem.cpp
	modified:   libraries/entities/src/ShapeEntityItem.h
	modified:   libraries/physics/src/ShapeFactory.cpp
	modified:   libraries/render-utils/src/GeometryCache.cpp
	modified:   libraries/render-utils/src/GeometryCache.h
	modified:   libraries/shared/src/ShapeInfo.cpp
	modified:   libraries/shared/src/ShapeInfo.h
	modified:   tests/gpu-test/src/TestInstancedShapes.cpp
2017-10-24 14:16:17 -04:00
Seth Alves
f2cb5d4aff clean-up concept of puffed queryAACube 2017-10-19 13:19:13 -07:00
Seth Alves
f75e59c0a6 keep grabbed and worn entities from spamming entity-server 2017-10-19 13:18:37 -07:00
Bradley Austin Davis
e42068f681 Merge branch 'master' into android_new 2017-09-26 14:31:29 -07:00
Cain Kilgore
0d33976035 Real time changes 2017-09-22 00:38:30 +01:00
Cain Kilgore
45f79b4341 Small fix 2017-09-21 00:00:24 +01:00
Cain Kilgore
322b7fc060 Cleanup from Merge 2017-09-20 23:37:33 +01:00
Cain Kilgore
f06c04e1b0 Fixed things 2017-09-20 23:24:56 +01:00
Cain Kilgore
796e9e7ab3 Fixed things 2017-09-20 23:23:30 +01:00
Cain Kilgore
4d904bd5ce Changed naming of avatarGrav 2017-09-20 18:43:16 +01:00
Cain Kilgore
506226ead0 Merge branch 'master' into 21542 2017-09-20 18:22:34 +01:00
Bradley Austin Davis
bc4193f276 Merge branch 'master' into android_new 2017-09-19 14:27:31 -07:00
Bradley Austin Davis
b93e91b9f3 New android toolchain 2017-09-19 13:45:12 -07:00
Cain Kilgore
c2e342ddac Gravity Implementation 2017-09-15 06:03:56 +01:00
Cain Kilgore
72ca62c4af Initial Commit - more to do. 2017-09-14 00:25:11 +01:00
Dante Ruiz
fec8482b69 Merge branch 'master' of github.com:highfidelity/hifi into feature/ant-man 2017-09-05 16:26:51 -07:00
Seth Alves
41b51804dc fix comment 2017-08-30 17:53:55 -07:00
Seth Alves
3f0a95d8db remove unneeded line 2017-08-30 17:53:20 -07:00
Seth Alves
ca86ce59c2 fix a bug that cuased dynamic children to wink in and out and then vanish 2017-08-30 17:44:42 -07:00
Anthony J. Thibault
573985c7c9 Merge branch 'master' into feature/ant-man 2017-08-28 09:27:04 -07:00
Anthony J. Thibault
4f830cf1dc Calculate jump speed based on canonical jump height. 2017-08-25 15:34:51 -07:00
Brad Davis
e817d3ced4 Threaded rendering & entity rendering refactor 2017-08-24 13:34:34 -07:00
Anthony J. Thibault
cd6d2173cc Bug fix for follow rotation of CharacterController 2017-08-21 18:09:58 -07:00
Anthony J. Thibault
8e56404c40 Fixes for flying and rotation re-centering in wikiplanet 2017-08-21 17:42:25 -07:00
Anthony J. Thibault
da20eac995 Bug fix for deadlock between EntitySimulation and EntityItem locks.
This is a classic deadlock between the main thread and the OctreeProcessor network thread.
On the main thread, the EntitySimulation lock is taken before the EntityItem read lock is taken.
On the network thread, the EntityItem write lock is taken before the EntitySimulation lock is taken.

To work around this issue the network thread no longer takes the EntitySimulation lock when calling
PhysicalEntitySimulation::addDynamic().  Instead, a fine grained lock around the EntitySimulation's dynamic lists
is used instead.
2017-08-21 17:14:49 -07:00
Andrew Meadows
e465186511 Merge pull request #11048 from 1P-Cusack/21389
WL21389 PR1:  Representation of collision shapes need updating (details below).
2017-08-03 09:04:31 -07:00
Anthony Thibault
8a87ebd2a8 Merge pull request #11036 from AndrewMeadows/walkabout
fix bugs preventing avatar from walking on spherical planet
2017-08-01 16:36:35 -07:00
LaShonda Hopper
ef1e426273 [WL21389] Some code and todo cleanup in prep for PR1.
Changes to be committed:
	modified:   libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
	modified:   libraries/entities/src/ShapeEntityItem.cpp
	modified:   libraries/physics/src/ShapeFactory.cpp
	modified:   libraries/shared/src/ShapeInfo.cpp
2017-07-25 15:27:02 -04:00
Leander Hasty
d155c02640 [WL21389] wip and modifications based on comments
https://github.com/highfidelity/hifi/pull/11024#pullrequestreview-51611518

Cleans up tabs, moves new functionality out of ShapeFactory directly to
RenderableShapeEntityItem's computeShapeInfo override, begins to break down
where we will need pointlists.

Still need to determine how rotation is handled for pointlists, and check
for axis alignment on cylinders before deciding on a shape.

Changes to be committed:
	modified:   libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
	modified:   libraries/entities-renderer/src/RenderableShapeEntityItem.h
	modified:   libraries/entities/CMakeLists.txt
	modified:   libraries/entities/src/ShapeEntityItem.cpp
	modified:   libraries/entities/src/ShapeEntityItem.h
	modified:   libraries/physics/src/ShapeFactory.cpp
	modified:   libraries/physics/src/ShapeFactory.h
	modified:   libraries/shared/src/ShapeInfo.cpp
	modified:   scripts/developer/tests/basicEntityTest/entitySpawner.js
2017-07-25 15:20:35 -04:00
LaShonda Hopper
75403124b6 [WL21389] Addresses physics library dependency and has some other fixes (details below).
* Addresses physics library dependency by moving computeShapeInfo override from
ShapeEntityItem (which is within Entities Library) to RenderableShapeEntityItem
(which is in Entities-Renderer Library).
** Entities-Renderer library already links against the physic library.
** Per discussion with Andrew Meadows: In order to ShapeEntityItem to be
utilized the library dependency between the Entity and Physics library
would need to be resolved to avoid the cyclical reliance which isn't in
the scope of this ticket.
* Updates shapeSpawner test script from the default clone of basicEntityTest\entitySpawner.js
** Objects now have a finite lifetime
** Script now cleans up the objects created when the script ends
** Also moved some adjustable properties out into var aliases at the top of the
file for easier/less error prone tweaking. Should probably add one for the shapeType.
* Fixes some issues with validateShapeType helper function
* Removed naive attempt at including physics library within entities library.
* Transferred some todos from notes
* Fixed some formatting

NOTE(s):
  This compiles and runs.  Cylinder is spawned and treated as CYLINDER_Y.

TODO(s):
* Add tweakable var for shapeType within shapeSpawner.js
* Vet and verify other shapes.
* Add in edge case handling.
* Add in support for other shapes to ShapeInfo infrastructure.

Changes to be committed:
	modified:   libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
	modified:   libraries/entities-renderer/src/RenderableShapeEntityItem.h
	modified:   libraries/entities/CMakeLists.txt
	modified:   libraries/entities/src/ShapeEntityItem.cpp
	modified:   libraries/entities/src/ShapeEntityItem.h
	modified:   libraries/physics/src/ShapeFactory.cpp
	modified:   libraries/shared/src/ShapeInfo.cpp
	modified:   scripts/developer/tests/basicEntityTest/shapeSpawner.js
2017-07-25 14:43:39 -04:00
LaShonda Hopper
5bc38bd7f0 [WL21389] Collision Shapes need to be updated (details below).
Revised approach involves creating a helper function within ShapeFactory to aid
in devising the ShapeType to be used by an ShapeEntityItem for collision.  The
ShapeFactory is currently doing this for creating the actual Bullet Library
collision shapes.

ShapeEntityItem overrides its virtually inherited computeShapeInfo which
in turn calls the new ShapeFactory helper function.

ShapeEntityItem has a new memvar _collisionShapeType to cache its actual
ShapeType used by the physics system.  This memvar is returned via the getShapeType
accessor which is expected to return an object's ShapeType.

Note(s):
    This is similar to the original approach save translation between entity::Shape and ShapeType
    isn't tied to the EntityItemProperties shapeTypeNames or shapeType. This approach more
    directly solves the issue of getting the actual ShapeType used by the time it's needed
    to determine the bullet collision object type created when initializing the physic information.

    Translation of the ShapeEntityItem's entity::Shape to its ShapeType is handled by
    ShapeFactory which handles creating the bullet collision objects when setting up
    physics on the ShapeEntityItems.

Known Issue(s):
    This doesn't compile.  It appears that the Entity Library needs to know about
    the Physics Library.  The naive attempt at providing that link failed to resolve
    all compilation issues.

    Current Error:
    C1083: Cannot open include file: btBulletDynamicsCommon.h:
    No such file or directory (C:\projects\cusack\libraries\entities\src\ShapeEntityItem.cpp)
       C:\projects\cusack\libraries\physics\src\ShapeFactory.h	15	1	entities

	modified:   libraries/entities-renderer/src/RenderableShapeEntityItem.cpp
	modified:   libraries/entities/CMakeLists.txt
	modified:   libraries/entities/src/ShapeEntityItem.cpp
	modified:   libraries/entities/src/ShapeEntityItem.h
	modified:   libraries/physics/src/ShapeFactory.cpp
	modified:   libraries/physics/src/ShapeFactory.h
	modified:   libraries/physics/src/ShapeInfo.cpp
	modified:   scripts/developer/tests/basicEntityTest/entitySpawner.js
	new file:   scripts/developer/tests/basicEntityTest/shapeSpawner.js
2017-07-25 14:43:07 -04:00
Andrew Meadows
4994283247 remove unnecessary state check 2017-07-24 16:00:13 -07:00
Andrew Meadows
a8dac0cb79 don't send constant updates for grabbed objects 2017-07-20 15:45:50 -07:00
Andrew Meadows
d9c6126000 more descriptive names for methods that do stuff
also: changes to dimensions will trigger update to QueryAACube
2017-07-19 13:33:32 -07:00
Andrew Meadows
2299bb7718 supply minimum shape rather than null 2017-07-06 10:37:44 -07:00
Seth Alves
428dc81083 Merge pull request #10696 from AndrewMeadows/avoid-ownership-bid-race
ignore remote update younger than recent ownership bid
2017-06-20 10:42:54 -07:00
Brad Davis
a69cf31f4b PR feedback and cmake fixes 2017-06-16 16:59:58 -07:00
Andrew Meadows
b105ad8338 measure linear velocity of tractor position 2017-06-16 16:55:00 -07:00
Howard Stearns
a0ea306aed cleanup, and include missing allowBackface parameter 2017-06-04 07:55:23 -07:00
Howard Stearns
c48b729527 Merge branch 'master' of https://github.com/highfidelity/hifi into do-not-get-stuck-in-floor 2017-06-02 18:05:20 -07:00
Seth Alves
142739eec7 Merge pull request #10602 from AndrewMeadows/simulation-ownership-002
fixes for some simulation ownership problems
2017-06-02 14:23:19 -07:00
Andrew Meadows
29a05d7eb4 bid immediately when creating new entity
also clear EntityMotionState::_numInactiveUpdates on new ownership
2017-06-01 17:39:21 -07:00
Andrew Meadows
74827fc4c8 recently moved static objects added to changelist
since static objects are not active this will make the interface
release ownership of recently changed static objects
2017-06-01 17:39:21 -07:00
Andrew Meadows
e34f979ed9 add EntityMotionState::isLocallyOwned() for cleaner logic 2017-06-01 17:39:21 -07:00
howard-stearns
6b2e4c5abc zaru stuff 2017-06-01 17:08:22 -07:00
howard-stearns
1e1dd3a633 checkpoint with working detector 2017-05-31 17:10:37 -07:00
Andrew Meadows
971855e6bf add asserts to catch dangling pointers sooner 2017-05-25 14:29:14 -07:00
Andrew Meadows
c22e4ef883 rename method to clarify where it is called 2017-05-25 13:48:19 -07:00
Andrew Meadows
5378cbead6 make ObjectMotionState dtor virtual 2017-05-25 13:47:03 -07:00
Brad Hefta-Gaub
23af6294ab Merge pull request #10521 from sethalves/fix-locked-in-motion
if something is locked but in motion, make it kinematic rather than static
2017-05-25 08:32:30 -07:00
Seth Alves
3825830fac if something is locked but in motion, make it kinematic rather than static 2017-05-22 14:07:53 -07:00
samcake
f8c291ee78 Merge branch 'master' of https://github.com/highfidelity/hifi into ambient 2017-05-22 10:56:00 -07:00
Seth Alves
4142d8c686 actions shouldn't change locked entities 2017-05-21 11:05:18 -07:00
Sam Cake
321f74c305 Merge branch 'master' of https://github.com/highfidelity/hifi into ambient 2017-05-20 18:12:58 -07:00
Seth Alves
8f38ea8c6a force locked entities to be static in bullet 2017-05-20 11:54:42 -07:00
samcake
c449229850 Cleaned up the counters for memory 2017-05-19 17:52:56 -07:00
Andrew Meadows
09433a93ba Merge pull request #10477 from AndrewMeadows/correct-avatar-mass
More correct avatar mass
2017-05-17 16:22:06 -07:00
Seth Alves
9b1fe60b7c suppress frequest log-spam from constraints. 2017-05-17 11:55:31 -07:00
Andrew Meadows
d065b569d3 support for variable avatar mass by size 2017-05-16 16:03:51 -07:00
Andrew Meadows
9b3754c2ee remove unused API from ObjectDynamic and friends 2017-05-15 22:13:03 -07:00
Andrew Meadows
9e08dadaf4 Remove ObjectActionSpring 2017-05-15 22:11:42 -07:00
Seth Alves
fcc5e12211 redelete these 2017-05-12 13:19:15 -07:00
Seth Alves
f40c7bde71 Merge pull request #9 from AndrewMeadows/motor-action
remove unused parameters from Hinge and ConeTwist constraints
2017-05-12 13:14:02 -07:00
Seth Alves
630d95a812 fix constraint import some more 2017-05-12 13:03:51 -07:00
Andrew Meadows
10d058af02 remove unused parameters from ObjectConstraintConeTwist 2017-05-12 12:07:34 -07:00
Andrew Meadows
18b1bb8b7f remove unused parameters from ObjectConstraintHinge 2017-05-12 12:04:08 -07:00
Seth Alves
bc6fb182eb pull out motor action, fix import of slider and cone-twist constraints 2017-05-12 10:32:28 -07:00
Seth Alves
80e6edda0c code review 2017-05-11 10:13:15 -07:00
Seth Alves
b285a582bd oops 2017-05-09 10:37:45 -07:00
Seth Alves
4f24a7618a cleanups 2017-05-09 10:23:04 -07:00
Seth Alves
1e1968357a Merge branch 'master' of github.com:highfidelity/hifi into motor-action 2017-05-09 09:24:50 -07:00
Seth Alves
55056e730a guard slider and cone-twist constraints against zero-length axisq 2017-05-08 17:02:37 -07:00
Seth Alves
de589a32f3 clone spring action into one called tractor and use tractor is most places. this frees us to fix the math in spring so that it's actually a spring 2017-05-08 16:36:51 -07:00
Seth Alves
94dfbc81f3 entity export/import involving constraints now works 2017-05-08 15:44:31 -07:00
Andrew Meadows
e44c2c8da3 init zero gravity to agree with init hover state 2017-05-08 12:47:32 -07:00
Seth Alves
fd238f5438 working on fixing action/constraint export/import 2017-05-08 11:02:35 -07:00
Andrew Meadows
d9e893ac21 minior optimization/cleanup 2017-05-08 11:02:11 -07:00
Andrew Meadows
0f643b7d66 add check to avoid divide by zero 2017-05-08 10:59:15 -07:00
Andrew Meadows
f00a3cafb6 cleanup logic to be more readable 2017-05-08 10:52:54 -07:00
Seth Alves
7a1a9d6496 start on code to remap constraint IDs during import 2017-05-07 19:42:04 -07:00
Seth Alves
b2ccc33a79 Merge branch 'master' of github.com:highfidelity/hifi into motor-action 2017-05-05 14:52:07 -07:00
Andrew Meadows
2bfbb63906 remove unused variable 2017-05-05 09:37:01 -07:00
Andrew Meadows
8ed93783bd fix step up velocity calculation 2017-05-05 09:37:01 -07:00
Andrew Meadows
cd7be46b70 tweak threshold for minimum stepheight 2017-05-05 09:37:01 -07:00
Andrew Meadows
6e8d90e3b6 restore clear of follow accumulators 2017-05-05 09:37:01 -07:00
Andrew Meadows
fe401c7488 improved management of collisionless avatar state 2017-05-05 09:37:00 -07:00
Andrew Meadows
95a4bb9ef4 fix transition height from hover to stand 2017-05-05 09:35:49 -07:00
Andrew Meadows
e449c48888 remove one more line of cruft 2017-05-05 09:35:49 -07:00
Andrew Meadows
d34b667e82 remove kinematic character controller implemention 2017-05-05 09:35:49 -07:00
Andrew Meadows
94ee6d6838 fix driving motion of collisionless avatars 2017-05-05 09:35:49 -07:00
Andrew Meadows
e21bd7a67a help avatar walk up steps 2017-05-05 09:35:49 -07:00
Andrew Meadows
a31a861e19 fix typo: physcis --> physics 2017-05-05 09:33:50 -07:00
Seth Alves
c693687927 react to very small vectors instead of just zero-length ones 2017-05-03 20:23:10 -07:00
Seth Alves
f867a8e718 guard against bad hinge-constraint settings 2017-05-03 20:12:42 -07:00
Seth Alves
a259d00b63 Merge pull request #10332 from sethalves/bullet-constraints-5
Bullet constraints
2017-05-03 16:30:34 -07:00
Seth Alves
3ec3005c6d code review 2017-05-01 15:32:17 -07:00
Seth Alves
598937df89 first try at angular-velocity setting action 2017-05-01 15:26:17 -07:00
Seth Alves
7f69bdecb2 first try at angular-velocity setting action 2017-05-01 07:06:21 -07:00
Seth Alves
1b67a8b251 cleanups 2017-04-30 12:23:34 -07:00
Seth Alves
dabec586ec if spring is linked to another entity which we can't find, disable the spring 2017-04-30 11:01:34 -07:00
Seth Alves
c9dfebb713 allow spring action to have targets relative to another entity 2017-04-30 10:58:58 -07:00
Seth Alves
7ce0ef2ec4 fix spring action so that it can be linear or rotational or both 2017-04-30 10:04:07 -07:00
Seth Alves
8f2fc24885 remove motors from constraints 2017-04-29 15:46:04 -07:00
Seth Alves
41f699ec9b fix hinge limits 2017-04-29 14:28:56 -07:00
Seth Alves
e52c94895e remove motor from hinge. fix hinge limits 2017-04-29 14:18:14 -07:00
Seth Alves
4c4e0dffcc bullet cone-twist constraint 2017-04-29 12:30:12 -07:00
Seth Alves
6623028d71 ball-and-socket constraint 2017-04-29 08:35:55 -07:00
Andrew Meadows
32c367b644 use 'using' rather than 'typedef' 2017-04-28 10:18:15 -07:00
Seth Alves
21df08aa88 set limits when slider constraint is first created 2017-04-27 14:02:38 -07:00
Andrew Meadows
2441536de3 remove Avatar dependency on AvatarMotionState 2017-04-27 13:16:49 -07:00
Andrew Meadows
aceac12398 use 'using' instead of 'typedef' 2017-04-27 13:11:57 -07:00
Seth Alves
b196dd082b expose bullet slider constraint to javascript 2017-04-27 07:56:35 -07:00
Seth Alves
b65b34a81b try to allow axisInA to be adjusted on the fly 2017-04-22 20:45:23 -07:00
Seth Alves
f172730a38 try to allow axisInA to be adjusted on the fly 2017-04-22 20:09:14 -07:00
Seth Alves
25070c3bca try not bringing motor target into -PI,PI range 2017-04-22 17:56:40 -07:00
Seth Alves
e9461f812d don't run motor for other's hinge 2017-04-22 17:09:26 -07:00
Seth Alves
59950236d3 attempt to make hinge motor work better 2017-04-22 16:22:00 -07:00
Seth Alves
21ca767b7c remove setPosition and setRotation for actions because they were never finished and never used. 2017-04-18 11:59:16 -07:00
Seth Alves
fbd4677a9a add a way to set hinge-constraint motor speed from javascript 2017-04-15 21:10:02 -07:00
Seth Alves
b4ff3a8691 don't destroy and recreate constraints when reinserting rigid body 2017-04-15 21:08:59 -07:00
Seth Alves
d42970d480 fix hinge-constraint constructors to use otherAxis 2017-04-15 08:51:08 -07:00
Seth Alves
f08fecbfa7 make sure new constraint data gets transmitted over network 2017-04-14 16:25:27 -07:00
Seth Alves
708008d8a5 cleanups 2017-04-14 13:43:48 -07:00
Seth Alves
07b23b8235 expose other hinge-constraint parameters to javascript 2017-04-14 13:28:25 -07:00
Seth Alves
d0144f4110 avatar-action-far-grab works now 2017-04-14 12:44:54 -07:00
Seth Alves
b1dc5be316 make far-grab it's own action (which is just like spring) in order to avoid bootstrapping own avatar 2017-04-14 11:48:06 -07:00
Seth Alves
2dab3069da fix bug that was causing spring action to cause constant re-insertion of its rigidbody into bullet. store UUIDs rather than shared pointers in _objectDynamicsByBody so that refcounting works right and actions get their destructors called. 2017-04-14 11:06:40 -07:00
Seth Alves
f5a5369055 attempt to remove dynamics associated with a rigid-body before removing the rigid-body 2017-04-14 07:06:53 -07:00
Seth Alves
52aee63e05 keep track of objectDynamics per rigidBody 2017-04-14 06:08:58 -07:00
Seth Alves
afa8fc161b allow hinge constraint between two entities 2017-04-13 15:37:28 -07:00
Seth Alves
9f252f04e7 cleanups 2017-04-12 07:25:23 -07:00
Seth Alves
53cb192af1 fixed names of pivot and axis 2017-04-12 07:22:27 -07:00
Seth Alves
cc77fce95f hinge is sort-of working 2017-04-12 07:12:05 -07:00
Seth Alves
2b0315645c actions work again 2017-04-11 21:11:03 -07:00
Seth Alves
74c0a70cb0 rename base action classes to dynamics, start on constraints 2017-04-11 20:39:13 -07:00
Seth Alves
e1e51614d9 don't hang loop if entity isDead 2017-03-24 11:16:54 -07:00
Brad Hefta-Gaub
bc5d7d8698 Merge pull request #9851 from AndrewMeadows/simulation-ownership-2
zero velocity of deactivated dynamic entities
2017-03-20 10:20:11 -07:00
Andrew Meadows
bde2222dfd actually use worldTrans 2017-03-10 18:30:56 -08:00
Andrew Meadows
9c9eb87925 sync RigidBody on deactivation 2017-03-10 12:55:16 -08:00
Andrew Meadows
2c141fd555 more correct comment 2017-03-10 09:18:29 -08:00
Andrew Meadows
a16760278e remove debug code 2017-03-09 17:58:53 -08:00
Andrew Meadows
be3012181f force local deactivation on remote deactivation 2017-03-09 17:53:17 -08:00
Andrew Meadows
8ddcae2a15 restore transform of deactivated entities 2017-03-09 17:26:53 -08:00
Andrew Meadows
d4abdcb6c8 comments, namechange, and temporary debug code 2017-03-09 17:26:53 -08:00
Andrew Meadows
ffe69acb5c fix rare physics crash 2017-03-08 19:26:12 -08:00
Andrew Meadows
d749c0c8be use fabsf() rather than fabs() 2017-03-06 15:50:32 -08:00
Andrew Meadows
10b3e7fc67 sphere shapeType for models means 'sphere' 2017-03-06 15:14:51 -08:00
Chris Collins
194fd925cf Merge pull request #9609 from sethalves/tablet-ui-fix-equipping
don't send AVATAR_SELF_ID over wire
2017-02-06 16:56:11 -08:00
Seth Alves
2ea07390c8 when the parentID is changed by a network update, set physics flags 2017-02-06 12:10:26 -08:00
howard-stearns
dacaa3df1d Send new entity physics packet from physics simulation, accept in server,
and make it go through filter (when supplied) regardless of lock rights.
2017-02-06 11:12:18 -08:00
Seth Alves
ab954412c1 if an entity has an avatar parent but ends up in EntityMotionState::setWorldTransform, ignore the update from bullet 2017-02-06 09:50:48 -08:00
Seth Alves
22f9fc7061 don't call stepKinematicMotion on kinematic entities when they are children of avatars 2017-02-03 16:36:06 -08:00
Seth Alves
c7200d2d3a make hasAncestorOfType understand AVATAR_SELF_ID 2017-02-03 16:14:15 -08:00
Seth Alves
174c674fd3 don't call stepKinematicMotion on kinematic entities 2017-02-03 15:50:59 -08:00
Seth Alves
6b44f62982 don't honor gravity in simple extrapolation on entities equipped by others 2017-02-02 14:20:21 -08:00
Thijs Wenker
174a7ad5bd Optimizations and style fixes from code review 2017-01-31 22:54:58 +01:00
Seth Alves
7c2957cfa7 merge from upstream 2017-01-31 08:57:36 -08:00
Andrew Meadows
aa8e7d27db move depth filtering closer to source 2017-01-30 13:21:23 -08:00
Andrew Meadows
b5537304a3 more correct CONTINUE collision event filter 2017-01-30 13:21:23 -08:00
Andrew Meadows
2541bfb1a8 only create collision events for owned entities 2017-01-30 13:21:23 -08:00
Andrew Meadows
2162a364a9 minor cleanup 2017-01-30 13:21:23 -08:00
Andrew Meadows
54b4612ee3 fix for missed START collision events 2017-01-30 13:18:26 -08:00
Seth Alves
c317ba8054 merge from upstream 2017-01-25 15:57:53 -08:00
Atlante45
5db37fff95 More entity script server work 2017-01-17 13:47:45 -08:00