Merge pull request #11523 from Atlante45/new-master

RC56 into Master
This commit is contained in:
Clément Brisset 2017-10-04 15:17:52 -07:00 committed by GitHub
commit 74fd69ac2d
8 changed files with 10 additions and 10 deletions

View file

@ -64,7 +64,6 @@ void ModelOverlay::update(float deltatime) {
} }
_isLoaded = _model->isActive(); _isLoaded = _model->isActive();
if (isAnimatingSomething()) { if (isAnimatingSomething()) {
if (!jointsMapped()) { if (!jointsMapped()) {
mapAnimationJoints(_model->getJointNames()); mapAnimationJoints(_model->getJointNames());

View file

@ -78,6 +78,8 @@ private:
bool _scaleToFit = { false }; bool _scaleToFit = { false };
float _loadPriority { 0.0f }; float _loadPriority { 0.0f };
bool _visibleDirty { false };
bool _drawInFrontDirty { false };
AnimationPointer _animation; AnimationPointer _animation;
QUrl _animationURL; QUrl _animationURL;
@ -95,10 +97,6 @@ private:
QUrl _jointMappingURL; QUrl _jointMappingURL;
bool _jointMappingCompleted { false }; bool _jointMappingCompleted { false };
QVector<int> _jointMapping; // domain is index into model-joints, range is index into animation-joints QVector<int> _jointMapping; // domain is index into model-joints, range is index into animation-joints
bool _visibleDirty { false };
bool _drawInFrontDirty { false };
}; };
#endif // hifi_ModelOverlay_h #endif // hifi_ModelOverlay_h

View file

@ -1620,13 +1620,14 @@ void Rig::updateFromControllerParameters(const ControllerParameters& params, flo
} }
void Rig::initAnimGraph(const QUrl& url) { void Rig::initAnimGraph(const QUrl& url) {
if (_animGraphURL != url || !_animNode) { if (_animGraphURL != url || (!_animNode && !_animLoading)) {
_animGraphURL = url; _animGraphURL = url;
_animNode.reset(); _animNode.reset();
// load the anim graph // load the anim graph
_animLoader.reset(new AnimNodeLoader(url)); _animLoader.reset(new AnimNodeLoader(url));
_animLoading = true;
connect(_animLoader.get(), &AnimNodeLoader::success, [this](AnimNode::Pointer nodeIn) { connect(_animLoader.get(), &AnimNodeLoader::success, [this](AnimNode::Pointer nodeIn) {
_animNode = nodeIn; _animNode = nodeIn;
_animNode->setSkeleton(_animSkeleton); _animNode->setSkeleton(_animSkeleton);
@ -1637,6 +1638,7 @@ void Rig::initAnimGraph(const QUrl& url) {
_userAnimState = { UserAnimState::None, "", 30.0f, false, 0.0f, 0.0f }; _userAnimState = { UserAnimState::None, "", 30.0f, false, 0.0f, 0.0f };
overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame); overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame);
} }
_animLoading = false;
emit onLoadComplete(); emit onLoadComplete();
}); });

View file

@ -303,6 +303,7 @@ protected:
std::shared_ptr<AnimNode> _animNode; std::shared_ptr<AnimNode> _animNode;
std::shared_ptr<AnimSkeleton> _animSkeleton; std::shared_ptr<AnimSkeleton> _animSkeleton;
std::unique_ptr<AnimNodeLoader> _animLoader; std::unique_ptr<AnimNodeLoader> _animLoader;
bool _animLoading { false };
AnimVariantMap _animVars; AnimVariantMap _animVars;
enum class RigRole { enum class RigRole {
Idle = 0, Idle = 0,

View file

@ -1433,7 +1433,7 @@ void EntityItem::recordCreationTime() {
const Transform EntityItem::getTransformToCenter(bool& success) const { const Transform EntityItem::getTransformToCenter(bool& success) const {
Transform result = getTransform(success); Transform result = getTransform(success);
if (getRegistrationPoint() != ENTITY_ITEM_HALF_VEC3) { // If it is not already centered, translate to center if (getRegistrationPoint() != ENTITY_ITEM_HALF_VEC3) { // If it is not already centered, translate to center
result.postTranslate(ENTITY_ITEM_HALF_VEC3 - getRegistrationPoint()); // Position to center result.postTranslate((ENTITY_ITEM_HALF_VEC3 - getRegistrationPoint()) * getDimensions()); // Position to center
} }
return result; return result;
} }

View file

@ -136,7 +136,7 @@ bool TextEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const
glm::vec2 xyDimensions(dimensions.x, dimensions.y); glm::vec2 xyDimensions(dimensions.x, dimensions.y);
glm::quat rotation = getRotation(); glm::quat rotation = getRotation();
glm::vec3 position = getPosition() + rotation * glm::vec3 position = getPosition() + rotation *
(dimensions * (getRegistrationPoint() - ENTITY_ITEM_DEFAULT_REGISTRATION_POINT)); (dimensions * (ENTITY_ITEM_DEFAULT_REGISTRATION_POINT - getRegistrationPoint()));
// FIXME - should set face and surfaceNormal // FIXME - should set face and surfaceNormal
return findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance); return findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance);

View file

@ -112,7 +112,7 @@ bool WebEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const g
glm::vec3 dimensions = getDimensions(); glm::vec3 dimensions = getDimensions();
glm::vec2 xyDimensions(dimensions.x, dimensions.y); glm::vec2 xyDimensions(dimensions.x, dimensions.y);
glm::quat rotation = getRotation(); glm::quat rotation = getRotation();
glm::vec3 position = getPosition() + rotation * (dimensions * (getRegistrationPoint() - ENTITY_ITEM_DEFAULT_REGISTRATION_POINT)); glm::vec3 position = getPosition() + rotation * (dimensions * (ENTITY_ITEM_DEFAULT_REGISTRATION_POINT - getRegistrationPoint()));
if (findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance)) { if (findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance)) {
surfaceNormal = rotation * Vectors::UNIT_Z; surfaceNormal = rotation * Vectors::UNIT_Z;

View file

@ -223,7 +223,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
(distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) { (distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) {
continue; continue;
} }
if (entityIsGrabbable(props)) { if (entityIsGrabbable(props) || entityIsCloneable(props)) {
// give haptic feedback // give haptic feedback
if (props.id !== this.hapticTargetID) { if (props.id !== this.hapticTargetID) {
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand); Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);