123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
-
- ---
- extends: http://vwf.example.com/node.vwf
- properties:
-
-
-
-
- instructionText: ""
-
-
-
-
- actionText: ""
-
-
-
-
-
- cameraPoseRef:
-
-
-
-
- active:
- set: |
- this.active = value;
- value: false
- methods:
-
-
-
-
- begin:
-
-
-
-
- complete:
- events:
-
-
-
-
- entered:
-
-
-
-
- exited:
- scripts:
- - |
- this.begin = function() {
- // If a camera pose has been specified for this instruction, move the camera to it
- if ( this.cameraPoseRef ) {
- var cameraPoseSearchResults = this.find( this.cameraPoseRef );
- if ( cameraPoseSearchResults && cameraPoseSearchResults.length ) {
- var newCameraPose = cameraPoseSearchResults[ 0 ];
- if ( newCameraPose.translation && newCameraPose.quaternion ) {
- var scene = this.find( "/" )[ 0 ];
- var camera = scene.camera;
- if ( camera ) {
- var duration = 2;
- camera.translateTo( newCameraPose.translation, duration );
- camera.quaterniateTo( newCameraPose.quaternion, duration );
- }
- else
- console.error( "Could not find camera - make sure the scene derives from navScene.vwf or another component " +
- "that defines a valid camera" );
- }
- else
- console.error( "Camera pose '" + this.cameraPoseRef + "' is not a valid node3" );
- }
- else
- console.error( "Could not find camera pose: " + this.cameraPoseRef + " - will not move camera" );
- }
- // Fire event signifying that instruction has been entered
- this.entered( this.instructionText, this.actionText );
- }
- this.complete = function() {
- this.exited();
- } //@ sourceURL=instruction.vwf
|