no more js

This commit is contained in:
2025-12-17 00:49:13 -06:00
parent 9e2ba03dec
commit 5669866ac6
7 changed files with 52 additions and 41 deletions

View File

@@ -3,6 +3,7 @@
var time_mod = use('time')
var lance3d = use('core')
var math = use('math/radians')
// Camera orbit state
var cam_distance = 5
@@ -107,9 +108,9 @@ function _draw() {
lance3d.camera_perspective(60, 0.1, 100)
// Calculate camera position from orbit
var cam_x = Math.sin(cam_yaw) * Math.cos(cam_pitch) * cam_distance
var cam_y = Math.sin(cam_pitch) * cam_distance + 0.5
var cam_z = Math.cos(cam_yaw) * Math.cos(cam_pitch) * cam_distance
var cam_x = math.sine(cam_yaw) * math.cosine(cam_pitch) * cam_distance
var cam_y = math.sine(cam_pitch) * cam_distance + 0.5
var cam_z = math.cosine(cam_yaw) * math.cosine(cam_pitch) * cam_distance
lance3d.camera_look_at(cam_x, cam_y, cam_z, 0, 0.5, 0)

View File

@@ -4,6 +4,7 @@
var time_mod = use('time')
var lance3d = use('core')
var math = use('math/radians')
// Meshes
var ground_mesh = null
@@ -104,12 +105,12 @@ function _update(dt) {
if (forward != 0 || right != 0) {
// Update yaw based on movement direction
player.yaw = Math.atan2(forward, -right)
player.yaw = math.arc_tangent(forward, -right)
var fx = Math.sin(player.yaw)
var fz = Math.cos(player.yaw)
var fx = math.sine(player.yaw)
var fz = math.cosine(player.yaw)
var len = Math.sqrt(fx * fx + fz * fz)
var len = math.sqrt(fx * fx + fz * fz)
if (len > 0) {
fx /= len
fz /= len

View File

@@ -6,6 +6,7 @@
var io = use('fd')
var time_mod = use('time')
var lance3d = use('core')
var math = use('math/radians')
log.console(lance3d.key)
@@ -193,9 +194,9 @@ function _draw() {
lance3d.camera_perspective(60, 0.1, 100)
// Calculate camera position from orbit
var cam_x = Math.sin(cam_yaw) * Math.cos(cam_pitch) * cam_distance
var cam_y = Math.sin(cam_pitch) * cam_distance + cam_target_y
var cam_z = Math.cos(cam_yaw) * Math.cos(cam_pitch) * cam_distance
var cam_x = math.sine(cam_yaw) * math.cosine(cam_pitch) * cam_distance
var cam_y = math.sine(cam_pitch) * cam_distance + cam_target_y
var cam_z = math.cosine(cam_yaw) * math.cosine(cam_pitch) * cam_distance
lance3d.camera_look_at(cam_x, cam_y, cam_z, 0, cam_target_y, 0)