single spawner tank

This commit is contained in:
James B. Pollack 2016-03-28 11:44:11 -07:00
parent 19a8fa82e3
commit 774cf8f42f
3 changed files with 19 additions and 2 deletions

View file

@ -26,6 +26,7 @@
collisionWithEntity: function(myID, otherID, collisionInfo) {
var otherProps = Entities.getEntityProperties(otherID);
if (otherProps.name = "hifi-home-dressing-room-transformer-collider" && _this.locked === false) {
var myProps = Entities.getEntityProperties(myID);
var distance = Vec3.distance(myProps.position, otherProps.position);
@ -131,6 +132,7 @@
delete littleVersionProps.localPosition;
delete littleVersionProps.localRotation;
delete littleVersionProps.naturalPosition;
// delete littleVersionProps.script;
var userData = JSON.parse(littleVersionProps.userData);
var basePosition = userData["hifiHomeTransformerKey"].basePosition;

View file

@ -1,11 +1,14 @@
var TRANSFORMER_SCRIPT = Script.resolvePath('transformer.js?' + Math.random());
var AVATAR_COLLISION_HULL='http://hifi-content.s3.amazonaws.com/DomainContent/Home/dressingRoom/Avatar-Hull.obj';
// var SHRINK_AMOUNT = 1 / 2;
TransformerDoll = function(modelURL, spawnPosition, spawnRotation, dimensions) {
print('SCRIPT REF AT TRANSFORMER CREATE::' + TRANSFORMER_SCRIPT);
var transformerProps = {
name: 'hifi-home-dressing-room-little-transformer',
type: 'Model',
shapeType: 'box',
shapeType: 'compound',
compoundShapeURL:AVATAR_COLLISION_HULL,
position: spawnPosition,
rotation: Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z),
modelURL: modelURL,
@ -15,7 +18,7 @@
y: -5,
z: 0
},
visible: false,
visible: true,
damping: 0.8,
userData: JSON.stringify({
'grabbableKey': {

View file

@ -0,0 +1,12 @@
var fishTankPath = Script.resolvePath('wrapper.js?' + Math.random());
Script.include(fishTankPath);
var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0,
y: 0.5,
z: 0
}), Vec3.multiply(0.5, Quat.getFront(Camera.getOrientation())));
var fishTank = new FishTank(center, {
x: 0,
y: 123,
z: 0
});