lid stuff

This commit is contained in:
James B. Pollack 2016-04-05 15:54:13 -07:00
parent 40be28a916
commit 738d3d249b
3 changed files with 19 additions and 9 deletions

View file

@ -1712,12 +1712,17 @@ function MyController(hand) {
modTypes.push('roll')
}
var safeEuler = Quat.safeEulerAngles(grabbedProps.rotation);
print('SAFE EULER FOR ROTAITON IS:: ' + JSON.stringify(safeEuler))
finalRotation = {
x: 0,
y: 0,
z: 0
}
finalRotation = safeEuler;
modTypes.forEach(function(modType) {
var value = handPosition[constraints.rotationMod[modType].startingAxis];

View file

@ -168,13 +168,14 @@
var LATERAL_OFFSET = 0.0;
var hatOffset = getOffsetFromCenter(VERTICAL_OFFSET, FORWARD_OFFSET, LATERAL_OFFSET)
var upOffset = Vec3.sum({
x: 0,
y: hatHeight,
z: 0
}, hatOffset)
var baseProps = Entities.getEntityProperties(this.base);
var upOffset = Vec3.multiply(hatHeight,Quat.getUp(baseProps.rotation));
var hatPosition = Vec3.sum(hatOffset, upOffset)
Entities.editEntity(this.hat, {
position: upOffset
position: hatPosition
})
},

View file

@ -159,7 +159,7 @@ HomeMusicBox = function(spawnPosition, spawnRotation) {
name: 'home_music_box_key',
type: 'Model',
parentID: baseID,
angularDamping:1,
angularDamping: 1,
angularVelocity: {
x: 0,
y: 0,
@ -187,9 +187,10 @@ HomeMusicBox = function(spawnPosition, spawnRotation) {
modelURL: "atp:/MB_Box.fbx",
name: 'home_music_box_base',
type: 'Model',
shapeType:'box',
position: BASE_POSITION,
dynamic:true,
dynamic: true,
shapeType: 'compound',
compoundShapeURL: 'atp:/boxHull2.obj',
dimensions: {
x: 0.1661,
y: 0.0928,
@ -198,6 +199,9 @@ HomeMusicBox = function(spawnPosition, spawnRotation) {
userData: JSON.stringify({
'hifiHomeKey': {
'reset': true
},
grabbableKey: {
disableReleaseVelocity: true
}
})
}