Skip to content

Commit

Permalink
Merge pull request #39 from AleziaKurdis/FixDopplegangerPosition
Browse files Browse the repository at this point in the history
Fix doppleganger height positioning issue
  • Loading branch information
ksuprynowicz authored Oct 5, 2023
2 parents 98d13ac + 565eb71 commit c13d210
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions applications/doppelganger-mirror/doppleganger.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Doppleganger.prototype = {
}

this.frame = 0;
this.position = options.position || Vec3.sum(avatar.position, Quat.getForward(avatar.orientation));
this.position = options.feetPosition || Vec3.sum(avatar.feetPosition, Quat.getForward(avatar.orientation));
this.orientation = options.orientation || avatar.orientation;
this.skeletonModelURL = avatar.skeletonModelURL;
this.jointStateCount = 0;
Expand All @@ -189,7 +189,8 @@ Doppleganger.prototype = {
visible: false, // normally false
modelURL: this.skeletonModelURL, //was field: url
position: this.position,
rotation: this.orientation
rotation: this.orientation,
useOriginalPivot: true
};

this.entityID = Entities.addEntity(prop, "local");
Expand Down
5 changes: 3 additions & 2 deletions tutorial/doppleganger.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Doppleganger.prototype = {
}

this.frame = 0;
this.position = options.position || Vec3.sum(avatar.position, Quat.getForward(avatar.orientation));
this.position = options.feetPosition || Vec3.sum(avatar.feetPosition, Quat.getForward(avatar.orientation));
this.orientation = options.orientation || avatar.orientation;
this.skeletonModelURL = avatar.skeletonModelURL;
this.jointStateCount = 0;
Expand All @@ -189,7 +189,8 @@ Doppleganger.prototype = {
visible: false, // normally false
modelURL: this.skeletonModelURL, //was field: url
position: this.position,
rotation: this.orientation
rotation: this.orientation,
useOriginalPivot: true
};

this.entityID = Entities.addEntity(prop, "local");
Expand Down

0 comments on commit c13d210

Please sign in to comment.