How to use the angular-cesium.GeoUtilsService.pointByLocationDistanceAndAzimuth function in angular-cesium

To help you get started, we’ve selected a few angular-cesium examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Webiks / GeoStrike / packages / client / src / app / game / views / game-map / keyboard-control / keyboard-control.component.ts View on Github external
action: () => {
        const position = this.character.location;
        let speed = environment.movement.walkingSpeed;

        if (this.character.state === MeModelState.RUNNING) {
          speed = environment.movement.runningSpeed;
        }
        if (this.character.isCrawling) {
          speed = environment.movement.crawlingSpeed;
        }

        const nextLocation = GeoUtilsService.pointByLocationDistanceAndAzimuth(
          position,
          speed,
          Cesium.Math.toRadians(this.character.heading + delta),
          true
        );
        if (this.character.enteredBuilding) {
          if (!this.collisionDetector.detectCollision(nextLocation, true)) {
            this.character.location = nextLocation;
          }
        }
        else if (direction !== MoveDirection.Forward) {
          this.character.location = nextLocation;
          if (this.collisionDetector.collision) {
            this.collisionDetector.detectCollision(nextLocation, true);
          }
        }