Skip to content

Commit

Permalink
fixed assets issue and strafe bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ssatguru committed Apr 26, 2020
1 parent 61fb3fe commit ea4adf1
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/CharacterController.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/CharacterController.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/CharacterController.max.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/CharacterController.max.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babylonjs-charactercontroller",
"version": "0.4.0",
"version": "0.4.1",
"description": "A CharacterController for BabylonJS",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/CharacterController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,13 +635,13 @@ export class CharacterController {
case (this._act._stepLeft):
sign = this._signRHS * this._isAvFacingCamera();
this._moveVector = this._avatar.calcMovePOV(sign * (this._leftSpeed * dt), -this._freeFallDist, 0);
anim = (sign > 0) ? this._strafeLeft : this._strafeRight;
anim = (-this._ffSign * sign > 0) ? this._strafeLeft : this._strafeRight;
moving = true;
break;
case (this._act._stepRight):
sign = -this._signRHS * this._isAvFacingCamera();
this._moveVector = this._avatar.calcMovePOV(sign * (this._rightSpeed * dt), -this._freeFallDist, 0);
anim = (sign > 0) ? this._strafeLeft : this._strafeRight;
anim = (-this._ffSign * sign > 0) ? this._strafeLeft : this._strafeRight;
moving = true;
}

Expand Down
Binary file modified tst/player/Vincent-frontFacing.glb
Binary file not shown.
Binary file removed tst/player/Vincent.glb
Binary file not shown.
6 changes: 3 additions & 3 deletions tst/testAnimationGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function main() {
}

function loadPlayer(scene, engine, canvas) {
BABYLON.SceneLoader.ImportMesh("", "player/", "Vincent-backFacing.glb", scene, (meshes, particleSystems, skeletons) => {
BABYLON.SceneLoader.ImportMesh("", "player/", "Vincent.glb", scene, (meshes, particleSystems, skeletons) => {
var player = meshes[0];

player.position = new BABYLON.Vector3(0, 12, 0);
Expand Down Expand Up @@ -91,8 +91,8 @@ function loadPlayer(scene, engine, canvas) {
}
allAGs[0].stop();

var cc = new CharacterController(player, camera, scene, agMap, false);
cc.setMode(1);
var cc = new CharacterController(player, camera, scene, agMap, true);
cc.setMode(0);
//below makes the controller point the camera at the player head which is approx
//1.5m above the player origin
cc.setCameraTarget(new BABYLON.Vector3(0, 1.5, 0));
Expand Down
4 changes: 2 additions & 2 deletions tst/testCommandControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function main() {
var cc;

function loadPlayer(scene, engine, canvas) {
BABYLON.SceneLoader.ImportMesh("", "player/", "Vincent-frontFacing.babylon", scene, (meshes, particleSystems, skeletons) => {
BABYLON.SceneLoader.ImportMesh("", "player/", "Vincent-backFacing.babylon", scene, (meshes, particleSystems, skeletons) => {
var player = meshes[0];
var skeleton = skeletons[0];
player.skeleton = skeleton;
Expand Down Expand Up @@ -80,7 +80,7 @@ function loadPlayer(scene, engine, canvas) {
camera.attachControl(canvas, false);

cc = new CharacterController(player, camera, scene);
cc.setFaceForward(true);
cc.setFaceForward(false);
cc.setMode(0);
cc.setTurnSpeed(45);
//below makes the controller point the camera at the player head which is approx
Expand Down

0 comments on commit ea4adf1

Please sign in to comment.