mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 23:09:52 +02:00
dynamically grab animation URL as model URL from model
This commit is contained in:
parent
5a3ef34d1e
commit
51ad631c54
1 changed files with 4 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
(function(){
|
(function(){
|
||||||
var teleport;
|
var teleport;
|
||||||
var portalDestination;
|
var portalDestination;
|
||||||
|
var animationURL;
|
||||||
|
|
||||||
function playSound() {
|
function playSound() {
|
||||||
Audio.playSound(teleport, { volume: 0.40, localOnly: true });
|
Audio.playSound(teleport, { volume: 0.40, localOnly: true });
|
||||||
|
@ -11,6 +12,7 @@
|
||||||
|
|
||||||
var properties = Entities.getEntityProperties(entityID);
|
var properties = Entities.getEntityProperties(entityID);
|
||||||
portalDestination = properties.userData;
|
portalDestination = properties.userData;
|
||||||
|
animationURL = properties.modelURL;
|
||||||
|
|
||||||
print("The portal destination is " + portalDestination);
|
print("The portal destination is " + portalDestination);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +27,7 @@
|
||||||
|
|
||||||
this.leaveEntity = function(entityID) {
|
this.leaveEntity = function(entityID) {
|
||||||
Entities.editEntity(entityID, {
|
Entities.editEntity(entityID, {
|
||||||
animationURL: "http://hifi-public.s3.amazonaws.com/models/content/phonebooth.fbx",
|
animationURL: animationURL,
|
||||||
animationSettings: '{ "frameIndex": 1, "running": false }'
|
animationSettings: '{ "frameIndex": 1, "running": false }'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -34,7 +36,7 @@
|
||||||
|
|
||||||
this.hoverEnterEntity = function(entityID) {
|
this.hoverEnterEntity = function(entityID) {
|
||||||
Entities.editEntity(entityID, {
|
Entities.editEntity(entityID, {
|
||||||
animationURL: "http://hifi-public.s3.amazonaws.com/models/content/phonebooth.fbx",
|
animationURL: animationURL,
|
||||||
animationSettings: '{ "fps": 24, "firstFrame": 1, "lastFrame": 25, "frameIndex": 1, "running": true, "hold": true }'
|
animationSettings: '{ "fps": 24, "firstFrame": 1, "lastFrame": 25, "frameIndex": 1, "running": true, "hold": true }'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue