Add new animations. Prepare code for animation implementation.
This commit is contained in:
parent
f5e2a711ce
commit
94bc80d9df
Binary file not shown.
Binary file not shown.
@ -1,3 +1,3 @@
|
|||||||
#
|
#
|
||||||
#Thu Jun 13 01:11:59 KST 2019
|
#Thu Jun 13 01:32:08 KST 2019
|
||||||
ORIGINAL_PATH=Models/Archer_finalrig/Archer_finalrig.obj
|
ORIGINAL_PATH=Models/Archer_finalrig/Archer_finalrig.mesh.xml
|
||||||
|
Binary file not shown.
@ -1,3 +0,0 @@
|
|||||||
#
|
|
||||||
#Thu Jun 13 01:32:08 KST 2019
|
|
||||||
ORIGINAL_PATH=Models/Archer_finalrig/Archer_finalrig.mesh.xml
|
|
32
SigDN/src/mygame/GenericFunctions.java
Normal file
32
SigDN/src/mygame/GenericFunctions.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package mygame;
|
||||||
|
|
||||||
|
import com.jme3.asset.AssetManager;
|
||||||
|
import com.jme3.scene.Spatial;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Joshua Sigona
|
||||||
|
*/
|
||||||
|
public class GenericFunctions {
|
||||||
|
/**
|
||||||
|
* Specify a model name. Returns the entire path.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String ModelName(String name) {
|
||||||
|
StringBuilder sb = new StringBuilder("Models/")
|
||||||
|
.append(name)
|
||||||
|
.append("/")
|
||||||
|
.append(name)
|
||||||
|
.append(".j3o");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Spatial LoadModel(AssetManager assetManager, String name) {
|
||||||
|
return (Spatial)(assetManager.loadModel(ModelName(name)));
|
||||||
|
}
|
||||||
|
}
|
@ -26,7 +26,7 @@ import com.jme3.scene.Node;
|
|||||||
* @author normenhansen
|
* @author normenhansen
|
||||||
*/
|
*/
|
||||||
public class Main extends SimpleApplication implements
|
public class Main extends SimpleApplication implements
|
||||||
AnimEventListener{
|
AnimEventListener, ActionListener{
|
||||||
public static Main game;
|
public static Main game;
|
||||||
private AnimChannel channel;
|
private AnimChannel channel;
|
||||||
private AnimControl control;
|
private AnimControl control;
|
||||||
@ -61,7 +61,7 @@ public class Main extends SimpleApplication implements
|
|||||||
dl2.setColor(new ColorRGBA(1f, 1f, 1f, 0.5f));
|
dl2.setColor(new ColorRGBA(1f, 1f, 1f, 0.5f));
|
||||||
dl2.setDirection(new Vector3f(0.1f, -0.7f, -1).normalizeLocal());
|
dl2.setDirection(new Vector3f(0.1f, -0.7f, -1).normalizeLocal());
|
||||||
rootNode.addLight(dl2);
|
rootNode.addLight(dl2);
|
||||||
Spatial Archer = (Spatial) assetManager.loadModel("Models/Archer_finalrig/Archer_finalrig.mesh.j3o");
|
Spatial Archer = (Spatial) assetManager.loadModel("Models/Archer_finalrig/Archer_finalrig.j3o");
|
||||||
float scale = 0.05f;
|
float scale = 0.05f;
|
||||||
Archer.scale(scale, scale, scale);
|
Archer.scale(scale, scale, scale);
|
||||||
|
|
||||||
@ -97,10 +97,10 @@ public class Main extends SimpleApplication implements
|
|||||||
|
|
||||||
rootNode.attachChild(Archer);
|
rootNode.attachChild(Archer);
|
||||||
//rootNode.attachChild(bow);
|
//rootNode.attachChild(bow);
|
||||||
inputManager.addMapping("Swap Weapon",
|
inputManager.addMapping("Combat Stance",
|
||||||
new KeyTrigger(KeyInput.KEY_SPACE));
|
new KeyTrigger(KeyInput.KEY_TAB));
|
||||||
|
|
||||||
ActionListener actionListener = new ActionListener(){
|
/*ActionListener actionListener = new ActionListener(){
|
||||||
public void onAction(String name, boolean pressed, float tpf){
|
public void onAction(String name, boolean pressed, float tpf){
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
n.detachChild(bow);
|
n.detachChild(bow);
|
||||||
@ -117,14 +117,14 @@ public class Main extends SimpleApplication implements
|
|||||||
n.attachChild(bow);
|
n.attachChild(bow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};*/
|
||||||
|
|
||||||
inputManager.addListener(actionListener, "Swap Weapon");
|
inputManager.addListener(this, "Combat Stance");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void simpleUpdate(float tpf) {
|
public void simpleUpdate(float tpf) {
|
||||||
//TODO: add update code
|
System.out.println(tpf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -139,4 +139,15 @@ public class Main extends SimpleApplication implements
|
|||||||
@Override
|
@Override
|
||||||
public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
|
public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAction(String name, boolean isPressed, float tpf) {
|
||||||
|
switch (name) {
|
||||||
|
case "Combat Stance":{
|
||||||
|
if (isPressed) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
60
SigDN/src/mygame/character/CharacterRig.java
Normal file
60
SigDN/src/mygame/character/CharacterRig.java
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package mygame.character;
|
||||||
|
|
||||||
|
import com.jme3.animation.AnimChannel;
|
||||||
|
import com.jme3.animation.AnimControl;
|
||||||
|
import com.jme3.animation.SkeletonControl;
|
||||||
|
import com.jme3.scene.Node;
|
||||||
|
import com.jme3.scene.Spatial;
|
||||||
|
import mygame.GenericFunctions;
|
||||||
|
import mygame.Main;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Joshua Sigona
|
||||||
|
*/
|
||||||
|
public class CharacterRig extends Main{
|
||||||
|
Spatial character;
|
||||||
|
String[] topbones; //Controlled only by top motion. Anything not specified here is bottom control.
|
||||||
|
AnimChannel top_channel,bot_channel;
|
||||||
|
AnimControl control;
|
||||||
|
SkeletonControl skeleton;
|
||||||
|
|
||||||
|
Node primary_hand,secondary_hand,torso;
|
||||||
|
|
||||||
|
Spatial weapon;
|
||||||
|
|
||||||
|
boolean combat_stance=false;
|
||||||
|
|
||||||
|
//Combat stance
|
||||||
|
|
||||||
|
CharacterRig(String model,String... topbones) {
|
||||||
|
this.character = GenericFunctions.LoadModel(assetManager,model);
|
||||||
|
this.topbones = topbones;
|
||||||
|
|
||||||
|
control = character.getControl(AnimControl.class);
|
||||||
|
control.addListener(Main.game);
|
||||||
|
bot_channel = control.createChannel();
|
||||||
|
top_channel = control.createChannel();
|
||||||
|
|
||||||
|
SkeletonControl skeleton = character.getControl(SkeletonControl.class);
|
||||||
|
|
||||||
|
primary_hand = skeleton.getAttachmentsNode("Left Wrist");
|
||||||
|
secondary_hand = skeleton.getAttachmentsNode("Right Wrist");
|
||||||
|
torso = skeleton.getAttachmentsNode("Torso");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWeapon(Spatial weapon) {
|
||||||
|
this.weapon=weapon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void update(float tpf) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
BIN
archer_skill_siegestance_01_foot.wav
Normal file
BIN
archer_skill_siegestance_01_foot.wav
Normal file
Binary file not shown.
BIN
archer_skill_siegestance_02_foot.wav
Normal file
BIN
archer_skill_siegestance_02_foot.wav
Normal file
Binary file not shown.
BIN
archer_skill_siegestance_03_charge.wav
Normal file
BIN
archer_skill_siegestance_03_charge.wav
Normal file
Binary file not shown.
BIN
archer_skill_siegestance_04_fire.wav
Normal file
BIN
archer_skill_siegestance_04_fire.wav
Normal file
Binary file not shown.
BIN
archer_skill_spyralvoltex_01_intro.wav
Normal file
BIN
archer_skill_spyralvoltex_01_intro.wav
Normal file
Binary file not shown.
BIN
dragon nest_bgm_80lv_stage1.ogg
Normal file
BIN
dragon nest_bgm_80lv_stage1.ogg
Normal file
Binary file not shown.
BIN
dragon nest_bgm_battle_guardian_boss.ogg
Normal file
BIN
dragon nest_bgm_battle_guardian_boss.ogg
Normal file
Binary file not shown.
BIN
dragon nest_bgm_field_alteia.ogg
Normal file
BIN
dragon nest_bgm_field_alteia.ogg
Normal file
Binary file not shown.
BIN
dragon nest_bgm_field_anuarendel.ogg
Normal file
BIN
dragon nest_bgm_field_anuarendel.ogg
Normal file
Binary file not shown.
BIN
player_archer2_skna_01_a.wav
Normal file
BIN
player_archer2_skna_01_a.wav
Normal file
Binary file not shown.
BIN
player_archer2_skna_01_b.wav
Normal file
BIN
player_archer2_skna_01_b.wav
Normal file
Binary file not shown.
BIN
player_archer2_skna_34_a.wav
Normal file
BIN
player_archer2_skna_34_a.wav
Normal file
Binary file not shown.
BIN
player_archer2_sksp_43_k.wav
Normal file
BIN
player_archer2_sksp_43_k.wav
Normal file
Binary file not shown.
BIN
player_archer2_so_13_g.wav
Normal file
BIN
player_archer2_so_13_g.wav
Normal file
Binary file not shown.
BIN
player_archer2_social_01_a.wav
Normal file
BIN
player_archer2_social_01_a.wav
Normal file
Binary file not shown.
BIN
player_archer2_social_01_b.wav
Normal file
BIN
player_archer2_social_01_b.wav
Normal file
Binary file not shown.
BIN
player_archer3_bvh_01_a.ogg
Normal file
BIN
player_archer3_bvh_01_a.ogg
Normal file
Binary file not shown.
BIN
player_archer4_sksp01_01.ogg
Normal file
BIN
player_archer4_sksp01_01.ogg
Normal file
Binary file not shown.
BIN
player_archer4_sksp04_03.ogg
Normal file
BIN
player_archer4_sksp04_03.ogg
Normal file
Binary file not shown.
BIN
player_archer_bva_01_a.wav
Normal file
BIN
player_archer_bva_01_a.wav
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user