コード例 #1
0
ファイル: SkeletonModel.cpp プロジェクト: Dreckinfeuer/hifi
void SkeletonModel::updateJointState(int index) {
    if (index > _jointStates.size()) {
        return; // bail
    }
    JointState& state = _jointStates[index];
    const FBXJoint& joint = state.getFBXJoint();
    if (joint.parentIndex != -1 && joint.parentIndex <= _jointStates.size()) {
        const JointState& parentState = _jointStates.at(joint.parentIndex);
        const FBXGeometry& geometry = _geometry->getFBXGeometry();
        if (index == geometry.leanJointIndex) {
            maybeUpdateLeanRotation(parentState, state);
        
        } else if (index == geometry.neckJointIndex) {
            maybeUpdateNeckRotation(parentState, joint, state);    
                
        } else if (index == geometry.leftEyeJointIndex || index == geometry.rightEyeJointIndex) {
            maybeUpdateEyeRotation(parentState, joint, state);
        }
    }

    Model::updateJointState(index);

    if (index == _geometry->getFBXGeometry().rootJointIndex) {
        state.clearTransformTranslation();
    }
}
コード例 #2
0
ファイル: FaceModel.cpp プロジェクト: Barnold1953/hifi
void FaceModel::updateJointState(int index) {
    JointState& state = _jointStates[index];
    const FBXJoint& joint = state.getFBXJoint();
    if (joint.parentIndex != -1) {
        const JointState& parentState = _jointStates.at(joint.parentIndex);
        const FBXGeometry& geometry = _geometry->getFBXGeometry();
        if (index == geometry.neckJointIndex) {
            maybeUpdateNeckRotation(parentState, joint, state);    
                
        } else if (index == geometry.leftEyeJointIndex || index == geometry.rightEyeJointIndex) {
            maybeUpdateEyeRotation(parentState, joint, state);
        }
    }

    Model::updateJointState(index);
}
コード例 #3
0
ファイル: FaceModel.cpp プロジェクト: CiaranLaval/hifi
void FaceModel::maybeUpdateNeckAndEyeRotation(int index) {
    const JointState& state = _rig->getJointState(index);
    const FBXGeometry& geometry = _geometry->getFBXGeometry();
    const int parentIndex = state.getParentIndex();

    // guard against out-of-bounds access to _jointStates
    if (parentIndex != -1 && parentIndex >= 0 && parentIndex < _rig->getJointStateCount()) {
        const JointState& parentState = _rig->getJointState(parentIndex);
        if (index == geometry.neckJointIndex) {
            maybeUpdateNeckRotation(parentState, state, index);

        } else if (index == geometry.leftEyeJointIndex || index == geometry.rightEyeJointIndex) {
            maybeUpdateEyeRotation(this, parentState, state, index);
        }
    }
}
コード例 #4
0
ファイル: FaceModel.cpp プロジェクト: Dreckinfeuer/hifi
void FaceModel::updateJointState(int index) {
    JointState& state = _jointStates[index];
    const FBXJoint& joint = state.getFBXJoint();
    // guard against out-of-bounds access to _jointStates
    if (joint.parentIndex != -1 && joint.parentIndex >= 0 && joint.parentIndex < _jointStates.size()) {
        const JointState& parentState = _jointStates.at(joint.parentIndex);
        const FBXGeometry& geometry = _geometry->getFBXGeometry();
        if (index == geometry.neckJointIndex) {
            maybeUpdateNeckRotation(parentState, joint, state);    
                
        } else if (index == geometry.leftEyeJointIndex || index == geometry.rightEyeJointIndex) {
            maybeUpdateEyeRotation(this, parentState, joint, state);
        }
    }

    Model::updateJointState(index);
}