Skip to content

Commit

Permalink
fix: lengthunit for relative 2d and 3d position
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximvdw committed Dec 4, 2023
1 parent 6b25578 commit bfa328c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/data/position/Relative2DPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { RelativePosition } from './RelativePosition';
export class Relative2DPosition extends RelativePosition<Vector3, LengthUnit> {
constructor(referenceObject?: any, x?: number, y?: number, unit: LengthUnit = LengthUnit.METER) {
super(referenceObject, new Vector3(), unit);
this.referenceValue.x = unit.convert(x ? x : 0, LengthUnit.METER);
this.referenceValue.y = unit.convert(y ? y : 0, LengthUnit.METER);
this.referenceValue.x = x ? x : 0;
this.referenceValue.y = y ? y : 0;
}

@SerializableMember({
Expand Down
2 changes: 1 addition & 1 deletion src/data/position/Relative3DPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Relative2DPosition } from './Relative2DPosition';
export class Relative3DPosition extends Relative2DPosition {
constructor(referenceObject?: any, x?: number, y?: number, z?: number, unit: LengthUnit = LengthUnit.METER) {
super(referenceObject, x, y, unit);
this.referenceValue.z = unit.convert(z ? z : 0, LengthUnit.METER);
this.referenceValue.z = z ? z : 0;
}

@SerializableMember({
Expand Down

0 comments on commit bfa328c

Please sign in to comment.