63 lines
No EOL
1.7 KiB
JavaScript
63 lines
No EOL
1.7 KiB
JavaScript
(function() {
|
|
|
|
var _this;
|
|
var jointArr = ["Head", "Hips"];
|
|
var particleEntities = [];
|
|
var Ent;
|
|
var jointID = MyAvatar.jointNames.indexOf("Hips");
|
|
|
|
var Bubble = function() {
|
|
_this = this;
|
|
}
|
|
|
|
Bubble.prototype = {
|
|
entityID: null,
|
|
enterEntity: function(entityID) {
|
|
print("Entered!")
|
|
|
|
Ent = Entities.addEntity({
|
|
type: 'Sphere',
|
|
name: MyAvatar.sessionUUID + 'privacy bubble',
|
|
position: Vec3.sum(MyAvatar.getAbsoluteJointRotationInObjectFrame(jointID), MyAvatar.position),
|
|
parentID: MyAvatar.sessionUUID,
|
|
parentJointIndex: jointID,
|
|
|
|
position: MyAvatar.getJointPosition("Hips"),
|
|
color: {
|
|
red: 0,
|
|
green: 0,
|
|
blue: 255
|
|
},
|
|
dimensions: {
|
|
x: 2,
|
|
y: 2,
|
|
z: 2
|
|
},
|
|
visible: 0,
|
|
collidesWith: "static,dynamic,kinematic,otherAvatar",
|
|
collisionMask: 2,
|
|
collisionsWillMove: 1,
|
|
density: 1,
|
|
angularDamping: 1,
|
|
damping: 1,
|
|
friction: 0,
|
|
restitution: 0,
|
|
dynamic: false
|
|
|
|
})
|
|
},
|
|
leaveEntity: function(entityID) {
|
|
|
|
print("Entity: " + JSON.stringify(Ent))
|
|
Entities.editEntity(Ent, {
|
|
parentID: ''
|
|
})
|
|
Entities.deleteEntity(Ent)
|
|
print("Exited!")
|
|
}
|
|
|
|
};
|
|
|
|
return new Bubble();
|
|
|
|
}); |