Skip to content

Commit

Permalink
deprecate getGlobalScale for globalScale getter
Browse files Browse the repository at this point in the history
deprecate getGlobalRotation for globalRotation getter
  • Loading branch information
mattjennings committed Apr 7, 2024
1 parent 229c10c commit 3c7b786
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -11,7 +11,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Deprecated

- `actor.getGlobalPos()` - use `Actor.globalPos` instead
- `actor.getGlobalPos()` - use `actor.globalPos` instead
- `actor.getGlobalRotation()` - use `actor.globalRotation` instead
- `actor.getGlobalScale()` - use `actor.globalScale` instead

### Added

Expand Down
17 changes: 17 additions & 0 deletions src/engine/Actor.ts
Expand Up @@ -842,11 +842,19 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia
/**
* Gets this actor's rotation taking into account any parent relationships
* @returns Rotation angle in radians
* @deprecated Use [[globalRotation]] instead
*/
public getGlobalRotation(): number {
return this.get(TransformComponent).globalRotation;
}

/**
* The actor's rotation (in radians) taking into account any parent relationships
*/
public get globalRotation(): number {
return this.get(TransformComponent).globalRotation;
}

/**
* Gets an actor's world position taking into account parent relationships, scaling, rotation, and translation
* @returns Position in world coordinates
Expand All @@ -865,11 +873,20 @@ export class Actor extends Entity implements Eventable, PointerEvents, CanInitia

/**
* Gets the global scale of the Actor
* @deprecated Use [[globalScale]] instead
*/
public getGlobalScale(): Vector {
return this.get(TransformComponent).globalScale;
}

/**
* The global scale of the Actor
*/
public get globalScale(): Vector {
return this.get(TransformComponent).globalScale;
}


// #region Collision

/**
Expand Down

0 comments on commit 3c7b786

Please sign in to comment.