diff --git a/archery/README.md b/archery/README.md new file mode 100644 index 0000000..9270d89 --- /dev/null +++ b/archery/README.md @@ -0,0 +1,6 @@ +First-person archery template. + +- Click the canvas to lock the mouse; Escape to release. +- WASD to move, Shift to run, Space to jump, mouse to look. +- Left mouse button to draw and shoot arrows. +- Keys 1 and 2 adjust the time scale. diff --git a/archery/Sources/lnx/FirstPersonController.hx b/archery/Sources/lnx/FirstPersonController.hx index 366e23d..803a8c9 100644 --- a/archery/Sources/lnx/FirstPersonController.hx +++ b/archery/Sources/lnx/FirstPersonController.hx @@ -82,15 +82,13 @@ class FirstPersonController extends CameraController { function updateBones() { // Fetch bone - var bone1 = anim.getBone("mixamorig:LeftForeLnx"); - var bone2 = anim.getBone("mixamorig:RightForeLnx"); + var bone1 = anim.getBone("mixamorig:LeftForeArm"); + var bone2 = anim.getBone("mixamorig:RightForeArm"); // Fetch bone matrix - this is in local bone space for now - var m1 = anim.getBoneMat(bone1); - var m2 = anim.getBoneMat(bone2); - var m1b = anim.getBoneMatBlend(bone1); - var m2b = anim.getBoneMatBlend(bone2); - var a1 = anim.getAbsMat(bone1.parent); - var a2 = anim.getAbsMat(bone2.parent); + var m1 = anim.getBoneMat(anim.skeletonMats, bone1); + var m2 = anim.getBoneMat(anim.skeletonMats, bone2); + var a1 = anim.getWorldMat(anim.skeletonMats, bone1.parent).clone(); + var a2 = anim.getWorldMat(anim.skeletonMats, bone2.parent).clone(); // Rotate hand bones to aim with gun // Some raw math follows.. @@ -124,36 +122,6 @@ class FirstPersonController extends CameraController { m2._31 = ty; m2._32 = tz; - // Animation blending is in progress, we need to rotate those bones too - if (m1b != null && m2b != null) { - var tx = m1b._30; - var ty = m1b._31; - var tz = m1b._32; - m1b._30 = 0; - m1b._31 = 0; - m1b._32 = 0; - mat.getInverse(a1); - q.fromAxisAngle(mat.right(), angle); - m1b.applyQuat(q); - m1b._30 = tx; - m1b._31 = ty; - m1b._32 = tz; - - var tx = m2b._30; - var ty = m2b._31; - var tz = m2b._32; - m2b._30 = 0; - m2b._31 = 0; - m2b._32 = 0; - mat.getInverse(a2); - var v = mat.right(); - v.mult(-1); - q.fromAxisAngle(v, -angle / 3.0); - m2b.applyQuat(q); - m2b._30 = tx; - m2b._31 = ty; - m2b._32 = tz; - } } function update() { diff --git a/archery/archery.blend b/archery/archery.blend index 467a88b..14862b9 100644 Binary files a/archery/archery.blend and b/archery/archery.blend differ diff --git a/first_person/README.md b/first_person/README.md new file mode 100644 index 0000000..17ca8da --- /dev/null +++ b/first_person/README.md @@ -0,0 +1,5 @@ +First-person shooter template with physics. + +- Click the canvas to lock the mouse; Escape to release. +- WASD to move, Shift to run, Space to jump, mouse to look. +- Left mouse button to fire. diff --git a/first_person/Sources/lnx/FirstPersonController.hx b/first_person/Sources/lnx/FirstPersonController.hx index abbf422..2c3e658 100644 --- a/first_person/Sources/lnx/FirstPersonController.hx +++ b/first_person/Sources/lnx/FirstPersonController.hx @@ -76,16 +76,14 @@ class FirstPersonController extends CameraController { function updateBones() { // Fetch bone - var bone1 = anim.getBone("mixamorig:LeftForeLnx"); - var bone2 = anim.getBone("mixamorig:RightForeLnx"); + var bone1 = anim.getBone("mixamorig:LeftForeArm"); + var bone2 = anim.getBone("mixamorig:RightForeArm"); // Fetch bone matrix - this is in local bone space for now - var m1 = anim.getBoneMat(bone1); - var m2 = anim.getBoneMat(bone2); - var m1b = anim.getBoneMatBlend(bone1); - var m2b = anim.getBoneMatBlend(bone2); - var a1 = anim.getAbsMat(bone1.parent); - var a2 = anim.getAbsMat(bone2.parent); + var m1 = anim.getBoneMat(anim.skeletonMats, bone1); + var m2 = anim.getBoneMat(anim.skeletonMats, bone2); + var a1 = anim.getWorldMat(anim.skeletonMats, bone1.parent).clone(); + var a2 = anim.getWorldMat(anim.skeletonMats, bone2.parent).clone(); // Rotate hand bones to aim with gun // Some raw math follows.. @@ -119,37 +117,6 @@ class FirstPersonController extends CameraController { m2._31 = ty; m2._32 = tz; - // Animation blending is in progress, we need to rotate those bones too - if (m1b != null && m2b != null) { - var tx = m1b._30; - var ty = m1b._31; - var tz = m1b._32; - m1b._30 = 0; - m1b._31 = 0; - m1b._32 = 0; - mat.getInverse(a1); - q.fromAxisAngle(mat.right(), -angle); - m1b.applyQuat(q); - m1b._30 = tx; - m1b._31 = ty; - m1b._32 = tz; - - var tx = m2b._30; - var ty = m2b._31; - var tz = m2b._32; - m2b._30 = 0; - m2b._31 = 0; - m2b._32 = 0; - mat.getInverse(a2); - var v = mat.right(); - v.mult(-1); - q.fromAxisAngle(v, -1.6); - // q.fromAxisAngle(v, angle); - m2b.applyQuat(q); - m2b._30 = tx; - m2b._31 = ty; - m2b._32 = tz; - } } function preUpdate() { diff --git a/first_person/first_person.blend b/first_person/first_person.blend index a8e39fa..e6b9ced 100644 Binary files a/first_person/first_person.blend and b/first_person/first_person.blend differ diff --git a/platformer/README.md b/platformer/README.md new file mode 100644 index 0000000..9f3fdd5 --- /dev/null +++ b/platformer/README.md @@ -0,0 +1,5 @@ +Third-person platformer template. + +- Click the canvas to lock the mouse; Escape to release. +- WASD to move, Shift to run, Space to jump, mouse to orbit the camera. +- Collect the gems. diff --git a/platformer/platformer.blend b/platformer/platformer.blend index 307b5e7..dab2ca3 100644 Binary files a/platformer/platformer.blend and b/platformer/platformer.blend differ diff --git a/race_track/README.md b/race_track/README.md new file mode 100644 index 0000000..4b53691 --- /dev/null +++ b/race_track/README.md @@ -0,0 +1,4 @@ +Vehicle driving template with a lap timer. + +- WASD / arrow keys to drive the car. +- Drive through the checkpoints to time your lap. diff --git a/race_track/race_track.blend b/race_track/race_track.blend index 05ca393..77e3da2 100644 Binary files a/race_track/race_track.blend and b/race_track/race_track.blend differ diff --git a/third_person/README.md b/third_person/README.md new file mode 100644 index 0000000..8f7be24 --- /dev/null +++ b/third_person/README.md @@ -0,0 +1,5 @@ +Third-person shooter template. + +- Click the canvas to lock the mouse; Escape to release. +- WASD to move, Shift to run, Space to jump, mouse to orbit the camera. +- Left mouse button to fire. diff --git a/third_person/Sources/lnx/ThirdPersonController.hx b/third_person/Sources/lnx/ThirdPersonController.hx index 29c7405..3962157 100644 --- a/third_person/Sources/lnx/ThirdPersonController.hx +++ b/third_person/Sources/lnx/ThirdPersonController.hx @@ -75,16 +75,14 @@ class ThirdPersonController extends CameraController { function updateBones() { // Fetch bone - var bone1 = anim.getBone("mixamorig:LeftForeLnx"); - var bone2 = anim.getBone("mixamorig:RightForeLnx"); + var bone1 = anim.getBone("mixamorig:LeftForeArm"); + var bone2 = anim.getBone("mixamorig:RightForeArm"); // Fetch bone matrix - this is in local bone space for now - var m1 = anim.getBoneMat(bone1); - var m2 = anim.getBoneMat(bone2); - var m1b = anim.getBoneMatBlend(bone1); - var m2b = anim.getBoneMatBlend(bone2); - var a1 = anim.getAbsMat(bone1.parent); - var a2 = anim.getAbsMat(bone2.parent); + var m1 = anim.getBoneMat(anim.skeletonMats, bone1); + var m2 = anim.getBoneMat(anim.skeletonMats, bone2); + var a1 = anim.getWorldMat(anim.skeletonMats, bone1.parent).clone(); + var a2 = anim.getWorldMat(anim.skeletonMats, bone2.parent).clone(); // Rotate hand bones to aim with gun // Some raw math follows.. @@ -116,36 +114,6 @@ class ThirdPersonController extends CameraController { m2._31 = ty; m2._32 = tz; - // Animation blending is in progress, we need to rotate those bones too - if (m1b != null && m2b != null) { - var tx = m1b._30; - var ty = m1b._31; - var tz = m1b._32; - m1b._30 = 0; - m1b._31 = 0; - m1b._32 = 0; - mat.getInverse(a1); - q.fromAxisAngle(mat.right(), -angle); - m1b.applyQuat(q); - m1b._30 = tx; - m1b._31 = ty; - m1b._32 = tz; - - var tx = m2b._30; - var ty = m2b._31; - var tz = m2b._32; - m2b._30 = 0; - m2b._31 = 0; - m2b._32 = 0; - mat.getInverse(a2); - var v = mat.right(); - v.mult(-1); - q.fromAxisAngle(v, angle); - m2b.applyQuat(q); - m2b._30 = tx; - m2b._31 = ty; - m2b._32 = tz; - } } function preUpdate() { diff --git a/third_person/third_person.blend b/third_person/third_person.blend index 1334147..d1513f8 100644 Binary files a/third_person/third_person.blend and b/third_person/third_person.blend differ diff --git a/third_person_terrain/Sources/lnx/ThirdPersonController.hx b/third_person_terrain/Sources/lnx/ThirdPersonController.hx index 29c7405..3962157 100644 --- a/third_person_terrain/Sources/lnx/ThirdPersonController.hx +++ b/third_person_terrain/Sources/lnx/ThirdPersonController.hx @@ -75,16 +75,14 @@ class ThirdPersonController extends CameraController { function updateBones() { // Fetch bone - var bone1 = anim.getBone("mixamorig:LeftForeLnx"); - var bone2 = anim.getBone("mixamorig:RightForeLnx"); + var bone1 = anim.getBone("mixamorig:LeftForeArm"); + var bone2 = anim.getBone("mixamorig:RightForeArm"); // Fetch bone matrix - this is in local bone space for now - var m1 = anim.getBoneMat(bone1); - var m2 = anim.getBoneMat(bone2); - var m1b = anim.getBoneMatBlend(bone1); - var m2b = anim.getBoneMatBlend(bone2); - var a1 = anim.getAbsMat(bone1.parent); - var a2 = anim.getAbsMat(bone2.parent); + var m1 = anim.getBoneMat(anim.skeletonMats, bone1); + var m2 = anim.getBoneMat(anim.skeletonMats, bone2); + var a1 = anim.getWorldMat(anim.skeletonMats, bone1.parent).clone(); + var a2 = anim.getWorldMat(anim.skeletonMats, bone2.parent).clone(); // Rotate hand bones to aim with gun // Some raw math follows.. @@ -116,36 +114,6 @@ class ThirdPersonController extends CameraController { m2._31 = ty; m2._32 = tz; - // Animation blending is in progress, we need to rotate those bones too - if (m1b != null && m2b != null) { - var tx = m1b._30; - var ty = m1b._31; - var tz = m1b._32; - m1b._30 = 0; - m1b._31 = 0; - m1b._32 = 0; - mat.getInverse(a1); - q.fromAxisAngle(mat.right(), -angle); - m1b.applyQuat(q); - m1b._30 = tx; - m1b._31 = ty; - m1b._32 = tz; - - var tx = m2b._30; - var ty = m2b._31; - var tz = m2b._32; - m2b._30 = 0; - m2b._31 = 0; - m2b._32 = 0; - mat.getInverse(a2); - var v = mat.right(); - v.mult(-1); - q.fromAxisAngle(v, angle); - m2b.applyQuat(q); - m2b._30 = tx; - m2b._31 = ty; - m2b._32 = tz; - } } function preUpdate() { diff --git a/third_person_terrain/third_person_terrain.blend b/third_person_terrain/third_person_terrain.blend index e522707..23c9076 100644 Binary files a/third_person_terrain/third_person_terrain.blend and b/third_person_terrain/third_person_terrain.blend differ diff --git a/top_down/Bundled/config.lnx b/top_down/Bundled/config.lnx index 55a0a52..d2096bf 100644 --- a/top_down/Bundled/config.lnx +++ b/top_down/Bundled/config.lnx @@ -1,11 +1,16 @@ { "rp_bloom": true, + "rp_chromatic_aberration": true, "rp_dynres": false, - "rp_gi": true, + "rp_fsr1": false, + "rp_fsr1_sharpness": 0.25, + "rp_gi": false, "rp_motionblur": false, "rp_shadowmap_cascade": 2048, "rp_shadowmap_cube": 512, - "rp_ssgi": true, + "rp_ss_refraction": true, + "rp_ssao": true, + "rp_ssgi": false, "rp_ssr": true, "rp_supersample": 1.0, "window_h": 720, diff --git a/top_down/README.md b/top_down/README.md new file mode 100644 index 0000000..3b29ac5 --- /dev/null +++ b/top_down/README.md @@ -0,0 +1,4 @@ +Top-down shooter template. + +- WASD to move, mouse to aim. +- Left mouse button to fire. diff --git a/top_down/top_down.blend b/top_down/top_down.blend index d2993cb..8e8fc42 100644 Binary files a/top_down/top_down.blend and b/top_down/top_down.blend differ diff --git a/twin_stick/README.md b/twin_stick/README.md new file mode 100644 index 0000000..2ef3ec4 --- /dev/null +++ b/twin_stick/README.md @@ -0,0 +1,4 @@ +Twin-stick shooter template. + +- WASD to move, mouse (or gamepad right stick) to aim. +- Left mouse button to fire. diff --git a/twin_stick/twin_stick.blend b/twin_stick/twin_stick.blend index d2cb07c..d4f1ea4 100644 Binary files a/twin_stick/twin_stick.blend and b/twin_stick/twin_stick.blend differ