mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 21:13:31 +02:00
remove plant for now
This commit is contained in:
parent
1524c8324f
commit
c87dae69b0
3 changed files with 17 additions and 73 deletions
unpublishedScripts/DomainContent/Home
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
(function() {
|
||||
var TRIGGER_DISTANCE = 0.85;
|
||||
|
||||
var TRANSFORMATION_SOUND_URL = '';
|
||||
|
||||
var _this;
|
||||
|
@ -28,9 +28,9 @@
|
|||
var otherProps = Entities.getEntityProperties(otherID);
|
||||
|
||||
if (otherProps.name === "hifi-home-dressing-room-transformer-collider" && _this.locked === false) {
|
||||
print('UNLOCKED TRANSFORMER COLLIDED WITH BASE!! THE AVATAR WHO SIMULATED THIS COLLISION IS:: ' + MyAvatar.sessionUUID);
|
||||
_this.locked = true;
|
||||
_this.findRotatorBlock();
|
||||
this.locked = true;
|
||||
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
@ -44,12 +44,6 @@
|
|||
});
|
||||
},
|
||||
|
||||
createTransformationParticles: function() {
|
||||
print('transformer should create particles')
|
||||
var particleProps = {};
|
||||
Entities.addEntity(particleProps);
|
||||
},
|
||||
|
||||
findRotatorBlock: function() {
|
||||
print('transformer should find rotator block')
|
||||
var myProps = Entities.getEntityProperties(_this.entityID);
|
||||
|
@ -59,6 +53,7 @@
|
|||
if (resultProps.name === "hifi-home-dressing-room-rotator-block") {
|
||||
_this.rotatorBlock = result;
|
||||
_this.removeCurrentBigVersion(result);
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -67,8 +62,6 @@
|
|||
removeCurrentBigVersion: function(rotatorBlock) {
|
||||
print('transformer should remove big version')
|
||||
var blacklistKey = 'Hifi-Hand-RayPick-Blacklist';
|
||||
|
||||
|
||||
var myProps = Entities.getEntityProperties(_this.entityID);
|
||||
var results = Entities.findEntities(myProps.position, 10);
|
||||
results.forEach(function(result) {
|
||||
|
@ -80,11 +73,11 @@
|
|||
}));
|
||||
|
||||
Entities.deleteEntity(result);
|
||||
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
_this.createBigVersion();
|
||||
|
||||
_this.createBigVersion();
|
||||
},
|
||||
|
||||
createBigVersion: function() {
|
||||
|
@ -149,65 +142,16 @@
|
|||
var baseRotation = userData["hifiHomeTransformerKey"].baseRotation;
|
||||
littleVersionProps.position = basePosition;
|
||||
littleVersionProps.rotation = baseRotation;
|
||||
// print('transformer new version ' + JSON.stringify(littleVersionProps));
|
||||
var littleTransformer = Entities.addEntity(littleVersionProps);
|
||||
print('little transformer:: ' + littleTransformer);
|
||||
_this.removeSelf();
|
||||
},
|
||||
|
||||
removeSelf: function() {
|
||||
print('transformer should remove itself')
|
||||
var success = Entities.deleteEntity(_this.entityID);
|
||||
print('transformer actually deleted self: ' + success);
|
||||
},
|
||||
};
|
||||
|
||||
function getJointData(avatar) {
|
||||
//can you do this for an arbitrary model?
|
||||
var allJointData = [];
|
||||
var jointNames = MyAvatar.jointNames;
|
||||
jointNames.forEach(function(joint, index) {
|
||||
var translation = MyAvatar.getJointTranslation(index);
|
||||
var rotation = MyAvatar.getJointRotation(index)
|
||||
allJointData.push({
|
||||
joint: joint,
|
||||
index: index,
|
||||
translation: translation,
|
||||
rotation: rotation
|
||||
});
|
||||
});
|
||||
|
||||
return allJointData;
|
||||
}
|
||||
|
||||
function getAvatarFootOffset() {
|
||||
var data = getJointData();
|
||||
var upperLeg, lowerLeg, foot, toe, toeTop;
|
||||
data.forEach(function(d) {
|
||||
|
||||
var jointName = d.joint;
|
||||
if (jointName === "RightUpLeg") {
|
||||
upperLeg = d.translation.y;
|
||||
}
|
||||
if (jointName === "RightLeg") {
|
||||
lowerLeg = d.translation.y;
|
||||
}
|
||||
if (jointName === "RightFoot") {
|
||||
foot = d.translation.y;
|
||||
}
|
||||
if (jointName === "RightToeBase") {
|
||||
toe = d.translation.y;
|
||||
}
|
||||
if (jointName === "RightToe_End") {
|
||||
toeTop = d.translation.y
|
||||
}
|
||||
})
|
||||
|
||||
var myPosition = MyAvatar.position;
|
||||
var offset = upperLeg + lowerLeg + foot + toe + toeTop;
|
||||
offset = offset / 100;
|
||||
return offset
|
||||
}
|
||||
|
||||
return new Transformer();
|
||||
})
|
|
@ -102,7 +102,7 @@ HomeMusicBox = function(spawnPosition, spawnRotation) {
|
|||
type: 'Model',
|
||||
modelURL: LID_MODEL_URL,
|
||||
dimensions: LID_DIMENSIONS,
|
||||
position: backPosition,
|
||||
position: baseProps.position,
|
||||
registrationPoint: LID_REGISTRATION_POINT,
|
||||
dynamic: false,
|
||||
script: LID_SCRIPT_URL,
|
||||
|
|
|
@ -166,15 +166,15 @@
|
|||
z: 0
|
||||
});
|
||||
|
||||
var myPlant = new Plant({
|
||||
x: 1099.8785,
|
||||
y: 460.3115,
|
||||
z: -84.7736
|
||||
}, {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0
|
||||
});
|
||||
// var myPlant = new Plant({
|
||||
// x: 1099.8785,
|
||||
// y: 460.3115,
|
||||
// z: -84.7736
|
||||
// }, {
|
||||
// x: 0,
|
||||
// y: 0,
|
||||
// z: 0
|
||||
// });
|
||||
|
||||
var pingPongGun = new HomePingPongGun({
|
||||
x: 1101.2123,
|
||||
|
|
Loading…
Reference in a new issue