mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 13:12:57 +02:00
commit
74fd69ac2d
8 changed files with 10 additions and 10 deletions
|
@ -64,7 +64,6 @@ void ModelOverlay::update(float deltatime) {
|
|||
}
|
||||
_isLoaded = _model->isActive();
|
||||
|
||||
|
||||
if (isAnimatingSomething()) {
|
||||
if (!jointsMapped()) {
|
||||
mapAnimationJoints(_model->getJointNames());
|
||||
|
|
|
@ -78,6 +78,8 @@ private:
|
|||
bool _scaleToFit = { false };
|
||||
float _loadPriority { 0.0f };
|
||||
|
||||
bool _visibleDirty { false };
|
||||
bool _drawInFrontDirty { false };
|
||||
AnimationPointer _animation;
|
||||
|
||||
QUrl _animationURL;
|
||||
|
@ -95,10 +97,6 @@ private:
|
|||
QUrl _jointMappingURL;
|
||||
bool _jointMappingCompleted { false };
|
||||
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
|
||||
|
|
|
@ -1620,13 +1620,14 @@ void Rig::updateFromControllerParameters(const ControllerParameters& params, flo
|
|||
}
|
||||
|
||||
void Rig::initAnimGraph(const QUrl& url) {
|
||||
if (_animGraphURL != url || !_animNode) {
|
||||
if (_animGraphURL != url || (!_animNode && !_animLoading)) {
|
||||
_animGraphURL = url;
|
||||
|
||||
_animNode.reset();
|
||||
|
||||
// load the anim graph
|
||||
_animLoader.reset(new AnimNodeLoader(url));
|
||||
_animLoading = true;
|
||||
connect(_animLoader.get(), &AnimNodeLoader::success, [this](AnimNode::Pointer nodeIn) {
|
||||
_animNode = nodeIn;
|
||||
_animNode->setSkeleton(_animSkeleton);
|
||||
|
@ -1637,6 +1638,7 @@ void Rig::initAnimGraph(const QUrl& url) {
|
|||
_userAnimState = { UserAnimState::None, "", 30.0f, false, 0.0f, 0.0f };
|
||||
overrideAnimation(origState.url, origState.fps, origState.loop, origState.firstFrame, origState.lastFrame);
|
||||
}
|
||||
_animLoading = false;
|
||||
|
||||
emit onLoadComplete();
|
||||
});
|
||||
|
|
|
@ -303,6 +303,7 @@ protected:
|
|||
std::shared_ptr<AnimNode> _animNode;
|
||||
std::shared_ptr<AnimSkeleton> _animSkeleton;
|
||||
std::unique_ptr<AnimNodeLoader> _animLoader;
|
||||
bool _animLoading { false };
|
||||
AnimVariantMap _animVars;
|
||||
enum class RigRole {
|
||||
Idle = 0,
|
||||
|
|
|
@ -1433,7 +1433,7 @@ void EntityItem::recordCreationTime() {
|
|||
const Transform EntityItem::getTransformToCenter(bool& success) const {
|
||||
Transform result = getTransform(success);
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ bool TextEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const
|
|||
glm::vec2 xyDimensions(dimensions.x, dimensions.y);
|
||||
glm::quat rotation = getRotation();
|
||||
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
|
||||
return findRayRectangleIntersection(origin, direction, rotation, position, xyDimensions, distance);
|
||||
|
|
|
@ -112,7 +112,7 @@ bool WebEntityItem::findDetailedRayIntersection(const glm::vec3& origin, const g
|
|||
glm::vec3 dimensions = getDimensions();
|
||||
glm::vec2 xyDimensions(dimensions.x, dimensions.y);
|
||||
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)) {
|
||||
surfaceNormal = rotation * Vectors::UNIT_Z;
|
||||
|
|
|
@ -223,7 +223,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
|
|||
(distance > NEAR_GRAB_RADIUS * sensorScaleFactor)) {
|
||||
continue;
|
||||
}
|
||||
if (entityIsGrabbable(props)) {
|
||||
if (entityIsGrabbable(props) || entityIsCloneable(props)) {
|
||||
// give haptic feedback
|
||||
if (props.id !== this.hapticTargetID) {
|
||||
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
||||
|
|
Loading…
Reference in a new issue