22 lines
No EOL
972 B
JavaScript
22 lines
No EOL
972 B
JavaScript
(function() {
|
|
var SEAT_COUNT = 4;
|
|
var SEAT_CUBE_DIMENSION = 0.5;
|
|
var seats = [];
|
|
var seatProp = {
|
|
type: "Box",
|
|
position: MyAvatar.position,
|
|
rotation: MyAvatar.orientation,
|
|
dimensions: {x:SEAT_CUBE_DIMENSION, y:SEAT_CUBE_DIMENSION, z:SEAT_CUBE_DIMENSION},
|
|
registrationPoint: {x:0.5, y:1.2, z:0.5},
|
|
primitiveMode: "lines",
|
|
script: "https://hifi-content.s3.amazonaws.com/luis/test_scripts/Sitting/sitClientV2.js",
|
|
serverScripts: "https://hifi-content.s3.amazonaws.com/luis/test_scripts/Sitting/sitServerV2.js"
|
|
}
|
|
var frontVector = Quat.getFront(MyAvatar.orientation);
|
|
for (var i = 0; i < SEAT_COUNT; i++) {
|
|
seatProp.rotation = Quat.angleAxis(45*i, {x:0, y:1, z:0});
|
|
seatProp.position = Vec3.sum(MyAvatar.position, Vec3.multiply(frontVector, 2.0 * (i + 1)));
|
|
var seat = Entities.addEntity(seatProp);
|
|
seats.push(seat);
|
|
}
|
|
})() |