Last active
September 21, 2020 08:15
-
-
Save flushpot1125/772eb739b26a1005dae7383f0e2ce903 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { UniversalCamera, Mesh } from "@babylonjs/core"; | |
import {gsap } from "gsap"; | |
import {fromScene} from "../tools"; | |
export default class CameraComponent extends UniversalCamera { | |
@fromScene("node-0_primitive13") | |
private _wall13 : Mesh; | |
public onStart(): void { | |
var tl = gsap.timeline({repeat: 2, repeatDelay: 1}); | |
tl.to(this.position, {x:0,y:6,z: 20, duration: 3}); // leave from the "_wall13 during 3 sec" | |
tl.to(this.position, {x:-9,y:3,z: 7, duration: 5}); // approaching the "_wall13 during 5 sec" | |
this.lockedTarget = this._wall13; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment