Compare commits

5 Commits
main ... main

Author SHA1 Message Date
0bf69bc565 Update README.md 2026-10-25 19:40:43 +00:00
5974912a25 Update Templates 2026-10-25 12:37:57 -07:00
1f7ab26404 Update .gitignore 2026-05-07 02:15:41 +00:00
6ce585f7d0 Update .gitignore 2026-05-07 02:14:43 +00:00
90770e7fb5 Merge pull request 'Update' (#1) from Onek8/Leenkx_Templates:main into main
Reviewed-on: LeenkxTeam/Leenkx_Templates#1
2026-05-07 02:13:58 +00:00
22 changed files with 68 additions and 159 deletions

4
.gitignore vendored
View File

@ -1,7 +1,7 @@
*/build* */build*
*/*.blend? */*.blend?
*/Sources/Main.hx */Sources/Main.hx
*/Sources/arm/node/* */Sources/lnx/node/*
*/khafile.js */khafile.js
config.arm config.lnx
_themes.json _themes.json

View File

@ -1,5 +1,5 @@
# leenkx_templates # leenkx_templates
Templates to accompany Leenkx SDK. Check out the [manual](https://github.com/leenkx3d/leenkx/wiki). Templates to accompany Leenkx SDK. Check out the [manual](https://leenkx.com/api/manual/index.html).
Note: Download the package from [releases](https://github.com/leenkx3d/leenkx_templates/releases). Only use the latest revision of this repository if you are using [git Leenkx](https://github.com/leenkx3d/leenkx/wiki/gitversion). Note: Download the SDK package from [releases](https://leenkx.com/files/LeenkxSDK_RC.zip). Only use the latest revision of this repository if you are using [git Leenkx](https://leenkx.com/api/dev/gitversion.html).

6
archery/README.md Normal file
View File

@ -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.

View File

@ -82,15 +82,13 @@ class FirstPersonController extends CameraController {
function updateBones() { function updateBones() {
// Fetch bone // Fetch bone
var bone1 = anim.getBone("mixamorig:LeftForeLnx"); var bone1 = anim.getBone("mixamorig:LeftForeArm");
var bone2 = anim.getBone("mixamorig:RightForeLnx"); var bone2 = anim.getBone("mixamorig:RightForeArm");
// Fetch bone matrix - this is in local bone space for now // Fetch bone matrix - this is in local bone space for now
var m1 = anim.getBoneMat(bone1); var m1 = anim.getBoneMat(anim.skeletonMats, bone1);
var m2 = anim.getBoneMat(bone2); var m2 = anim.getBoneMat(anim.skeletonMats, bone2);
var m1b = anim.getBoneMatBlend(bone1); var a1 = anim.getWorldMat(anim.skeletonMats, bone1.parent).clone();
var m2b = anim.getBoneMatBlend(bone2); var a2 = anim.getWorldMat(anim.skeletonMats, bone2.parent).clone();
var a1 = anim.getAbsMat(bone1.parent);
var a2 = anim.getAbsMat(bone2.parent);
// Rotate hand bones to aim with gun // Rotate hand bones to aim with gun
// Some raw math follows.. // Some raw math follows..
@ -124,36 +122,6 @@ class FirstPersonController extends CameraController {
m2._31 = ty; m2._31 = ty;
m2._32 = tz; 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() { function update() {

Binary file not shown.

5
first_person/README.md Normal file
View File

@ -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.

View File

@ -76,16 +76,14 @@ class FirstPersonController extends CameraController {
function updateBones() { function updateBones() {
// Fetch bone // Fetch bone
var bone1 = anim.getBone("mixamorig:LeftForeLnx"); var bone1 = anim.getBone("mixamorig:LeftForeArm");
var bone2 = anim.getBone("mixamorig:RightForeLnx"); var bone2 = anim.getBone("mixamorig:RightForeArm");
// Fetch bone matrix - this is in local bone space for now // Fetch bone matrix - this is in local bone space for now
var m1 = anim.getBoneMat(bone1); var m1 = anim.getBoneMat(anim.skeletonMats, bone1);
var m2 = anim.getBoneMat(bone2); var m2 = anim.getBoneMat(anim.skeletonMats, bone2);
var m1b = anim.getBoneMatBlend(bone1); var a1 = anim.getWorldMat(anim.skeletonMats, bone1.parent).clone();
var m2b = anim.getBoneMatBlend(bone2); var a2 = anim.getWorldMat(anim.skeletonMats, bone2.parent).clone();
var a1 = anim.getAbsMat(bone1.parent);
var a2 = anim.getAbsMat(bone2.parent);
// Rotate hand bones to aim with gun // Rotate hand bones to aim with gun
// Some raw math follows.. // Some raw math follows..
@ -119,37 +117,6 @@ class FirstPersonController extends CameraController {
m2._31 = ty; m2._31 = ty;
m2._32 = tz; 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() { function preUpdate() {

Binary file not shown.

5
platformer/README.md Normal file
View File

@ -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.

Binary file not shown.

4
race_track/README.md Normal file
View File

@ -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.

Binary file not shown.

5
third_person/README.md Normal file
View File

@ -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.

View File

@ -75,16 +75,14 @@ class ThirdPersonController extends CameraController {
function updateBones() { function updateBones() {
// Fetch bone // Fetch bone
var bone1 = anim.getBone("mixamorig:LeftForeLnx"); var bone1 = anim.getBone("mixamorig:LeftForeArm");
var bone2 = anim.getBone("mixamorig:RightForeLnx"); var bone2 = anim.getBone("mixamorig:RightForeArm");
// Fetch bone matrix - this is in local bone space for now // Fetch bone matrix - this is in local bone space for now
var m1 = anim.getBoneMat(bone1); var m1 = anim.getBoneMat(anim.skeletonMats, bone1);
var m2 = anim.getBoneMat(bone2); var m2 = anim.getBoneMat(anim.skeletonMats, bone2);
var m1b = anim.getBoneMatBlend(bone1); var a1 = anim.getWorldMat(anim.skeletonMats, bone1.parent).clone();
var m2b = anim.getBoneMatBlend(bone2); var a2 = anim.getWorldMat(anim.skeletonMats, bone2.parent).clone();
var a1 = anim.getAbsMat(bone1.parent);
var a2 = anim.getAbsMat(bone2.parent);
// Rotate hand bones to aim with gun // Rotate hand bones to aim with gun
// Some raw math follows.. // Some raw math follows..
@ -116,36 +114,6 @@ class ThirdPersonController extends CameraController {
m2._31 = ty; m2._31 = ty;
m2._32 = tz; 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() { function preUpdate() {

Binary file not shown.

View File

@ -75,16 +75,14 @@ class ThirdPersonController extends CameraController {
function updateBones() { function updateBones() {
// Fetch bone // Fetch bone
var bone1 = anim.getBone("mixamorig:LeftForeLnx"); var bone1 = anim.getBone("mixamorig:LeftForeArm");
var bone2 = anim.getBone("mixamorig:RightForeLnx"); var bone2 = anim.getBone("mixamorig:RightForeArm");
// Fetch bone matrix - this is in local bone space for now // Fetch bone matrix - this is in local bone space for now
var m1 = anim.getBoneMat(bone1); var m1 = anim.getBoneMat(anim.skeletonMats, bone1);
var m2 = anim.getBoneMat(bone2); var m2 = anim.getBoneMat(anim.skeletonMats, bone2);
var m1b = anim.getBoneMatBlend(bone1); var a1 = anim.getWorldMat(anim.skeletonMats, bone1.parent).clone();
var m2b = anim.getBoneMatBlend(bone2); var a2 = anim.getWorldMat(anim.skeletonMats, bone2.parent).clone();
var a1 = anim.getAbsMat(bone1.parent);
var a2 = anim.getAbsMat(bone2.parent);
// Rotate hand bones to aim with gun // Rotate hand bones to aim with gun
// Some raw math follows.. // Some raw math follows..
@ -116,36 +114,6 @@ class ThirdPersonController extends CameraController {
m2._31 = ty; m2._31 = ty;
m2._32 = tz; 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() { function preUpdate() {

View File

@ -1,11 +1,16 @@
{ {
"rp_bloom": true, "rp_bloom": true,
"rp_chromatic_aberration": true,
"rp_dynres": false, "rp_dynres": false,
"rp_gi": true, "rp_fsr1": false,
"rp_fsr1_sharpness": 0.25,
"rp_gi": false,
"rp_motionblur": false, "rp_motionblur": false,
"rp_shadowmap_cascade": 2048, "rp_shadowmap_cascade": 2048,
"rp_shadowmap_cube": 512, "rp_shadowmap_cube": 512,
"rp_ssgi": true, "rp_ss_refraction": true,
"rp_ssao": true,
"rp_ssgi": false,
"rp_ssr": true, "rp_ssr": true,
"rp_supersample": 1.0, "rp_supersample": 1.0,
"window_h": 720, "window_h": 720,

4
top_down/README.md Normal file
View File

@ -0,0 +1,4 @@
Top-down shooter template.
- WASD to move, mouse to aim.
- Left mouse button to fire.

Binary file not shown.

4
twin_stick/README.md Normal file
View File

@ -0,0 +1,4 @@
Twin-stick shooter template.
- WASD to move, mouse (or gamepad right stick) to aim.
- Left mouse button to fire.

Binary file not shown.