mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 12:04:03 +02:00
remove plant for now
This commit is contained in:
parent
1524c8324f
commit
c87dae69b0
3 changed files with 17 additions and 73 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var TRIGGER_DISTANCE = 0.85;
|
|
||||||
var TRANSFORMATION_SOUND_URL = '';
|
var TRANSFORMATION_SOUND_URL = '';
|
||||||
|
|
||||||
var _this;
|
var _this;
|
||||||
|
@ -28,9 +28,9 @@
|
||||||
var otherProps = Entities.getEntityProperties(otherID);
|
var otherProps = Entities.getEntityProperties(otherID);
|
||||||
|
|
||||||
if (otherProps.name === "hifi-home-dressing-room-transformer-collider" && _this.locked === false) {
|
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.findRotatorBlock();
|
||||||
this.locked = true;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -44,12 +44,6 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createTransformationParticles: function() {
|
|
||||||
print('transformer should create particles')
|
|
||||||
var particleProps = {};
|
|
||||||
Entities.addEntity(particleProps);
|
|
||||||
},
|
|
||||||
|
|
||||||
findRotatorBlock: function() {
|
findRotatorBlock: function() {
|
||||||
print('transformer should find rotator block')
|
print('transformer should find rotator block')
|
||||||
var myProps = Entities.getEntityProperties(_this.entityID);
|
var myProps = Entities.getEntityProperties(_this.entityID);
|
||||||
|
@ -59,6 +53,7 @@
|
||||||
if (resultProps.name === "hifi-home-dressing-room-rotator-block") {
|
if (resultProps.name === "hifi-home-dressing-room-rotator-block") {
|
||||||
_this.rotatorBlock = result;
|
_this.rotatorBlock = result;
|
||||||
_this.removeCurrentBigVersion(result);
|
_this.removeCurrentBigVersion(result);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -67,8 +62,6 @@
|
||||||
removeCurrentBigVersion: function(rotatorBlock) {
|
removeCurrentBigVersion: function(rotatorBlock) {
|
||||||
print('transformer should remove big version')
|
print('transformer should remove big version')
|
||||||
var blacklistKey = 'Hifi-Hand-RayPick-Blacklist';
|
var blacklistKey = 'Hifi-Hand-RayPick-Blacklist';
|
||||||
|
|
||||||
|
|
||||||
var myProps = Entities.getEntityProperties(_this.entityID);
|
var myProps = Entities.getEntityProperties(_this.entityID);
|
||||||
var results = Entities.findEntities(myProps.position, 10);
|
var results = Entities.findEntities(myProps.position, 10);
|
||||||
results.forEach(function(result) {
|
results.forEach(function(result) {
|
||||||
|
@ -80,11 +73,11 @@
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Entities.deleteEntity(result);
|
Entities.deleteEntity(result);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
_this.createBigVersion();
|
||||||
_this.createBigVersion();
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
createBigVersion: function() {
|
createBigVersion: function() {
|
||||||
|
@ -149,65 +142,16 @@
|
||||||
var baseRotation = userData["hifiHomeTransformerKey"].baseRotation;
|
var baseRotation = userData["hifiHomeTransformerKey"].baseRotation;
|
||||||
littleVersionProps.position = basePosition;
|
littleVersionProps.position = basePosition;
|
||||||
littleVersionProps.rotation = baseRotation;
|
littleVersionProps.rotation = baseRotation;
|
||||||
// print('transformer new version ' + JSON.stringify(littleVersionProps));
|
|
||||||
var littleTransformer = Entities.addEntity(littleVersionProps);
|
var littleTransformer = Entities.addEntity(littleVersionProps);
|
||||||
print('little transformer:: ' + littleTransformer);
|
|
||||||
_this.removeSelf();
|
_this.removeSelf();
|
||||||
},
|
},
|
||||||
|
|
||||||
removeSelf: function() {
|
removeSelf: function() {
|
||||||
print('transformer should remove itself')
|
print('transformer should remove itself')
|
||||||
var success = Entities.deleteEntity(_this.entityID);
|
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();
|
return new Transformer();
|
||||||
})
|
})
|
|
@ -102,7 +102,7 @@ HomeMusicBox = function(spawnPosition, spawnRotation) {
|
||||||
type: 'Model',
|
type: 'Model',
|
||||||
modelURL: LID_MODEL_URL,
|
modelURL: LID_MODEL_URL,
|
||||||
dimensions: LID_DIMENSIONS,
|
dimensions: LID_DIMENSIONS,
|
||||||
position: backPosition,
|
position: baseProps.position,
|
||||||
registrationPoint: LID_REGISTRATION_POINT,
|
registrationPoint: LID_REGISTRATION_POINT,
|
||||||
dynamic: false,
|
dynamic: false,
|
||||||
script: LID_SCRIPT_URL,
|
script: LID_SCRIPT_URL,
|
||||||
|
|
|
@ -166,15 +166,15 @@
|
||||||
z: 0
|
z: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
var myPlant = new Plant({
|
// var myPlant = new Plant({
|
||||||
x: 1099.8785,
|
// x: 1099.8785,
|
||||||
y: 460.3115,
|
// y: 460.3115,
|
||||||
z: -84.7736
|
// z: -84.7736
|
||||||
}, {
|
// }, {
|
||||||
x: 0,
|
// x: 0,
|
||||||
y: 0,
|
// y: 0,
|
||||||
z: 0
|
// z: 0
|
||||||
});
|
// });
|
||||||
|
|
||||||
var pingPongGun = new HomePingPongGun({
|
var pingPongGun = new HomePingPongGun({
|
||||||
x: 1101.2123,
|
x: 1101.2123,
|
||||||
|
|
Loading…
Reference in a new issue