This commit is contained in:
2026-05-06 17:52:45 -07:00
parent 9fc3f35125
commit 1463c23334
402 changed files with 3758 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package lnx;
import iron.object.Object;
import iron.Scene;
import iron.math.Quat;
class CameraTrait extends iron.Trait {
var cube:Object;
public function new() {
super();
notifyOnInit(function() {
cube = Scene.active.getChild("Cube");
});
notifyOnUpdate(function() {
if(cube.transform.rot != object.transform.rot){
var newRot = new Quat().lerp(cube.transform.rot, object.transform.rot, 0.9);
object.transform.rot.setFrom(newRot);
object.transform.buildMatrix();
}
});
}
}

View File

@ -0,0 +1,23 @@
package lnx;
import iron.system.Input;
import iron.math.Vec4;
import iron.system.Time;
class MyTrait extends iron.Trait {
public function new() {
super();
notifyOnUpdate(function() {
var kb = Input.getKeyboard();
if(kb.down("a") || kb.down("left")){
object.transform.rotate(new Vec4(0,0,1), -3 * Time.delta);
} else if(kb.down("d") || kb.down("right")){
object.transform.rotate(new Vec4(0,0,1), 3 * Time.delta);
}
});
}
}