mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 07:37:20 +02:00
update doppelganger script
This commit is contained in:
parent
e18298c974
commit
9a979f4abf
1 changed files with 2 additions and 18 deletions
|
@ -48,20 +48,9 @@ function getJointData(avatar) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setJointData(doppelganger, allJointData) {
|
function setJointData(doppelganger, allJointData) {
|
||||||
var jointRotationsSet = [];
|
|
||||||
var jointTranslationsSet = [];
|
|
||||||
var jointRotations = [];
|
|
||||||
var jointTranslations = [];
|
|
||||||
|
|
||||||
allJointData.forEach(function(jointData, index) {
|
allJointData.forEach(function(jointData, index) {
|
||||||
jointRotationsSet[index] = true;
|
|
||||||
jointTranslationsSet[index] = true;
|
|
||||||
jointRotations.push(jointData.rotation);
|
|
||||||
jointTranslations.push(jointData.translation);
|
|
||||||
|
|
||||||
Entities.setAbsoluteJointTranslationInObjectFrame(doppelganger.id, index, jointData.translation);
|
Entities.setAbsoluteJointTranslationInObjectFrame(doppelganger.id, index, jointData.translation);
|
||||||
Entities.setAbsoluteJointRotationInObjectFrame(doppelganger.id, index, jointData.rotation);
|
Entities.setAbsoluteJointRotationInObjectFrame(doppelganger.id, index, jointData.rotation);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -96,7 +85,8 @@ function rotateDoppelgangerTowardAvatar(doppelganger, avatar) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function connectDoppelgangerUpdates() {
|
function connectDoppelgangerUpdates() {
|
||||||
Script.update.connect(updateDoppelganger);
|
// Script.update.connect(updateDoppelganger);
|
||||||
|
Script.setInterval(updateDoppelganger, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
function disconnectDoppelgangerUpdates() {
|
function disconnectDoppelgangerUpdates() {
|
||||||
|
@ -109,7 +99,6 @@ function updateDoppelganger() {
|
||||||
//var mirroredJoints = mirrorJointData(joints);
|
//var mirroredJoints = mirrorJointData(joints);
|
||||||
setJointData(doppelganger, joints);
|
setJointData(doppelganger, joints);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeDoppelgangerForMyAvatar() {
|
function makeDoppelgangerForMyAvatar() {
|
||||||
|
@ -129,8 +118,3 @@ function cleanup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Script.scriptEnding.connect(cleanup);
|
Script.scriptEnding.connect(cleanup);
|
||||||
|
|
||||||
// APPEND_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS_SET, getJointRotationsSet());
|
|
||||||
// APPEND_ENTITY_PROPERTY(PROP_JOINT_ROTATIONS, getJointRotations());
|
|
||||||
// APPEND_ENTITY_PROPERTY(PROP_JOINT_TRANSLATIONS_SET, getJointTranslationsSet());
|
|
||||||
// APPEND_ENTITY_PROPERTY(PROP_JOINT_TRANSLATIONS, getJointTranslations());
|
|
||||||
|
|
Loading…
Reference in a new issue