mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 23:43:18 +02:00
end of day
This commit is contained in:
parent
112dd4209b
commit
109aa89619
2 changed files with 14 additions and 11 deletions
|
@ -13,8 +13,9 @@
|
|||
Box.prototype = {
|
||||
preload: function(entityID) {
|
||||
this.entityID = entityID;
|
||||
var userData = Entities.getEntityProperties(this.entityID, "userData");
|
||||
this.userData = JSON.parse(userData);
|
||||
var entityProperties = Entities.getEntityProperties(this.entityID, "userData");
|
||||
var parsedUserData = JSON.parse(entityProperties.userData);
|
||||
var userData = parsedUserData.lightModifierKey;
|
||||
},
|
||||
startNearGrab: function() {
|
||||
this.setInitialProperties();
|
||||
|
@ -26,10 +27,10 @@
|
|||
this.initialProperties = Entities.getEntityProperties(this.entityID);
|
||||
},
|
||||
getClampedPosition: function() {
|
||||
|
||||
dPosition = Vec3.subtract(MyAvatar.position, this.previousPosition);
|
||||
var dPosition;
|
||||
// dPosition = Vec3.subtract(MyAvatar.position, this.previousPosition);
|
||||
//convert to localFrame
|
||||
dPosition = Vec3.multiplyQbyV(Quat.inverse(MyAvatar.orientation), dPosition);
|
||||
// dPosition = Vec3.multiplyQbyV(Quat.inverse(MyAvatar.orientation), dPosition);
|
||||
|
||||
return dPosition;
|
||||
},
|
||||
|
@ -52,12 +53,12 @@
|
|||
}
|
||||
if (userData.sliderType === 'exponent') {
|
||||
this.sliderValue = scaleValueBasedOnDistanceFromStart(distance, EXPONENT_MAX);
|
||||
}
|
||||
};
|
||||
|
||||
Entities.editEntity(this.entityID) {
|
||||
Entities.editEntity(this.entityID, {
|
||||
position: currentPosition,
|
||||
rotation: this.getClampedRotation()
|
||||
}
|
||||
// rotation: this.getClampedRotation()
|
||||
});
|
||||
},
|
||||
releaseGrab: function() {
|
||||
Entities.editEntity(this.entityID, {
|
||||
|
@ -84,8 +85,7 @@
|
|||
sliderValue: this.sliderValue
|
||||
}
|
||||
Messages.sendMessage('Hifi-Slider-Value-Reciever', JSON.stringify(message));
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
return new Box();
|
||||
|
|
|
@ -115,6 +115,7 @@ entitySlider.prototype = {
|
|||
var endOfAxis;
|
||||
var properties = {
|
||||
type: 'Line',
|
||||
name: 'Hifi-Slider-Axis::'+this.sliderType,
|
||||
color: this.color,
|
||||
collisionsWillMove: false,
|
||||
ignoreForCollisions: true,
|
||||
|
@ -135,6 +136,7 @@ entitySlider.prototype = {
|
|||
this.axis = Entities.addEntity(properties);
|
||||
},
|
||||
createBoxIndicator: function() {
|
||||
print('BOX COLOR IS:::'+JSON.stringify(this.color));
|
||||
var position = Vec3.sum(this.basePosition, this.verticalOffset);
|
||||
|
||||
//line starts on left and goes to right
|
||||
|
@ -163,6 +165,7 @@ entitySlider.prototype = {
|
|||
var endOfAxis = Vec3.sum(position, extension);
|
||||
var properties = {
|
||||
type: 'Box',
|
||||
name: 'Hifi-Slider::'+this.sliderType,
|
||||
dimensions: BOX_DIMENSIONS,
|
||||
color: this.color,
|
||||
position: endOfAxis,
|
||||
|
|
Loading…
Reference in a new issue