mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 06:23:35 +02:00
Merge pull request #3459 from Atlante45/JS_hook_for_recordings
Added JS hooks for new Player options
This commit is contained in:
commit
255d9346bb
4 changed files with 48 additions and 5 deletions
|
@ -12,6 +12,10 @@
|
||||||
// Set the following variables to the values needed
|
// Set the following variables to the values needed
|
||||||
var filename = "http://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/bartender.rec";
|
var filename = "http://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/bartender.rec";
|
||||||
var playFromCurrentLocation = true;
|
var playFromCurrentLocation = true;
|
||||||
|
var useDisplayName = true;
|
||||||
|
var useAttachments = true;
|
||||||
|
var useHeadModel = true;
|
||||||
|
var useSkeletonModel = true;
|
||||||
|
|
||||||
// ID of the agent. Two agents can't have the same ID.
|
// ID of the agent. Two agents can't have the same ID.
|
||||||
var id = 0;
|
var id = 0;
|
||||||
|
@ -44,11 +48,15 @@ COLORS[SHOW] = { red: SHOW, green: 0, blue: 0 };
|
||||||
COLORS[HIDE] = { red: HIDE, green: 0, blue: 0 };
|
COLORS[HIDE] = { red: HIDE, green: 0, blue: 0 };
|
||||||
|
|
||||||
controlVoxelPosition.x += id * controlVoxelSize;
|
controlVoxelPosition.x += id * controlVoxelSize;
|
||||||
|
|
||||||
Avatar.setPlayFromCurrentLocation(playFromCurrentLocation);
|
|
||||||
|
|
||||||
Avatar.loadRecording(filename);
|
Avatar.loadRecording(filename);
|
||||||
|
|
||||||
|
Avatar.setPlayFromCurrentLocation(playFromCurrentLocation);
|
||||||
|
Avatar.setPlayerUseDisplayName(useDisplayName);
|
||||||
|
Avatar.setPlayerUseAttachments(useAttachments);
|
||||||
|
Avatar.setPlayerUseHeadModel(useHeadModel);
|
||||||
|
Avatar.setPlayerUseSkeletonModel(useSkeletonModel);
|
||||||
|
|
||||||
function setupVoxelViewer() {
|
function setupVoxelViewer() {
|
||||||
var voxelViewerOffset = 10;
|
var voxelViewerOffset = 10;
|
||||||
var voxelViewerPosition = JSON.parse(JSON.stringify(controlVoxelPosition));
|
var voxelViewerPosition = JSON.parse(JSON.stringify(controlVoxelPosition));
|
||||||
|
|
|
@ -12,7 +12,14 @@
|
||||||
Script.include("toolBars.js");
|
Script.include("toolBars.js");
|
||||||
|
|
||||||
var recordingFile = "recording.rec";
|
var recordingFile = "recording.rec";
|
||||||
var playFromCurrentLocation = true;
|
|
||||||
|
function setPlayerOptions() {
|
||||||
|
MyAvatar.setPlayFromCurrentLocation(true);
|
||||||
|
MyAvatar.setPlayerUseDisplayName(false);
|
||||||
|
MyAvatar.setPlayerUseAttachments(false);
|
||||||
|
MyAvatar.setPlayerUseHeadModel(false);
|
||||||
|
MyAvatar.setPlayerUseSkeletonModel(false);
|
||||||
|
}
|
||||||
|
|
||||||
var windowDimensions = Controller.getViewportDimensions();
|
var windowDimensions = Controller.getViewportDimensions();
|
||||||
var TOOL_ICON_URL = "http://s3-us-west-1.amazonaws.com/highfidelity-public/images/tools/";
|
var TOOL_ICON_URL = "http://s3-us-west-1.amazonaws.com/highfidelity-public/images/tools/";
|
||||||
|
@ -186,7 +193,7 @@ function mousePressEvent(event) {
|
||||||
toolBar.setAlpha(ALPHA_ON, saveIcon);
|
toolBar.setAlpha(ALPHA_ON, saveIcon);
|
||||||
toolBar.setAlpha(ALPHA_ON, loadIcon);
|
toolBar.setAlpha(ALPHA_ON, loadIcon);
|
||||||
} else if (MyAvatar.playerLength() > 0) {
|
} else if (MyAvatar.playerLength() > 0) {
|
||||||
MyAvatar.setPlayFromCurrentLocation(playFromCurrentLocation);
|
setPlayerOptions();
|
||||||
MyAvatar.setPlayerLoop(false);
|
MyAvatar.setPlayerLoop(false);
|
||||||
MyAvatar.startPlaying();
|
MyAvatar.startPlaying();
|
||||||
toolBar.setAlpha(ALPHA_OFF, recordIcon);
|
toolBar.setAlpha(ALPHA_OFF, recordIcon);
|
||||||
|
@ -201,7 +208,7 @@ function mousePressEvent(event) {
|
||||||
toolBar.setAlpha(ALPHA_ON, saveIcon);
|
toolBar.setAlpha(ALPHA_ON, saveIcon);
|
||||||
toolBar.setAlpha(ALPHA_ON, loadIcon);
|
toolBar.setAlpha(ALPHA_ON, loadIcon);
|
||||||
} else if (MyAvatar.playerLength() > 0) {
|
} else if (MyAvatar.playerLength() > 0) {
|
||||||
MyAvatar.setPlayFromCurrentLocation(playFromCurrentLocation);
|
setPlayerOptions();
|
||||||
MyAvatar.setPlayerLoop(true);
|
MyAvatar.setPlayerLoop(true);
|
||||||
MyAvatar.startPlaying();
|
MyAvatar.startPlaying();
|
||||||
toolBar.setAlpha(ALPHA_OFF, recordIcon);
|
toolBar.setAlpha(ALPHA_OFF, recordIcon);
|
||||||
|
|
|
@ -661,6 +661,30 @@ void AvatarData::setPlayerLoop(bool loop) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AvatarData::setPlayerUseDisplayName(bool useDisplayName) {
|
||||||
|
if(_player) {
|
||||||
|
_player->useDisplayName(useDisplayName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AvatarData::setPlayerUseAttachments(bool useAttachments) {
|
||||||
|
if(_player) {
|
||||||
|
_player->useAttachements(useAttachments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AvatarData::setPlayerUseHeadModel(bool useHeadModel) {
|
||||||
|
if(_player) {
|
||||||
|
_player->useHeadModel(useHeadModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AvatarData::setPlayerUseSkeletonModel(bool useSkeletonModel) {
|
||||||
|
if(_player) {
|
||||||
|
_player->useSkeletonModel(useSkeletonModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void AvatarData::play() {
|
void AvatarData::play() {
|
||||||
if (isPlaying()) {
|
if (isPlaying()) {
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
|
|
|
@ -302,6 +302,10 @@ public slots:
|
||||||
void startPlaying();
|
void startPlaying();
|
||||||
void setPlayFromCurrentLocation(bool playFromCurrentLocation);
|
void setPlayFromCurrentLocation(bool playFromCurrentLocation);
|
||||||
void setPlayerLoop(bool loop);
|
void setPlayerLoop(bool loop);
|
||||||
|
void setPlayerUseDisplayName(bool useDisplayName);
|
||||||
|
void setPlayerUseAttachments(bool useAttachments);
|
||||||
|
void setPlayerUseHeadModel(bool useHeadModel);
|
||||||
|
void setPlayerUseSkeletonModel(bool useSkeletonModel);
|
||||||
void play();
|
void play();
|
||||||
void stopPlaying();
|
void stopPlaying();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue