Move things around
This commit is contained in:
parent
1c0fbafead
commit
ea351cb098
@ -1,6 +1,13 @@
|
||||
namespace animationStation {
|
||||
|
||||
|
||||
/**
|
||||
* Utilize this class to more easily animate entities and players.
|
||||
*/
|
||||
export interface AnimatedEntity extends ObjectRef {
|
||||
/** 0.0 - 1.0 */
|
||||
animationProgress: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* AnimationStation is a model container to make procedural animation easier.
|
||||
@ -10,4 +17,15 @@ namespace animationStation {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Automatically injects a player with the proper animation variables.
|
||||
*/
|
||||
utility.registerInjectionFunction((player: ObjectRef) => {
|
||||
let oldSelf = getmetatable(player) as any;
|
||||
if (oldSelf != null) {
|
||||
oldSelf.animationProgress = 0;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
@ -12,11 +12,18 @@ namespace playerModel {
|
||||
-Leg_Right
|
||||
*/
|
||||
|
||||
interface AnimatedEntity extends ObjectRef {
|
||||
minetest.register_globalstep((delta: number) => {
|
||||
for (let player of minetest.get_connected_players()) {
|
||||
print(player.get_player_name());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//! End this debug mess!!!
|
||||
|
||||
minetest.register_on_joinplayer((player: ObjectRef) => {
|
||||
|
||||
|
||||
player.set_properties({
|
||||
mesh: "character.b3d",
|
||||
textures: ["character.png"],
|
||||
@ -24,28 +31,5 @@ namespace playerModel {
|
||||
visual_size: vector.create3d(1, 1, 1)
|
||||
});
|
||||
|
||||
// player.set_animation(vector.create2d(0, 79), 30, 0, true);
|
||||
|
||||
// print(dump(player.get_bone_override("bone").rotation?.absolute));
|
||||
// print(dump(player.get_bone_overrides()));
|
||||
|
||||
player.set_bone_override("Head", {
|
||||
rotation: {
|
||||
vec: vector.create3d(0, 0.1, 0),
|
||||
interpolation: 0,
|
||||
absolute: false,
|
||||
}
|
||||
});
|
||||
|
||||
minetest.after(3, () => {
|
||||
player.set_bone_override("Head", {
|
||||
rotation: {
|
||||
vec: vector.create3d(0, math.pi / 2, 0),
|
||||
interpolation: 0.5,
|
||||
absolute: false,
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user