mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:21:16 +02:00
Initial version - move updateJoints() to derived class
This commit is contained in:
parent
2776839dff
commit
9315c546d3
3 changed files with 33 additions and 27 deletions
|
@ -1894,6 +1894,34 @@ QList<QVariant> Avatar::getSkeleton() {
|
||||||
return QList<QVariant>();
|
return QList<QVariant>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Avatar::updateJointMappings() {
|
||||||
|
{
|
||||||
|
QWriteLocker writeLock(&_jointDataLock);
|
||||||
|
_fstJointIndices.clear();
|
||||||
|
_fstJointNames.clear();
|
||||||
|
_jointData.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
//if (_skeletonModelURL.fileName().toLower().endsWith(".fst")) {
|
||||||
|
// ////
|
||||||
|
// // TODO: Should we rely upon HTTPResourceRequest for ResourceRequestObserver instead?
|
||||||
|
// // HTTPResourceRequest::doSend() covers all of the following and
|
||||||
|
// // then some. It doesn't cover the connect() call, so we may
|
||||||
|
// // want to add a HTTPResourceRequest::doSend() method that does
|
||||||
|
// // connects.
|
||||||
|
// QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||||
|
// QNetworkRequest networkRequest = QNetworkRequest(_skeletonModelURL);
|
||||||
|
// networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||||
|
// networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
||||||
|
// DependencyManager::get<ResourceRequestObserver>()->update(
|
||||||
|
// _skeletonModelURL, -1, "AvatarData::updateJointMappings");
|
||||||
|
// QNetworkReply* networkReply = networkAccessManager.get(networkRequest);
|
||||||
|
// //
|
||||||
|
// ////
|
||||||
|
// connect(networkReply, &QNetworkReply::finished, this, &AvatarData::setJointMappingsFromNetworkReply);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
void Avatar::addToScene(AvatarSharedPointer myHandle, const render::ScenePointer& scene) {
|
void Avatar::addToScene(AvatarSharedPointer myHandle, const render::ScenePointer& scene) {
|
||||||
if (scene) {
|
if (scene) {
|
||||||
auto nodelist = DependencyManager::get<NodeList>();
|
auto nodelist = DependencyManager::get<NodeList>();
|
||||||
|
|
|
@ -516,6 +516,9 @@ protected:
|
||||||
mutable QReadWriteLock _modelJointIndicesCacheLock;
|
mutable QReadWriteLock _modelJointIndicesCacheLock;
|
||||||
mutable bool _modelJointsCached { false };
|
mutable bool _modelJointsCached { false };
|
||||||
|
|
||||||
|
/// Loads the joint indices, names from the FST file (if any)
|
||||||
|
virtual void updateJointMappings() override;
|
||||||
|
|
||||||
glm::vec3 _skeletonOffset;
|
glm::vec3 _skeletonOffset;
|
||||||
std::vector<std::shared_ptr<Model>> _attachmentModels;
|
std::vector<std::shared_ptr<Model>> _attachmentModels;
|
||||||
std::vector<bool> _attachmentModelsTexturesLoaded;
|
std::vector<bool> _attachmentModelsTexturesLoaded;
|
||||||
|
|
|
@ -2209,33 +2209,8 @@ void AvatarData::sendIdentityPacket() {
|
||||||
_identityDataChanged = false;
|
_identityDataChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarData::updateJointMappings() {
|
void AvatarData::updateJointMappings()
|
||||||
{
|
{ }
|
||||||
QWriteLocker writeLock(&_jointDataLock);
|
|
||||||
_fstJointIndices.clear();
|
|
||||||
_fstJointNames.clear();
|
|
||||||
_jointData.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_skeletonModelURL.fileName().toLower().endsWith(".fst")) {
|
|
||||||
////
|
|
||||||
// TODO: Should we rely upon HTTPResourceRequest for ResourceRequestObserver instead?
|
|
||||||
// HTTPResourceRequest::doSend() covers all of the following and
|
|
||||||
// then some. It doesn't cover the connect() call, so we may
|
|
||||||
// want to add a HTTPResourceRequest::doSend() method that does
|
|
||||||
// connects.
|
|
||||||
QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
|
||||||
QNetworkRequest networkRequest = QNetworkRequest(_skeletonModelURL);
|
|
||||||
networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
|
||||||
networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
|
||||||
DependencyManager::get<ResourceRequestObserver>()->update(
|
|
||||||
_skeletonModelURL, -1, "AvatarData::updateJointMappings");
|
|
||||||
QNetworkReply* networkReply = networkAccessManager.get(networkRequest);
|
|
||||||
//
|
|
||||||
////
|
|
||||||
connect(networkReply, &QNetworkReply::finished, this, &AvatarData::setJointMappingsFromNetworkReply);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static const QString JSON_ATTACHMENT_URL = QStringLiteral("modelUrl");
|
static const QString JSON_ATTACHMENT_URL = QStringLiteral("modelUrl");
|
||||||
static const QString JSON_ATTACHMENT_JOINT_NAME = QStringLiteral("jointName");
|
static const QString JSON_ATTACHMENT_JOINT_NAME = QStringLiteral("jointName");
|
||||||
|
|
Loading…
Reference in a new issue