mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:58:03 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
72a6403eb0
4 changed files with 21 additions and 16 deletions
|
@ -49,20 +49,20 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
An dynamic is a callback which is registered with bullet. An dynamic is called-back every physics
|
A dynamic is a callback which is registered with bullet. A dynamic is called-back every physics
|
||||||
simulation step and can do whatever it wants with the various datastructures it has available. An
|
simulation step and can do whatever it wants with the various datastructures it has available. An
|
||||||
dynamic, for example, can pull an EntityItem toward a point as if that EntityItem were connected to that
|
dynamic, for example, can pull an EntityItem toward a point as if that EntityItem were connected to that
|
||||||
point by a spring.
|
point by a spring.
|
||||||
|
|
||||||
In this system, an dynamic is a property of an EntityItem (rather, an EntityItem has a property which
|
In this system, a dynamic is a property of an EntityItem (rather, an EntityItem has a property which
|
||||||
encodes a list of dynamics). Each dynamic has a type and some arguments. Dynamics can be created by a
|
encodes a list of dynamics). Each dynamic has a type and some arguments. Dynamics can be created by a
|
||||||
script or when receiving information via an EntityTree data-stream (either over the network or from an
|
script or when receiving information via an EntityTree data-stream (either over the network or from an
|
||||||
svo file).
|
svo file).
|
||||||
|
|
||||||
In the interface, if an EntityItem has dynamics, this EntityItem will have pointers to ObjectDynamic
|
In the interface, if an EntityItem has dynamics, this EntityItem will have pointers to ObjectDynamic
|
||||||
subclass (like ObjectDynamicSpring) instantiations. Code in the entities library affects an dynamic-object
|
subclass (like ObjectDynamicSpring) instantiations. Code in the entities library affects a dynamic-object
|
||||||
via the EntityDynamicInterface (which knows nothing about bullet). When the ObjectDynamic subclass
|
via the EntityDynamicInterface (which knows nothing about bullet). When the ObjectDynamic subclass
|
||||||
instance is created, it is registered as an dynamic with bullet. Bullet will call into code in this
|
instance is created, it is registered as a dynamic with bullet. Bullet will call into code in this
|
||||||
instance with the btDynamicInterface every physics-simulation step.
|
instance with the btDynamicInterface every physics-simulation step.
|
||||||
|
|
||||||
Because the dynamic can exist next to the interface's EntityTree or the entity-server's EntityTree,
|
Because the dynamic can exist next to the interface's EntityTree or the entity-server's EntityTree,
|
||||||
|
|
|
@ -348,18 +348,19 @@ void AssetClient::handleAssetGetReply(QSharedPointer<ReceivedMessage> message, S
|
||||||
// Store message in case we need to disconnect from it later.
|
// Store message in case we need to disconnect from it later.
|
||||||
callbacks.message = message;
|
callbacks.message = message;
|
||||||
|
|
||||||
|
|
||||||
|
auto weakNode = senderNode.toWeakRef();
|
||||||
|
connect(message.data(), &ReceivedMessage::progress, this, [this, weakNode, messageID, length](qint64 size) {
|
||||||
|
handleProgressCallback(weakNode, messageID, size, length);
|
||||||
|
});
|
||||||
|
connect(message.data(), &ReceivedMessage::completed, this, [this, weakNode, messageID]() {
|
||||||
|
handleCompleteCallback(weakNode, messageID);
|
||||||
|
});
|
||||||
|
|
||||||
if (message->isComplete()) {
|
if (message->isComplete()) {
|
||||||
|
disconnect(message.data(), nullptr, this, nullptr);
|
||||||
callbacks.completeCallback(true, error, message->readAll());
|
callbacks.completeCallback(true, error, message->readAll());
|
||||||
messageCallbackMap.erase(requestIt);
|
messageCallbackMap.erase(requestIt);
|
||||||
} else {
|
|
||||||
auto weakNode = senderNode.toWeakRef();
|
|
||||||
|
|
||||||
connect(message.data(), &ReceivedMessage::progress, this, [this, weakNode, messageID, length](qint64 size) {
|
|
||||||
handleProgressCallback(weakNode, messageID, size, length);
|
|
||||||
});
|
|
||||||
connect(message.data(), &ReceivedMessage::completed, this, [this, weakNode, messageID]() {
|
|
||||||
handleCompleteCallback(weakNode, messageID);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ void AssetRequest::start() {
|
||||||
_assetRequestID = assetClient->getAsset(_hash, _byteRange.fromInclusive, _byteRange.toExclusive,
|
_assetRequestID = assetClient->getAsset(_hash, _byteRange.fromInclusive, _byteRange.toExclusive,
|
||||||
[this, that, hash](bool responseReceived, AssetServerError serverError, const QByteArray& data) {
|
[this, that, hash](bool responseReceived, AssetServerError serverError, const QByteArray& data) {
|
||||||
|
|
||||||
if (!that) {
|
if (!that) {
|
||||||
qCWarning(asset_client) << "Got reply for dead asset request " << hash << "- error code" << _error;
|
qCWarning(asset_client) << "Got reply for dead asset request " << hash << "- error code" << _error;
|
||||||
// If the request is dead, return
|
// If the request is dead, return
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -16,7 +16,7 @@ var RequestModule = Script.require('./request.js');
|
||||||
|
|
||||||
var LABEL = "makeUserConnection";
|
var LABEL = "makeUserConnection";
|
||||||
var MAX_AVATAR_DISTANCE = 0.2; // m
|
var MAX_AVATAR_DISTANCE = 0.2; // m
|
||||||
var GRIP_MIN = 0.05; // goes from 0-1, so 5% pressed is pressed
|
var GRIP_MIN = 0.75; // goes from 0-1, so 75% pressed is pressed
|
||||||
var MESSAGE_CHANNEL = "io.highfidelity.makeUserConnection";
|
var MESSAGE_CHANNEL = "io.highfidelity.makeUserConnection";
|
||||||
var STATES = {
|
var STATES = {
|
||||||
INACTIVE: 0,
|
INACTIVE: 0,
|
||||||
|
@ -545,7 +545,11 @@ var RequestModule = Script.require('./request.js');
|
||||||
Window.makeConnection(false, result.connection);
|
Window.makeConnection(false, result.connection);
|
||||||
UserActivityLogger.makeUserConnection(connectingId, false, result.connection);
|
UserActivityLogger.makeUserConnection(connectingId, false, result.connection);
|
||||||
}
|
}
|
||||||
var POLL_INTERVAL_MS = 200, POLL_LIMIT = 5;
|
// This is a bit fragile - but to account for skew in when people actually create the
|
||||||
|
// connection request, I've upped this to 2 seconds (plus the round-trip times)
|
||||||
|
// TODO: keep track of when the person we are connecting with is done, and don't stop
|
||||||
|
// until say 1 second after that.
|
||||||
|
var POLL_INTERVAL_MS = 200, POLL_LIMIT = 10;
|
||||||
function handleConnectionResponseAndMaybeRepeat(error, response) {
|
function handleConnectionResponseAndMaybeRepeat(error, response) {
|
||||||
// If response is 'pending', set a short timeout to try again.
|
// If response is 'pending', set a short timeout to try again.
|
||||||
// If we fail other than pending, set result and immediately call connectionRequestCompleted.
|
// If we fail other than pending, set result and immediately call connectionRequestCompleted.
|
||||||
|
|
Loading…
Reference in a new issue