From 29c4b6ac7a27effbd314d358734744182cd80d5e Mon Sep 17 00:00:00 2001 From: cesarpachon Date: Tue, 29 Dec 2015 14:09:17 -0500 Subject: [PATCH 1/2] fixing lowercase issue on loader of Hero.js to make it works on linux filesystem --- src/web/js/kaiopua/sections/Launcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/js/kaiopua/sections/Launcher.js b/src/web/js/kaiopua/sections/Launcher.js index 4d9b3e4a..9fee6054 100644 --- a/src/web/js/kaiopua/sections/Launcher.js +++ b/src/web/js/kaiopua/sections/Launcher.js @@ -64,7 +64,7 @@ "js/kaiopua/env/Skybox.js", "js/kaiopua/env/Water.js", "js/kaiopua/utils/ObjectHelper.js", - { path: shared.pathToAsset + "hero.js", type: 'model' }, + { path: shared.pathToAsset + "Hero.js", type: 'model' }, shared.pathToAsset + "skybox_world_posx.jpg", shared.pathToAsset + "skybox_world_negx.jpg", shared.pathToAsset + "skybox_world_posy.jpg", @@ -355,4 +355,4 @@ } -} ( KAIOPUA ) ); \ No newline at end of file +} ( KAIOPUA ) ); From c852dc9ad1aa5ad8808d2c4cfbb4f123c73bf034 Mon Sep 17 00:00:00 2001 From: cesarpachon Date: Tue, 29 Dec 2015 16:01:08 -0500 Subject: [PATCH 2/2] fixing bug when turning character --- src/web/js/kaiopua/core/Character.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/web/js/kaiopua/core/Character.js b/src/web/js/kaiopua/core/Character.js index 22b34607..c91b9cba 100644 --- a/src/web/js/kaiopua/core/Character.js +++ b/src/web/js/kaiopua/core/Character.js @@ -518,7 +518,6 @@ rotate = movement.rotate, rotateFacingDirection = rotate.facingDirection, forwardBack; - // handle state property if ( state.hasOwnProperty( propertyName ) ) { @@ -715,7 +714,7 @@ state.moving = false; } - + // update movement moveDir.z = state.movingHorizontal ? 1 : 0; @@ -724,7 +723,6 @@ rotateTurnAngleDelta = ( state.right === 1 ? -state.right : state.left ) * rotate.turnSpeed; rotateFacingAngleDelta = _VectorHelper.signed_angle_between_coplanar_vectors( rotateFacingDirectionLast, rotateFacingDirection, rotateAxis ) * rotateLerpDelta; - // if moving if ( state.movingHorizontal === true ) { @@ -747,7 +745,10 @@ // rotate by direction angle change if ( rotateFacingAngleDelta !== 0 ) { - + + //maybe need to convert to degrees.. + rotateFacingAngleDelta = rotateFacingAngleDelta * Math.PI /180; + rotateFacingAngleTarget = _MathHelper.degree_between_180( rotate.facingAngle + rotateFacingAngleDelta ); rotateFacingAngleDeltaShortest = _MathHelper.shortest_rotation_between_angles( rotate.facingAngle, rotateFacingAngleTarget ); rotateDelta.setFromAxisAngle( rotateAxis, rotateFacingAngleDeltaShortest ); @@ -1000,4 +1001,4 @@ } -} ( KAIOPUA ) ); \ No newline at end of file +} ( KAIOPUA ) );