mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 22:27:25 +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 = {
|
Box.prototype = {
|
||||||
preload: function(entityID) {
|
preload: function(entityID) {
|
||||||
this.entityID = entityID;
|
this.entityID = entityID;
|
||||||
var userData = Entities.getEntityProperties(this.entityID, "userData");
|
var entityProperties = Entities.getEntityProperties(this.entityID, "userData");
|
||||||
this.userData = JSON.parse(userData);
|
var parsedUserData = JSON.parse(entityProperties.userData);
|
||||||
|
var userData = parsedUserData.lightModifierKey;
|
||||||
},
|
},
|
||||||
startNearGrab: function() {
|
startNearGrab: function() {
|
||||||
this.setInitialProperties();
|
this.setInitialProperties();
|
||||||
|
@ -26,10 +27,10 @@
|
||||||
this.initialProperties = Entities.getEntityProperties(this.entityID);
|
this.initialProperties = Entities.getEntityProperties(this.entityID);
|
||||||
},
|
},
|
||||||
getClampedPosition: function() {
|
getClampedPosition: function() {
|
||||||
|
var dPosition;
|
||||||
dPosition = Vec3.subtract(MyAvatar.position, this.previousPosition);
|
// dPosition = Vec3.subtract(MyAvatar.position, this.previousPosition);
|
||||||
//convert to localFrame
|
//convert to localFrame
|
||||||
dPosition = Vec3.multiplyQbyV(Quat.inverse(MyAvatar.orientation), dPosition);
|
// dPosition = Vec3.multiplyQbyV(Quat.inverse(MyAvatar.orientation), dPosition);
|
||||||
|
|
||||||
return dPosition;
|
return dPosition;
|
||||||
},
|
},
|
||||||
|
@ -52,12 +53,12 @@
|
||||||
}
|
}
|
||||||
if (userData.sliderType === 'exponent') {
|
if (userData.sliderType === 'exponent') {
|
||||||
this.sliderValue = scaleValueBasedOnDistanceFromStart(distance, EXPONENT_MAX);
|
this.sliderValue = scaleValueBasedOnDistanceFromStart(distance, EXPONENT_MAX);
|
||||||
}
|
};
|
||||||
|
|
||||||
Entities.editEntity(this.entityID) {
|
Entities.editEntity(this.entityID, {
|
||||||
position: currentPosition,
|
position: currentPosition,
|
||||||
rotation: this.getClampedRotation()
|
// rotation: this.getClampedRotation()
|
||||||
}
|
});
|
||||||
},
|
},
|
||||||
releaseGrab: function() {
|
releaseGrab: function() {
|
||||||
Entities.editEntity(this.entityID, {
|
Entities.editEntity(this.entityID, {
|
||||||
|
@ -84,8 +85,7 @@
|
||||||
sliderValue: this.sliderValue
|
sliderValue: this.sliderValue
|
||||||
}
|
}
|
||||||
Messages.sendMessage('Hifi-Slider-Value-Reciever', JSON.stringify(message));
|
Messages.sendMessage('Hifi-Slider-Value-Reciever', JSON.stringify(message));
|
||||||
};
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return new Box();
|
return new Box();
|
||||||
|
|
|
@ -115,6 +115,7 @@ entitySlider.prototype = {
|
||||||
var endOfAxis;
|
var endOfAxis;
|
||||||
var properties = {
|
var properties = {
|
||||||
type: 'Line',
|
type: 'Line',
|
||||||
|
name: 'Hifi-Slider-Axis::'+this.sliderType,
|
||||||
color: this.color,
|
color: this.color,
|
||||||
collisionsWillMove: false,
|
collisionsWillMove: false,
|
||||||
ignoreForCollisions: true,
|
ignoreForCollisions: true,
|
||||||
|
@ -135,6 +136,7 @@ entitySlider.prototype = {
|
||||||
this.axis = Entities.addEntity(properties);
|
this.axis = Entities.addEntity(properties);
|
||||||
},
|
},
|
||||||
createBoxIndicator: function() {
|
createBoxIndicator: function() {
|
||||||
|
print('BOX COLOR IS:::'+JSON.stringify(this.color));
|
||||||
var position = Vec3.sum(this.basePosition, this.verticalOffset);
|
var position = Vec3.sum(this.basePosition, this.verticalOffset);
|
||||||
|
|
||||||
//line starts on left and goes to right
|
//line starts on left and goes to right
|
||||||
|
@ -163,6 +165,7 @@ entitySlider.prototype = {
|
||||||
var endOfAxis = Vec3.sum(position, extension);
|
var endOfAxis = Vec3.sum(position, extension);
|
||||||
var properties = {
|
var properties = {
|
||||||
type: 'Box',
|
type: 'Box',
|
||||||
|
name: 'Hifi-Slider::'+this.sliderType,
|
||||||
dimensions: BOX_DIMENSIONS,
|
dimensions: BOX_DIMENSIONS,
|
||||||
color: this.color,
|
color: this.color,
|
||||||
position: endOfAxis,
|
position: endOfAxis,
|
||||||
|
|
Loading…
Reference in a new issue