Commit graph

735 commits

Author SHA1 Message Date
Ryan Huffman
6817cf9db4 Fix entity properties sometimes being resent
When writing entity properties to a packet, we start off with a list of
requested properties (`requestedProperties`) and keep track of which properties
didn't fit (`propertiesDidntFit`) the packet, which is intialized to
requestedProperties. As we pack the properties, we remove them from
propertiesDidntFit if they didn't need to be written or were able to be
packed. At the end we store propertiesDidntFit, and use it in the future
as our requestedProperties when we try to pack more data into a packet.

The bug: because of the order in which propertiesDidntFit is
initialized, it ended up always being the list of all properties for
that entity. This typically wasn't an issue because we usually go
through and try to append all of the properties, and if we don't need to
append them (because they aren't in requestedProperties)
we remove them from our propertiesDidntFit list. When we
don't have enough remaining space in the current packet for even the
entity header, which is fairly small, we don't bother trying to append
any of the properties. When this happens, propertiesDidntFit contains
the full list of properties, which we save for the next pass through the
entity, and use as our requestedProperties, causing us to resend entity
data again. In the worst case we never end up sending all of the
entity's data.
2017-07-25 10:59:03 -07:00
Andrew Meadows
17323ba42a always update the bounding box 2017-07-21 10:25:03 -07:00
Andrew Meadows
a8dac0cb79 don't send constant updates for grabbed objects 2017-07-20 15:45:50 -07:00
Andrew Meadows
d88d7dda2b changed dimensions flag entity for new queryAACube 2017-07-20 08:19:59 -07:00
Andrew Meadows
9ca3ec4313 faster computation of entity bounding cube 2017-07-19 13:35:34 -07:00
Andrew Meadows
c7ec82f98a use local copy of _element for thread safety 2017-07-13 13:30:57 -07:00
Brad Davis
8130a91b8c Cleanup entity dependencies 2017-06-27 19:15:49 -07:00
Andrew Meadows
8d19395b0a ignore remote update younger than recent bid 2017-06-14 16:04:52 -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
c56a6c44f8 minor formatting fix 2017-06-01 17:39:21 -07:00
Brad Hefta-Gaub
5af95c8fdf Merge pull request #10476 from sethalves/fix-imported-children-querybox
fix up queryAACubes before sending imported entities to server
2017-05-25 08:29:23 -07:00
Seth Alves
381de7a1e2 tabs 2017-05-21 08:42:53 -07:00
Seth Alves
c68efc2ed0 treat locked like other properties that affect simulation 2017-05-21 08:29:35 -07:00
Seth Alves
2512b39848 don't dirty motion-type if lock value isn't actually changing 2017-05-20 14:14:33 -07:00
Seth Alves
8f38ea8c6a force locked entities to be static in bullet 2017-05-20 11:54:42 -07:00
Seth Alves
a442181859 remove some redundancy 2017-05-20 08:51:44 -07:00
Seth Alves
5c93dbd20d be more careful about fixing up entities which arrived before their parents 2017-05-19 13:48:29 -07:00
Seth Alves
735e4b7d05 trying to get child collision hulls to be in the right place after import 2017-05-19 10:59:59 -07:00
Seth Alves
77ce8a19cf call entityChanged after settings flags 2017-05-19 10:11:02 -07:00
Seth Alves
0c12baa258 call entityChanged after settings flags 2017-05-19 09:57:42 -07:00
Seth Alves
1b0eeb9c2c try harder to put things in place when their parent entities are discovered 2017-05-18 14:35:39 -07:00
Seth Alves
ef556fae9b when an entity's parent wasn't known and then becomes known, patch up the rigid-body and the render-item bounds 2017-05-18 14:13:33 -07:00
Seth Alves
ec02887ae6 attempt to get imported entities into the correct octree-element 2017-05-18 13:20:44 -07:00
Seth Alves
b05cb4af3b fix nan 2017-05-17 20:51:34 -07:00
Andrew Meadows
97ed719506 cap scripted linear and angular velocity inputs 2017-05-17 10:40:45 -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
74c0a70cb0 rename base action classes to dynamics, start on constraints 2017-04-11 20:39:13 -07:00
Brad Davis
54200c03a7 Fixing deadlock 2017-04-04 13:53:49 -07:00
Brad Davis
03c6275268 more thread safety 2017-04-04 10:50:54 -07:00
Brad Davis
172fab6789 Thread safety for property getter/setters on entities 2017-04-04 10:50:53 -07:00
Andrew Meadows
a16760278e remove debug code 2017-03-09 17:58:53 -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
Seth Alves
bc5f563f57 make _parentID and _parentJointIndex private to avoid accidental direct access 2017-02-12 11:37:29 -08:00
Seth Alves
aaefc550f0 avoid bootstrapping self with something that has someone else as simulation owner 2017-02-06 14:16:47 -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
Seth Alves
81bf5ee655 another AVATAR_SELF_ID adjustment 2017-02-03 16:47:03 -08:00
Anthony J. Thibault
6bef9e888b Merge branch 'master' into bug-fix/tablet-ui-no-domain 2017-02-02 17:21:20 -08:00
howard-stearns
6f4441028d Merge branch 'master' of https://github.com/highfidelity/hifi into accept-forced-physics-values 2017-02-01 09:41:08 -08:00
Thijs Wenker
174a7ad5bd Optimizations and style fixes from code review 2017-01-31 22:54:58 +01:00
Anthony J. Thibault
e2e19884bb Tablet should work even when not connected to any domain.
handControllerGrab.js and WebTablet.js now parents objects to the
AVATAR_SELF_ID parentID, instead of using MyAvatar.sessionUUID, which
is unavailable when not connected to any domain.

I removed several early returns handControllerGrab.js that prevented
grabbing from working if MyAvatar.sessionUUID was invalid.

There were places in the EntityItem.cpp and EntityScriptingInterface.cpp
C++ that would log an error if parentID was set to AVATAR_SELF_ID.
This was to prevent AVATAR_SELF_ID from ever going over the network.
Instead, we now prevent this by replacing all outgoing references of
AVATAR_SELF_ID with the sessionID of the current node.
2017-01-31 13:52:12 -08:00
howard-stearns
18f8c2b866 comment 2017-01-31 13:31:33 -08:00
howard-stearns
8d8b338c66 dry up custom setters, per code review 2017-01-31 12:07:48 -08:00
Thijs Wenker
3608998877 use dedicated bool rather than unreliable dirtyFlags to determine if the entityItem had ever bid for simulation ownership 2017-01-31 21:01:03 +01:00
Thijs Wenker
e445af74aa Merge branch 'master' of https://github.com/highfidelity/hifi 2017-01-31 20:39:39 +01:00
howard-stearns
1ddc804e10 Merge branch 'master' of https://github.com/highfidelity/hifi into accept-forced-physics-values 2017-01-31 10:58:49 -08:00
Thijs Wenker
c3f9663ab0 - Fix for simulation owned entities moving to 0,0,0 after cache reload
- Fix for simulation priority, use SCRIPT_GRAB_SIMULATION_PRIORITY in EntityItem::grabSimulationOwnership()
2017-01-31 01:25:59 +01:00
howard-stearns
fe8fe816f4 accept forced physics results from entity server (e.g., when filtered) 2017-01-30 16:14:40 -08:00
Seth Alves
fa61bbe2a6 Merge branch 'master' of github.com:highfidelity/hifi into tablet-ui 2017-01-26 18:21:39 -08:00
Howard Stearns
a1afbe7d5e Merge branch 'master' of https://github.com/highfidelity/hifi into edit-entity-filter 2017-01-25 19:16:29 -08:00
Seth Alves
c317ba8054 merge from upstream 2017-01-25 15:57:53 -08:00
Stephen Birarda
304618f51d cleanup comment and scoping for server script URL changes 2017-01-25 12:39:41 -08:00
Stephen Birarda
f1b4f79ad9 a simple hack to accept newer server scripts 2017-01-25 12:39:41 -08:00
howard-stearns
7b986dcac6 works, but removes an optimization we'd like to keep 2017-01-20 17:03:52 -08:00
Stephen Birarda
33cde412b1 make getJSONParameters thread-safe 2017-01-18 17:49:54 -08:00
Stephen Birarda
a1ad496772 handle match on non-default serverScripts property during entity send 2017-01-18 14:58:36 -08:00
Stephen Birarda
3556379034 leverage JSON filter changes to OctreeQuery in EntityServer 2017-01-18 14:58:36 -08:00
Ryan Huffman
b0c2a9d614 Add serverScripts entity property 2017-01-17 14:47:06 -08:00
Seth Alves
a47aaea37a don't bootstrap self with an avatar hold action 2017-01-12 10:12:45 -08:00
Seth Alves
4a29cce584 adjust when USER_COLLISION_GROUP_MY_AVATAR is auto-disabled 2017-01-10 06:17:40 -08:00
Seth Alves
35577f49d0 change the test for when MY_AVATAR collisions are short-circuited 2017-01-09 17:00:39 -08:00
Seth Alves
ad45bbf5ba set DIRTY_COLLISION_GROUP flag when parentID changes 2017-01-09 16:45:54 -08:00
Seth Alves
45a26d599f if something is a child of the local avatar, never let it collide with MY_AVATAR 2017-01-09 16:40:28 -08:00
Seth Alves
01ff3f14b6 re-evaluate an entities in-bullet status when parentID changes 2017-01-09 15:28:05 -08:00
Seth Alves
6fe35ac0da use smart pointers to avoid leaking EntityTreeElementExtraEncodeData 2016-12-12 16:04:41 -08:00
Faye Li Si Fi
0556661d13 getting rid of uneccessary flag, fix formatting, and getting it to work yay 2016-12-07 15:40:21 -08:00
samcake
a05e42138c Merge branch 'master' of https://github.com/highfidelity/hifi into hdr 2016-11-14 09:58:12 -08:00
Seth Alves
850361f222 lastEditedBy property for entities 2016-11-10 15:26:28 -08:00
samcake
b563e280e4 Commuting the LIghtEntityItem changes correctly to the LightRenderItem 2016-08-31 13:55:41 -07:00
Andrew Meadows
19cd4648ad scale collision render mesh correctly 2016-08-24 22:26:56 -07:00
SamGondelman
ccca6d935f don't fade after physics kick in 2016-08-12 14:35:22 -07:00
SamGondelman
36d9f92101 performance optimization to minimize calling usecTimestampNow 2016-08-09 13:10:02 -07:00
Seth Alves
5f6e608207 don't overwrite physical properties with those from the entity during editEntity -- only set those that the script didn't. 2016-07-19 11:23:21 -07:00
Andrew Meadows
8009d23f70 more STATIC_MESH and dynamic overlap prevention 2016-06-22 15:20:45 -07:00
Andrew Meadows
702e83ba6a prevent incompatible entity properties combos 2016-06-21 14:03:21 -07:00
Brad Hefta-Gaub
7ed35399e9 make the application of redundant physics update idempotent to improve action glitches 2016-06-02 18:01:23 -07:00
Seth Alves
419c744bd4 Merge branch 'master' of github.com:highfidelity/hifi into avatar-entities-3 2016-05-19 09:49:18 -07:00
Atlante45
38f74c1843 Remove the last of the glow level 2016-05-14 14:49:31 -07:00
Seth Alves
ac506dc4b7 where needed, copy clientOnly into properties before calling queueEditEntityMessage 2016-05-11 12:46:16 -07:00
Seth Alves
b761ecf44f merge from upstream 2016-05-10 08:18:45 -07:00
Andrew Meadows
ffc3123467 Merge pull request #7658 from sethalves/grab-fixes
Grab fixes
2016-05-09 15:30:37 -07:00
Seth Alves
a0771f8ee5 use smart pointers for entity simulations 2016-05-07 09:14:33 -07:00
Atlante45
07adef9465 Fix entities collision sounds 2016-05-05 14:55:28 -07:00
Seth Alves
cd934bab90 set _actionDataDirty when adding an action. 2016-05-05 14:16:13 -07:00
Seth Alves
0c794cac5d Merge branch 'master' of github.com:highfidelity/hifi into grab-fixes 2016-05-05 10:13:07 -07:00
Seth Alves
d76b8f2335 action->locallyAddedButNotYetReceived is unneeded with isMine available 2016-05-05 06:44:52 -07:00
Andrew Meadows
be9a572fb0 fix grab motion glitch on long-ping connections 2016-05-04 16:50:42 -07:00
Seth Alves
91af732516 if we receive an update from the entity-server that doesn't include one of our actions, resend the action data 2016-05-04 16:30:38 -07:00
Seth Alves
9db839bc13 don't allow someone else to delete an action that I own. reset dynamic property when releasing and entity, even if refCount isn't 0 2016-05-04 15:01:00 -07:00
Seth Alves
9e53055d43 parentID and parentJointIndex are now protected by simulation ownership 2016-05-03 15:48:50 -07:00
Andrew Meadows
ba226b9cb4 promote priority immediately when already owned 2016-05-03 13:43:08 -07:00
Seth Alves
1da041de9b don't consume the physics related property changes from the packet that informs us that we are the simulationOwner of an entity 2016-05-02 15:09:08 -07:00
Seth Alves
ae8f502808 keep track of actions we are editing and ignore updates from server for these actions 2016-05-02 14:23:36 -07:00
Andrew Meadows
c686418be0 optimize use of EntityItem::getDimensions() 2016-04-27 10:34:29 -07:00
Brad Hefta-Gaub
8c7ef31636 Merge pull request #7746 from AndrewMeadows/supress-spurious-logs
reduce warnings about truncated kinematic timesteps
2016-04-23 09:34:45 -07:00
Brad Hefta-Gaub
04dab65b59 Merge pull request #7727 from ZappoMan/supportLargeClockSkew
support for larger than 35 minute clock skew
2016-04-23 08:42:38 -07:00
Andrew Meadows
d984ce4792 properly update _lastSimulated for kinematic objs 2016-04-22 17:19:00 -07:00
Andrew Meadows
34d622e498 add warning about truncated kinematic timestep 2016-04-22 13:10:23 -07:00
Andrew Meadows
872622c6f7 fix acceleration of for server-side kinematics 2016-04-22 09:38:43 -07:00
Andrew Meadows
14abb15216 set kinematic accel before stepping 2016-04-22 09:38:43 -07:00
Andrew Meadows
8efb07cfd8 correctg measured acceleration for kinematics 2016-04-22 09:38:43 -07:00
Andrew Meadows
a79f49a5cd don't stop slow kinematic objs when sending updates 2016-04-22 09:38:43 -07:00
Andrew Meadows
ad045bc439 remove second-order term from kinematic motion 2016-04-22 09:38:43 -07:00
Andrew Meadows
3639ffe53e optimize kinematic motion math 2016-04-22 09:38:43 -07:00
Brad Hefta-Gaub
31f9d592e0 support for larger than 35 minute clock skew 2016-04-20 18:42:00 -07:00
Andrew Meadows
a263091c94 fix entity-server crash for out of bounds 2016-04-14 15:23:14 -07:00
Seth Alves
3288bff963 don't flood log with messages about expired actions. also, try to remove such actions 2016-04-13 09:47:07 -07:00
Brad Hefta-Gaub
cc418c615f Merge pull request #7631 from sethalves/parent-equipping-and-platform-hack
treat children of avatars and children of entities differently until velocity handling is fixed
2016-04-10 14:55:03 -07:00
Seth Alves
43f735dd21 avoid loop where bullet moves an entity and then an entity tells bullet that it has moved. 2016-04-09 22:18:43 -07:00
Seth Alves
2aa3e5d418 re-enabled EntityItem::simulateKinematicMotion for things with parents 2016-04-09 09:06:18 -07:00
Seth Alves
5375fdd0f0 don't do simple kinematic simulation on things that have parents 2016-04-06 16:42:14 -07:00
Seth Alves
af05b97c1e put back accidently deleted line. cleanups 2016-04-04 17:31:59 -07:00
Seth Alves
d814d7b35d merge from upstream 2016-04-04 16:32:49 -07:00
Seth Alves
69bb0ebd74 Revert "faster kinematic motion for entities" 2016-04-04 16:11:54 -07:00
Seth Alves
b8587e0711 update collision shapes of entities which are children of avatars 2016-04-04 16:06:53 -07:00
Andrew Meadows
a08ab8e127 restore setFlag in simulateKinematicMotion() 2016-04-04 11:48:45 -07:00
Andrew Meadows
a53cb2e532 use _gravity rather than _acceleration
also tweaks and comments about supporting low gravity
2016-04-04 11:10:50 -07:00
Andrew Meadows
74058ac049 more correct moving test for ballistic kinematics 2016-04-03 19:15:16 -07:00
Andrew Meadows
0830c55bcf getLocalEverything->getLocalTransformAndVelocities 2016-04-01 17:48:56 -07:00
Andrew Meadows
442b52313f faster kinematic motion calculations 2016-04-01 13:14:03 -07:00
howard-stearns
5381be6902 Whitespace 2016-03-29 17:06:19 -07:00
howard-stearns
bcb729eac2 Abstract out globalizeProperties. 2016-03-29 15:21:06 -07:00
howard-stearns
b09b9a4a0a snapshot after using tree from entity item. 2016-03-28 16:58:20 -07:00
Brad Hefta-Gaub
62a56ecbfa fix typos 2016-03-23 17:45:22 -07:00
Seth Alves
1e02c8d9d3 minimize diff 2016-03-17 17:28:36 -07:00
Seth Alves
cbfde2032c fix bug which caused observers of a parenting grab to not see the entity in the grabber's hand 2016-03-17 17:09:32 -07:00
ZappoMan
1a17de6dbb reduce log spam 2016-03-14 14:02:25 -07:00
Brad Hefta-Gaub
35d6afbe77 Merge branch 'master' of https://github.com/highfidelity/hifi into fixSceneNotStable 2016-03-08 14:53:41 -08:00
Brad Hefta-Gaub
6d211dd4e5 first cut at fixing the scene not stable bug 2016-03-08 14:52:21 -08:00
Seth Alves
9346171695 if entity registration isn't default, adjust physics shapes to match 2016-03-04 16:47:30 -08:00
samcake
f12030c1a4 Merge branch 'master' of https://github.com/highfidelity/hifi into red 2016-02-11 18:41:02 -08:00
samcake
31230e81bb Merge branch 'master' of https://github.com/highfidelity/hifi into red 2016-02-11 10:05:58 -08:00
Seth Alves
ffce38769f properties hold local velocities, not world-frame ones 2016-02-10 19:16:08 -08:00
Seth Alves
6a646f1c24 put isMoving back and change all uses to isMovingRelativeToParent 2016-02-10 19:01:41 -08:00
Seth Alves
3e71efcdbb all code that asks isMoving appears to mean relative to parent 2016-02-10 18:21:44 -08:00
Seth Alves
49f2724608 don't return void 2016-02-10 13:49:03 -08:00
samcake
51bacdebdd Trying to notify the entity changes to the render item correctly, need more work 2016-02-10 11:52:37 -08:00
Seth Alves
9d21c3d549 Merge branch 'master' of github.com:highfidelity/hifi into grab-then-equip 2016-02-10 11:35:25 -08:00
Anthony J. Thibault
727e289ecd SpatiallyNestable: bug fixes for kinematic entities
* Kinematic entities were being simulated with position in the local frame but velocity in the global frame.
* Also, because getVelocity() was returning non-zero values when the parent was moving, kinematic objects were being simulated even if they should have been at rest.
* Bug fix for calculating velocity direction was incorrect, if the parent frame was rotated.
2016-02-09 17:58:54 -08:00
Seth Alves
251810edc5 only suppress location edits when they arrive over the network -- script can still update 2016-02-09 15:03:36 -08:00
Seth Alves
43592fd699 Merge pull request #7048 from hyperlogic/tony/avatar-on-moving-platform
Better avatar animation when attached to a moving entity
2016-02-09 14:30:02 -08:00
Anthony J. Thibault
072172b1a2 SpatiallyNestable: now with velocity support!
Moved velocity and angularVelocity into the SpatiallyNestable base class.

Entity velocity and angularVelocity properties are now relative to their parent, similar to the way position and orientation work for entities.

MyAvatar rig animations now use SpatiallyNestable to convert velocity into local frame to drive the animation state machine.
2016-02-08 19:43:23 -08:00
Seth Alves
82fcfc1d64 don't apply clock-skew to a lastEdited of 0 2016-02-08 15:31:32 -08:00
Andrew Meadows
959f924b1d flag entity as changed when changing simulatorID 2016-02-04 13:26:07 -08:00
Andrew Meadows
e3351c05a2 make some methods const 2016-02-04 13:26:06 -08:00
Brad Hefta-Gaub
49bbf42995 Merge pull request #6960 from sethalves/fix-adjust-edit-packet-for-clock-skew
don't adjust a time of '0 usecs since epoch' with clock skew in edit packets
2016-01-28 12:31:27 -08:00
ericrius1
cd5e81de36 Validating href for edit.js 2016-01-27 16:02:02 -08:00
Seth Alves
f2ea73d646 don't adjust a time of '0 usecs since epoch' with clock skew in edit packets 2016-01-27 14:12:03 -08:00
Andrew Meadows
a92c512c17 move collision group/mask calculus into EntityItem 2016-01-19 19:52:08 -08:00