mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-06 05:42:49 +02:00
add support for ignore radius from agent scripts
This commit is contained in:
parent
157dc1475b
commit
8dc41ca8b9
3 changed files with 12 additions and 0 deletions
|
@ -31,6 +31,7 @@
|
|||
#include <ScriptCache.h>
|
||||
#include <ScriptEngines.h>
|
||||
#include <SoundCache.h>
|
||||
#include <UsersScriptingInterface.h>
|
||||
#include <UUID.h>
|
||||
|
||||
#include <recording/ClipCache.h>
|
||||
|
@ -75,6 +76,8 @@ Agent::Agent(ReceivedMessage& message) :
|
|||
DependencyManager::set<ScriptEngines>(ScriptEngine::AGENT_SCRIPT);
|
||||
|
||||
DependencyManager::set<RecordingScriptingInterface>();
|
||||
DependencyManager::set<UsersScriptingInterface>();
|
||||
|
||||
|
||||
auto& packetReceiver = DependencyManager::get<NodeList>()->getPacketReceiver();
|
||||
|
||||
|
@ -351,6 +354,10 @@ void Agent::executeScript() {
|
|||
// give this AvatarData object to the script engine
|
||||
_scriptEngine->registerGlobalObject("Avatar", scriptedAvatar.data());
|
||||
|
||||
// give scripts access to the Users object
|
||||
_scriptEngine->registerGlobalObject("Users", DependencyManager::get<UsersScriptingInterface>().data());
|
||||
|
||||
|
||||
auto player = DependencyManager::get<recording::Deck>();
|
||||
connect(player.data(), &recording::Deck::playbackStateChanged, [=] {
|
||||
if (player->isPlaying()) {
|
||||
|
|
|
@ -126,6 +126,8 @@ Vec3.print("RANDOM LOCATION SELECTED:", LOCATION);
|
|||
var playFromCurrentLocation = true;
|
||||
var loop = true;
|
||||
|
||||
// Disable the privacy bubble
|
||||
Users.disableIgnoreRadius();
|
||||
|
||||
// Set position here if playFromCurrentLocation is true
|
||||
Avatar.position = LOCATION;
|
||||
|
|
|
@ -20,6 +20,9 @@ Avatar.orientation = Quat.fromPitchYawRollDegrees(0, 0, 0);
|
|||
Avatar.scale = 1.0;
|
||||
Agent.isAvatar = true;
|
||||
|
||||
// Disable the privacy bubble
|
||||
Users.disableIgnoreRadius();
|
||||
|
||||
Recording.loadRecording(recordingFile, function(success) {
|
||||
if (success) {
|
||||
Script.update.connect(update);
|
||||
|
|
Loading…
Reference in a new issue