Compare commits
No commits in common. "ab17254a023b46fb0df5a3983c542eaeec142fb8" and "3d6b71bf01c5d7249e195c944e208d5946a7f5b9" have entirely different histories.
ab17254a02
...
3d6b71bf01
@ -1,25 +0,0 @@
|
|||||||
@page chemistrydesign Chemistry System Design
|
|
||||||
|
|
||||||
Design notes for the chemistry system
|
|
||||||
|
|
||||||
|
|
||||||
Ideas for the chemistry system:
|
|
||||||
- fire
|
|
||||||
- water
|
|
||||||
- electricity
|
|
||||||
- ice
|
|
||||||
- gravity
|
|
||||||
- stabilization
|
|
||||||
- metal parts / conductivity
|
|
||||||
- light
|
|
||||||
- mirrors
|
|
||||||
- plants burning
|
|
||||||
- plants growing really fast
|
|
||||||
- flight
|
|
||||||
- springiness/catapults (eg tree catapulting something)
|
|
||||||
- spinning mechanisms and gears
|
|
||||||
- weighing things down and measuring scales w/ weight
|
|
||||||
- trampolines
|
|
||||||
- Wind/fans
|
|
||||||
- Weight
|
|
||||||
- Music
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
@page chemistryindex Chemistry
|
|
||||||
|
|
||||||
Pages on the chemistry system
|
|
||||||
|
|
||||||
[TOC]
|
|
||||||
- @subpage chemistrydesign
|
|
||||||
@ -17,6 +17,12 @@ A list of all creatures that are targets for the game, and what their status of
|
|||||||
- [X] Data
|
- [X] Data
|
||||||
|
|
||||||
|
|
||||||
|
## Rat Man
|
||||||
|
- [ ] 3d Model
|
||||||
|
- [ ] Viewmodel
|
||||||
|
- [ ] Data
|
||||||
|
|
||||||
|
|
||||||
## Deer
|
## Deer
|
||||||
- [ ] 3d Model
|
- [ ] 3d Model
|
||||||
- [ ] Data
|
- [ ] Data
|
||||||
@ -45,11 +51,6 @@ A list of all creatures that are targets for the game, and what their status of
|
|||||||
- [ ] Data
|
- [ ] Data
|
||||||
|
|
||||||
|
|
||||||
## Horse
|
|
||||||
- [ ] 3d Model
|
|
||||||
- [ ] Data
|
|
||||||
|
|
||||||
|
|
||||||
## Elf
|
## Elf
|
||||||
- [X] Copy of Human
|
- [X] Copy of Human
|
||||||
- [ ] Attributes 0/?
|
- [ ] Attributes 0/?
|
||||||
@ -62,12 +63,6 @@ A list of all creatures that are targets for the game, and what their status of
|
|||||||
- [ ] Data
|
- [ ] Data
|
||||||
|
|
||||||
|
|
||||||
## Rat Man
|
|
||||||
- [ ] 3d Model
|
|
||||||
- [ ] Viewmodel
|
|
||||||
- [ ] Data
|
|
||||||
|
|
||||||
|
|
||||||
## Frog Man
|
## Frog Man
|
||||||
- [ ] 3d Model
|
- [ ] 3d Model
|
||||||
- [ ] Viewmodel
|
- [ ] Viewmodel
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
@page skeletonprogress Skeleton
|
@page skeletonprogres Skeleton
|
||||||
|
|
||||||
Progress on the skeleton creature
|
Progress on the skeleton creature
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@ Discussion of, at a high game-design level, how everything should work and conne
|
|||||||
- @subpage streamintegrationideas
|
- @subpage streamintegrationideas
|
||||||
- @subpage magicindex
|
- @subpage magicindex
|
||||||
- @subpage creaturesindex
|
- @subpage creaturesindex
|
||||||
- @subpage chemistryindex
|
|
||||||
- @subpage macrosimtimeline
|
- @subpage macrosimtimeline
|
||||||
- @subpage narrativemanager
|
- @subpage narrativemanager
|
||||||
- @subpage itemsindex
|
- @subpage itemsindex
|
||||||
|
|||||||
@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
+ bug fixes
|
+ bug fixes
|
||||||
Fix skeleton right strafe
|
Fix skeleton right strafe
|
||||||
Fix block tree preventing initiating an attack
|
|
||||||
Fix return to title menu synchronization bug
|
Fix return to title menu synchronization bug
|
||||||
|
|
||||||
+ unreproducible bugs
|
+ unreproducible bugs
|
||||||
|
|||||||
@ -796,11 +796,6 @@ New katana icon
|
|||||||
UI fix
|
UI fix
|
||||||
Initial hitstun implementation
|
Initial hitstun implementation
|
||||||
|
|
||||||
(09/18/2024)
|
|
||||||
Migrate documentation
|
|
||||||
Netcode generator qol fixes
|
|
||||||
Combat Stances Component
|
|
||||||
Remove geometry shader support
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
|||||||
@ -636,7 +636,7 @@ public class Globals {
|
|||||||
assetManager.addModelPathToQueue("Models/basic/geometry/unitplane.fbx");
|
assetManager.addModelPathToQueue("Models/basic/geometry/unitplane.fbx");
|
||||||
assetManager.addModelPathToQueue("Models/basic/geometry/unitcube.fbx");
|
assetManager.addModelPathToQueue("Models/basic/geometry/unitcube.fbx");
|
||||||
imagePlaneModelID = assetManager.registerModel(RenderUtils.createPlaneModel("Shaders/core/plane/plane.vs", "Shaders/core/plane/plane.fs"));
|
imagePlaneModelID = assetManager.registerModel(RenderUtils.createPlaneModel("Shaders/core/plane/plane.vs", "Shaders/core/plane/plane.fs"));
|
||||||
assetManager.addShaderToQueue("Shaders/core/plane/plane.vs", "Shaders/core/plane/plane.fs");
|
assetManager.addShaderToQueue("Shaders/core/plane/plane.vs", null, "Shaders/core/plane/plane.fs");
|
||||||
solidPlaneModelID = assetManager.registerModel(RenderUtils.createInWindowPanel("Shaders/ui/plainBox/plainBox.vs", "Shaders/ui/plainBox/plainBox.fs"));
|
solidPlaneModelID = assetManager.registerModel(RenderUtils.createInWindowPanel("Shaders/ui/plainBox/plainBox.vs", "Shaders/ui/plainBox/plainBox.fs"));
|
||||||
|
|
||||||
//image panel
|
//image panel
|
||||||
@ -645,11 +645,11 @@ public class Globals {
|
|||||||
Globals.assetManager.addShaderToQueue("Shaders/ui/plainBox/plainBox.vs", "Shaders/ui/plainBox/plainBox.fs");
|
Globals.assetManager.addShaderToQueue("Shaders/ui/plainBox/plainBox.vs", "Shaders/ui/plainBox/plainBox.fs");
|
||||||
|
|
||||||
//window content shader
|
//window content shader
|
||||||
assetManager.addShaderToQueue("Shaders/ui/windowContent/windowContent.vs", "Shaders/ui/windowContent/windowContent.fs");
|
assetManager.addShaderToQueue("Shaders/ui/windowContent/windowContent.vs", null, "Shaders/ui/windowContent/windowContent.fs");
|
||||||
|
|
||||||
//debug shaders
|
//debug shaders
|
||||||
assetManager.addShaderToQueue("Shaders/ui/debug/windowBorder/windowBound.vs", "Shaders/ui/debug/windowBorder/windowBound.fs");
|
assetManager.addShaderToQueue("Shaders/ui/debug/windowBorder/windowBound.vs", null, "Shaders/ui/debug/windowBorder/windowBound.fs");
|
||||||
assetManager.addShaderToQueue("Shaders/ui/debug/windowContentBorder/windowContentBound.vs", "Shaders/ui/debug/windowContentBorder/windowContentBound.fs");
|
assetManager.addShaderToQueue("Shaders/ui/debug/windowContentBorder/windowContentBound.vs", null, "Shaders/ui/debug/windowContentBorder/windowContentBound.fs");
|
||||||
|
|
||||||
//as these assets are required for the renderer to work, we go ahead and
|
//as these assets are required for the renderer to work, we go ahead and
|
||||||
//load them into memory now. The loading time penalty is worth it I think.
|
//load them into memory now. The loading time penalty is worth it I think.
|
||||||
|
|||||||
@ -120,11 +120,18 @@ public class AssetManager {
|
|||||||
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load shaders");
|
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load shaders");
|
||||||
for(ActorShaderMask currentShader : shadersInQueue){
|
for(ActorShaderMask currentShader : shadersInQueue){
|
||||||
shadersInQueue.remove(currentShader);
|
shadersInQueue.remove(currentShader);
|
||||||
String key = getShaderKey(currentShader.getVertexShaderPath(),currentShader.getFragmentShaderPath());
|
String key = getShaderKey(currentShader.getVertexShaderPath(),currentShader.getGeometryShaderPath(),currentShader.getFragmentShaderPath());
|
||||||
|
if(currentShader.getGeometryShaderPath() == null){
|
||||||
shadersLoadedIntoMemory.put(
|
shadersLoadedIntoMemory.put(
|
||||||
key,
|
key,
|
||||||
ShaderProgram.loadSpecificShader(currentShader.getVertexShaderPath(),currentShader.getFragmentShaderPath())
|
ShaderProgram.loadSpecificShader(currentShader.getVertexShaderPath(),currentShader.getFragmentShaderPath())
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
shadersLoadedIntoMemory.put(
|
||||||
|
key,
|
||||||
|
ShaderProgram.loadSpecificShader(currentShader.getVertexShaderPath(),currentShader.getGeometryShaderPath(),currentShader.getFragmentShaderPath())
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//pose models
|
//pose models
|
||||||
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load pose models");
|
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load pose models");
|
||||||
@ -389,11 +396,15 @@ public class AssetManager {
|
|||||||
//SHADERS
|
//SHADERS
|
||||||
//
|
//
|
||||||
public void addShaderToQueue(String vertexShader, String fragmentShader){
|
public void addShaderToQueue(String vertexShader, String fragmentShader){
|
||||||
shadersInQueue.add(new ActorShaderMask("","",vertexShader,fragmentShader));
|
shadersInQueue.add(new ActorShaderMask("","",vertexShader,null,fragmentShader));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShaderProgram fetchShader(String vertexPath, String fragmentPath){
|
public void addShaderToQueue(String vertexShader, String geometryShader, String fragmentShader){
|
||||||
String path = getShaderKey(vertexPath,fragmentPath);
|
shadersInQueue.add(new ActorShaderMask("","",vertexShader,geometryShader,fragmentShader));
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShaderProgram fetchShader(String vertexPath, String geometryShader, String fragmentPath){
|
||||||
|
String path = getShaderKey(vertexPath,geometryShader,fragmentPath);
|
||||||
ShaderProgram rVal = null;
|
ShaderProgram rVal = null;
|
||||||
if(shadersLoadedIntoMemory.containsKey(path)){
|
if(shadersLoadedIntoMemory.containsKey(path)){
|
||||||
rVal = shadersLoadedIntoMemory.get(path);
|
rVal = shadersLoadedIntoMemory.get(path);
|
||||||
@ -401,8 +412,8 @@ public class AssetManager {
|
|||||||
return rVal;
|
return rVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
static String getShaderKey(String vertexPath, String fragmentPath){
|
static String getShaderKey(String vertexPath, String geometryPath, String fragmentPath){
|
||||||
return vertexPath + "-" + fragmentPath;
|
return vertexPath + "-" + geometryPath + "-" + fragmentPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -411,7 +422,10 @@ public class AssetManager {
|
|||||||
public void forceReloadAllShaders(){
|
public void forceReloadAllShaders(){
|
||||||
for(String shaderKey : shadersLoadedIntoMemory.keySet()){
|
for(String shaderKey : shadersLoadedIntoMemory.keySet()){
|
||||||
String shaderPaths[] = shaderKey.split("-");
|
String shaderPaths[] = shaderKey.split("-");
|
||||||
shadersInQueue.add(new ActorShaderMask("","",shaderPaths[0],shaderPaths[1]));
|
if(shaderPaths[1].equals("null")){
|
||||||
|
shaderPaths[1] = null;
|
||||||
|
}
|
||||||
|
shadersInQueue.add(new ActorShaderMask("","",shaderPaths[0],shaderPaths[1],shaderPaths[2]));
|
||||||
}
|
}
|
||||||
shadersLoadedIntoMemory.clear();
|
shadersLoadedIntoMemory.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -317,12 +317,6 @@ public class EntityDataStrings {
|
|||||||
public static final String TREE_CLIENTWALKTREE = "treeClientWalkTree";
|
public static final String TREE_CLIENTWALKTREE = "treeClientWalkTree";
|
||||||
public static final String TREE_SERVERWALKTREE = "treeServerWalkTree";
|
public static final String TREE_SERVERWALKTREE = "treeServerWalkTree";
|
||||||
|
|
||||||
/**
|
|
||||||
* Weapon stance
|
|
||||||
*/
|
|
||||||
public static final String TREE_CLIENTSTANCECOMPONENT = "treeClientStanceComponent";
|
|
||||||
public static final String TREE_SERVERSTANCECOMPONENT = "treeServerStanceComponent";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Entity categories
|
Entity categories
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -45,10 +45,8 @@ public class ClientSprintTree implements BehaviorTree {
|
|||||||
Entity parent;
|
Entity parent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> Automatically generated </p>
|
* Gets the state of the tree
|
||||||
* <p>
|
* @return The state
|
||||||
* Gets state.
|
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public SprintTreeState getState(){
|
public SprintTreeState getState(){
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
@ -51,10 +51,8 @@ public class ServerSprintTree implements BehaviorTree {
|
|||||||
int staminaCurrent = 0;
|
int staminaCurrent = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> Automatically generated </p>
|
* Gets the state of the tree
|
||||||
* <p>
|
* @return The state of the tree
|
||||||
* Gets state.
|
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public SprintTreeState getState(){
|
public SprintTreeState getState(){
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
@ -217,14 +217,4 @@ public class ClientWalkTree implements BehaviorTree {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Gets state.
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public WalkState getState(){
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,13 +83,11 @@ public class ServerWalkTree implements BehaviorTree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p> Automatically generated </p>
|
* Gets the state
|
||||||
* <p>
|
* @return The state
|
||||||
* Gets state.
|
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public WalkState getState(){
|
public WalkState getState(){
|
||||||
return state;
|
return this.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,206 +0,0 @@
|
|||||||
package electrosphere.entity.state.stance;
|
|
||||||
|
|
||||||
|
|
||||||
import electrosphere.entity.btree.BehaviorTree;
|
|
||||||
import electrosphere.engine.Globals;
|
|
||||||
import electrosphere.entity.EntityDataStrings;
|
|
||||||
import electrosphere.net.synchronization.server.ServerSynchronizationManager;
|
|
||||||
import electrosphere.net.parser.net.message.SynchronizationMessage;
|
|
||||||
import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums;
|
|
||||||
import electrosphere.entity.Entity;
|
|
||||||
import electrosphere.net.synchronization.annotation.SyncedField;
|
|
||||||
import electrosphere.net.synchronization.annotation.SynchronizableEnum;
|
|
||||||
import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tracks the weapon/combat stance of the entity
|
|
||||||
*/
|
|
||||||
@SynchronizedBehaviorTree(
|
|
||||||
name = "clientStanceComponent",
|
|
||||||
isServer = false,
|
|
||||||
correspondingTree = "serverStanceComponent",
|
|
||||||
genStartInt = true
|
|
||||||
)
|
|
||||||
public class ClientStanceComponent implements BehaviorTree {
|
|
||||||
|
|
||||||
@SynchronizableEnum
|
|
||||||
public static enum CombatStance {
|
|
||||||
/**
|
|
||||||
* Not in attacking stance
|
|
||||||
*/
|
|
||||||
IDLE,
|
|
||||||
/**
|
|
||||||
* No weapon equipped, in attacking stance
|
|
||||||
*/
|
|
||||||
UNARMED,
|
|
||||||
/**
|
|
||||||
* Weapon equipped, in attacking stance
|
|
||||||
*/
|
|
||||||
ARMED,
|
|
||||||
}
|
|
||||||
|
|
||||||
@SyncedField
|
|
||||||
CombatStance state = CombatStance.IDLE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The parent entity
|
|
||||||
*/
|
|
||||||
Entity parent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> (initially) Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Attaches this tree to the entity.
|
|
||||||
* </p>
|
|
||||||
* @param entity The entity to attach to
|
|
||||||
* @param tree The behavior tree to attach
|
|
||||||
* @param params Optional parameters that will be provided to the constructor
|
|
||||||
*/
|
|
||||||
public static ClientStanceComponent attachTree(Entity parent, Object ... params){
|
|
||||||
ClientStanceComponent rVal = new ClientStanceComponent(parent,params);
|
|
||||||
//!!WARNING!! from here below should not be touched
|
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
|
||||||
parent.putData(EntityDataStrings.TREE_CLIENTSTANCECOMPONENT, rVal);
|
|
||||||
Globals.clientSceneWrapper.getScene().registerBehaviorTree(rVal);
|
|
||||||
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID);
|
|
||||||
return rVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Detatches this tree from the entity.
|
|
||||||
* </p>
|
|
||||||
* @param entity The entity to detach to
|
|
||||||
* @param tree The behavior tree to detach
|
|
||||||
*/
|
|
||||||
public static void detachTree(Entity entity, BehaviorTree tree){
|
|
||||||
Globals.entityValueTrackingService.detatchTreeFromEntity(entity, BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> (initially) Automatically generated </p>
|
|
||||||
* <p> Private constructor to enforce using the attach methods </p>
|
|
||||||
* <p>
|
|
||||||
* Constructor
|
|
||||||
* </p>
|
|
||||||
* @param parent The parent entity of this tree
|
|
||||||
* @param params Optional parameters that can be provided when attaching the tree. All custom data required for creating this tree should be passed in this varargs.
|
|
||||||
*/
|
|
||||||
public ClientStanceComponent(Entity parent, Object ... params){
|
|
||||||
this.parent = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Gets the ClientStanceComponent of the entity
|
|
||||||
* </p>
|
|
||||||
* @param entity the entity
|
|
||||||
* @return The ClientStanceComponent
|
|
||||||
*/
|
|
||||||
public static ClientStanceComponent getClientStanceComponent(Entity entity){
|
|
||||||
return (ClientStanceComponent)entity.getData(EntityDataStrings.TREE_CLIENTSTANCECOMPONENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Requests that the server start this btree
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public void start(){
|
|
||||||
Globals.clientConnection.queueOutgoingMessage(
|
|
||||||
SynchronizationMessage.constructClientRequestBTreeActionMessage(
|
|
||||||
Globals.clientSceneWrapper.mapClientToServerId(parent.getId()),
|
|
||||||
BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID,
|
|
||||||
ServerSynchronizationManager.SERVER_SYNC_START
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Requests that the server start this btree
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public void interrupt(){
|
|
||||||
Globals.clientConnection.queueOutgoingMessage(
|
|
||||||
SynchronizationMessage.constructClientRequestBTreeActionMessage(
|
|
||||||
Globals.clientSceneWrapper.mapClientToServerId(parent.getId()),
|
|
||||||
BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID,
|
|
||||||
ServerSynchronizationManager.SERVER_SYNC_INTERRUPT
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Sets state and handles the synchronization logic for it.
|
|
||||||
* </p>
|
|
||||||
* @param state The value to set state to.
|
|
||||||
*/
|
|
||||||
public void setState(CombatStance state){
|
|
||||||
this.state = state;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Converts a short to the equivalent enum value
|
|
||||||
* </p>
|
|
||||||
* @param shortVal The short value
|
|
||||||
* @return The enum value
|
|
||||||
*/
|
|
||||||
public static CombatStance getCombatStanceShortAsEnum(short shortVal){
|
|
||||||
switch(shortVal){
|
|
||||||
case 0:
|
|
||||||
return CombatStance.IDLE;
|
|
||||||
case 1:
|
|
||||||
return CombatStance.UNARMED;
|
|
||||||
case 2:
|
|
||||||
return CombatStance.ARMED;
|
|
||||||
default:
|
|
||||||
return CombatStance.IDLE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Converts this enum type to an equivalent short value
|
|
||||||
* </p>
|
|
||||||
* @param enumVal The enum value
|
|
||||||
* @return The short value
|
|
||||||
*/
|
|
||||||
public static short getCombatStanceEnumAsShort(CombatStance enumVal){
|
|
||||||
switch(enumVal){
|
|
||||||
case IDLE:
|
|
||||||
return 0;
|
|
||||||
case UNARMED:
|
|
||||||
return 1;
|
|
||||||
case ARMED:
|
|
||||||
return 2;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void simulate(float deltaTime) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'simulate'");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Gets state.
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public CombatStance getState(){
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,129 +0,0 @@
|
|||||||
package electrosphere.entity.state.stance;
|
|
||||||
|
|
||||||
|
|
||||||
import electrosphere.entity.btree.BehaviorTree;
|
|
||||||
import electrosphere.engine.Globals;
|
|
||||||
import electrosphere.entity.EntityDataStrings;
|
|
||||||
import electrosphere.net.synchronization.enums.FieldIdEnums;
|
|
||||||
import electrosphere.server.datacell.utils.DataCellSearchUtils;
|
|
||||||
import electrosphere.net.parser.net.message.SynchronizationMessage;
|
|
||||||
import electrosphere.net.synchronization.enums.BehaviorTreeIdEnums;
|
|
||||||
import electrosphere.server.datacell.utils.ServerBehaviorTreeUtils;
|
|
||||||
import electrosphere.entity.Entity;
|
|
||||||
import electrosphere.entity.state.stance.ClientStanceComponent.CombatStance;
|
|
||||||
import electrosphere.net.synchronization.annotation.SyncedField;
|
|
||||||
import electrosphere.net.synchronization.annotation.SynchronizedBehaviorTree;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tracks the weapon/combat stance of the entity
|
|
||||||
*/
|
|
||||||
@SynchronizedBehaviorTree(
|
|
||||||
name = "serverStanceComponent",
|
|
||||||
isServer = true,
|
|
||||||
correspondingTree = "clientStanceComponent"
|
|
||||||
)
|
|
||||||
public class ServerStanceComponent implements BehaviorTree {
|
|
||||||
|
|
||||||
@SyncedField
|
|
||||||
CombatStance state = CombatStance.IDLE;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The parent entity of this component
|
|
||||||
*/
|
|
||||||
Entity parent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> (initially) Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Attaches this tree to the entity.
|
|
||||||
* </p>
|
|
||||||
* @param entity The entity to attach to
|
|
||||||
* @param tree The behavior tree to attach
|
|
||||||
* @param params Optional parameters that will be provided to the constructor
|
|
||||||
*/
|
|
||||||
public static ServerStanceComponent attachTree(Entity parent, Object ... params){
|
|
||||||
ServerStanceComponent rVal = new ServerStanceComponent(parent,params);
|
|
||||||
//!!WARNING!! from here below should not be touched
|
|
||||||
//This was generated automatically to properly alert various systems that the btree exists and should be tracked
|
|
||||||
ServerBehaviorTreeUtils.attachBTreeToEntity(parent, rVal);
|
|
||||||
parent.putData(EntityDataStrings.TREE_SERVERSTANCECOMPONENT, rVal);
|
|
||||||
Globals.entityValueTrackingService.attachTreeToEntity(parent, BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID);
|
|
||||||
return rVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Detatches this tree from the entity.
|
|
||||||
* </p>
|
|
||||||
* @param entity The entity to detach to
|
|
||||||
* @param tree The behavior tree to detach
|
|
||||||
*/
|
|
||||||
public static void detachTree(Entity entity, BehaviorTree tree){
|
|
||||||
Globals.entityValueTrackingService.detatchTreeFromEntity(entity, BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> (initially) Automatically generated </p>
|
|
||||||
* <p> Private constructor to enforce using the attach methods </p>
|
|
||||||
* <p>
|
|
||||||
* Constructor
|
|
||||||
* </p>
|
|
||||||
* @param parent The parent entity of this tree
|
|
||||||
* @param params Optional parameters that can be provided when attaching the tree. All custom data required for creating this tree should be passed in this varargs.
|
|
||||||
*/
|
|
||||||
public ServerStanceComponent(Entity parent, Object ... params){
|
|
||||||
this.parent = parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Gets the ServerStanceComponent of the entity
|
|
||||||
* </p>
|
|
||||||
* @param entity the entity
|
|
||||||
* @return The ServerStanceComponent
|
|
||||||
*/
|
|
||||||
public static ServerStanceComponent getServerStanceComponent(Entity entity){
|
|
||||||
return (ServerStanceComponent)entity.getData(EntityDataStrings.TREE_SERVERSTANCECOMPONENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Sets state and handles the synchronization logic for it.
|
|
||||||
* </p>
|
|
||||||
* @param state The value to set state to.
|
|
||||||
*/
|
|
||||||
public void setState(CombatStance state){
|
|
||||||
this.state = state;
|
|
||||||
int value = ClientStanceComponent.getCombatStanceEnumAsShort(state);
|
|
||||||
if(DataCellSearchUtils.getEntityDataCell(parent) != null){
|
|
||||||
DataCellSearchUtils.getEntityDataCell(parent).broadcastNetworkMessage(SynchronizationMessage.constructUpdateClientStateMessage(parent.getId(), BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID, FieldIdEnums.TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID, value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void simulate(float deltaTime) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
throw new UnsupportedOperationException("Unimplemented method 'simulate'");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void start(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void interrupt(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p> Automatically generated </p>
|
|
||||||
* <p>
|
|
||||||
* Gets state.
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public CombatStance getState(){
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,8 +1,8 @@
|
|||||||
package electrosphere.net.synchronization.client;
|
package electrosphere.net.synchronization.client;
|
||||||
|
|
||||||
|
|
||||||
import electrosphere.entity.state.stance.ClientStanceComponent;
|
|
||||||
import electrosphere.entity.state.movement.sprint.ClientSprintTree;
|
import electrosphere.entity.state.movement.sprint.ClientSprintTree;
|
||||||
|
import electrosphere.entity.state.equip.ClientEquipState;
|
||||||
import electrosphere.entity.state.movement.jump.ClientJumpTree;
|
import electrosphere.entity.state.movement.jump.ClientJumpTree;
|
||||||
import electrosphere.entity.state.movement.walk.ClientWalkTree;
|
import electrosphere.entity.state.movement.walk.ClientWalkTree;
|
||||||
import electrosphere.entity.state.life.ClientLifeTree;
|
import electrosphere.entity.state.life.ClientLifeTree;
|
||||||
@ -203,14 +203,6 @@ public class ClientSynchronizationManager {
|
|||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID: {
|
|
||||||
switch(message.getfieldId()){
|
|
||||||
case FieldIdEnums.TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID:{
|
|
||||||
ClientStanceComponent tree = ClientStanceComponent.getClientStanceComponent(entity);
|
|
||||||
tree.setState(ClientStanceComponent.getCombatStanceShortAsEnum((short)message.getbTreeValue()));
|
|
||||||
} break;
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: {
|
case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: {
|
||||||
switch(message.getfieldId()){
|
switch(message.getfieldId()){
|
||||||
case FieldIdEnums.TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID:{
|
case FieldIdEnums.TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID:{
|
||||||
|
|||||||
@ -17,8 +17,6 @@ public class BehaviorTreeIdEnums {
|
|||||||
public static final int BTREE_SERVERIDLE_ID = 9;
|
public static final int BTREE_SERVERIDLE_ID = 9;
|
||||||
public static final int BTREE_CLIENTLIFETREE_ID = 6;
|
public static final int BTREE_CLIENTLIFETREE_ID = 6;
|
||||||
public static final int BTREE_SERVERLIFETREE_ID = 13;
|
public static final int BTREE_SERVERLIFETREE_ID = 13;
|
||||||
public static final int BTREE_CLIENTSTANCECOMPONENT_ID = 20;
|
|
||||||
public static final int BTREE_SERVERSTANCECOMPONENT_ID = 21;
|
|
||||||
public static final int BTREE_CLIENTGROUNDMOVEMENTTREE_ID = 10;
|
public static final int BTREE_CLIENTGROUNDMOVEMENTTREE_ID = 10;
|
||||||
public static final int BTREE_SERVERGROUNDMOVEMENTTREE_ID = 11;
|
public static final int BTREE_SERVERGROUNDMOVEMENTTREE_ID = 11;
|
||||||
public static final int BTREE_CLIENTJUMPTREE_ID = 14;
|
public static final int BTREE_CLIENTJUMPTREE_ID = 14;
|
||||||
|
|||||||
@ -21,8 +21,6 @@ public class FieldIdEnums {
|
|||||||
public static final int TREE_SERVERIDLE_SYNCEDFIELD_STATE_ID = 13;
|
public static final int TREE_SERVERIDLE_SYNCEDFIELD_STATE_ID = 13;
|
||||||
public static final int TREE_CLIENTLIFETREE_SYNCEDFIELD_STATE_ID = 10;
|
public static final int TREE_CLIENTLIFETREE_SYNCEDFIELD_STATE_ID = 10;
|
||||||
public static final int TREE_SERVERLIFETREE_SYNCEDFIELD_STATE_ID = 17;
|
public static final int TREE_SERVERLIFETREE_SYNCEDFIELD_STATE_ID = 17;
|
||||||
public static final int TREE_CLIENTSTANCECOMPONENT_SYNCEDFIELD_STATE_ID = 28;
|
|
||||||
public static final int TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID = 29;
|
|
||||||
public static final int TREE_CLIENTGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID = 14;
|
public static final int TREE_CLIENTGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID = 14;
|
||||||
public static final int TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID = 15;
|
public static final int TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID = 15;
|
||||||
public static final int TREE_CLIENTJUMPTREE_SYNCEDFIELD_STATE_ID = 18;
|
public static final int TREE_CLIENTJUMPTREE_SYNCEDFIELD_STATE_ID = 18;
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package electrosphere.net.synchronization.server;
|
package electrosphere.net.synchronization.server;
|
||||||
|
|
||||||
|
|
||||||
import electrosphere.entity.state.stance.ServerStanceComponent;
|
|
||||||
import electrosphere.entity.state.movement.sprint.ServerSprintTree;
|
import electrosphere.entity.state.movement.sprint.ServerSprintTree;
|
||||||
import electrosphere.logger.LoggerInterface;
|
import electrosphere.logger.LoggerInterface;
|
||||||
|
|
||||||
@ -90,17 +89,6 @@ public class ServerSynchronizationManager {
|
|||||||
*/
|
*/
|
||||||
private void updateEntityState(Entity entity, int bTreeId, SynchronizationMessage message){
|
private void updateEntityState(Entity entity, int bTreeId, SynchronizationMessage message){
|
||||||
switch(bTreeId){
|
switch(bTreeId){
|
||||||
case BehaviorTreeIdEnums.BTREE_CLIENTSTANCECOMPONENT_ID: {
|
|
||||||
ServerStanceComponent tree = ServerStanceComponent.getServerStanceComponent(entity);
|
|
||||||
switch(message.getbTreeValue()){
|
|
||||||
case ServerSynchronizationManager.SERVER_SYNC_START: {
|
|
||||||
tree.start();
|
|
||||||
} break;
|
|
||||||
case ServerSynchronizationManager.SERVER_SYNC_INTERRUPT: {
|
|
||||||
tree.interrupt();
|
|
||||||
} break;
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case BehaviorTreeIdEnums.BTREE_CLIENTJUMPTREE_ID: {
|
case BehaviorTreeIdEnums.BTREE_CLIENTJUMPTREE_ID: {
|
||||||
ServerJumpTree tree = ServerJumpTree.getServerJumpTree(entity);
|
ServerJumpTree tree = ServerJumpTree.getServerJumpTree(entity);
|
||||||
switch(message.getbTreeValue()){
|
switch(message.getbTreeValue()){
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
package electrosphere.net.synchronization.transport;
|
package electrosphere.net.synchronization.transport;
|
||||||
|
|
||||||
|
|
||||||
import electrosphere.entity.state.stance.ServerStanceComponent;
|
|
||||||
import electrosphere.entity.state.stance.ClientStanceComponent;
|
|
||||||
import electrosphere.entity.state.movement.sprint.ServerSprintTree;
|
import electrosphere.entity.state.movement.sprint.ServerSprintTree;
|
||||||
import electrosphere.entity.state.movement.sprint.ClientSprintTree;
|
import electrosphere.entity.state.movement.sprint.ClientSprintTree;
|
||||||
|
import electrosphere.entity.state.equip.ClientEquipState;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -14,6 +13,7 @@ import electrosphere.entity.state.attack.ClientAttackTree;
|
|||||||
import electrosphere.entity.state.attack.ServerAttackTree;
|
import electrosphere.entity.state.attack.ServerAttackTree;
|
||||||
import electrosphere.entity.state.block.ClientBlockTree;
|
import electrosphere.entity.state.block.ClientBlockTree;
|
||||||
import electrosphere.entity.state.block.ServerBlockTree;
|
import electrosphere.entity.state.block.ServerBlockTree;
|
||||||
|
import electrosphere.entity.state.equip.ServerEquipState;
|
||||||
import electrosphere.entity.state.gravity.ClientGravityTree;
|
import electrosphere.entity.state.gravity.ClientGravityTree;
|
||||||
import electrosphere.entity.state.gravity.ServerGravityTree;
|
import electrosphere.entity.state.gravity.ServerGravityTree;
|
||||||
import electrosphere.entity.state.idle.ClientIdleTree;
|
import electrosphere.entity.state.idle.ClientIdleTree;
|
||||||
@ -79,6 +79,9 @@ public class StateCollection {
|
|||||||
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERBLOCKTREE_ID,FieldIdEnums.TREE_SERVERBLOCKTREE_SYNCEDFIELD_STATE_ID,ClientBlockTree.getBlockStateEnumAsShort(tree.getState())));
|
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERBLOCKTREE_ID,FieldIdEnums.TREE_SERVERBLOCKTREE_SYNCEDFIELD_STATE_ID,ClientBlockTree.getBlockStateEnumAsShort(tree.getState())));
|
||||||
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERBLOCKTREE_ID,FieldIdEnums.TREE_SERVERBLOCKTREE_SYNCEDFIELD_CURRENTBLOCKVARIANT_ID,tree.getCurrentBlockVariant()));
|
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERBLOCKTREE_ID,FieldIdEnums.TREE_SERVERBLOCKTREE_SYNCEDFIELD_CURRENTBLOCKVARIANT_ID,tree.getCurrentBlockVariant()));
|
||||||
} break;
|
} break;
|
||||||
|
case BehaviorTreeIdEnums.BTREE_SERVEREQUIPSTATE_ID: {
|
||||||
|
ServerEquipState tree = ServerEquipState.getServerEquipState(entity);
|
||||||
|
} break;
|
||||||
case BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID: {
|
case BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID: {
|
||||||
ServerGravityTree tree = ServerGravityTree.getServerGravityTree(entity);
|
ServerGravityTree tree = ServerGravityTree.getServerGravityTree(entity);
|
||||||
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID,FieldIdEnums.TREE_SERVERGRAVITY_SYNCEDFIELD_STATE_ID,ClientGravityTree.getGravityTreeStateEnumAsShort(tree.getState())));
|
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID,FieldIdEnums.TREE_SERVERGRAVITY_SYNCEDFIELD_STATE_ID,ClientGravityTree.getGravityTreeStateEnumAsShort(tree.getState())));
|
||||||
@ -91,10 +94,6 @@ public class StateCollection {
|
|||||||
ServerLifeTree tree = ServerLifeTree.getServerLifeTree(entity);
|
ServerLifeTree tree = ServerLifeTree.getServerLifeTree(entity);
|
||||||
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERLIFETREE_ID,FieldIdEnums.TREE_SERVERLIFETREE_SYNCEDFIELD_STATE_ID,ClientLifeTree.getLifeStateEnumEnumAsShort(tree.getState())));
|
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERLIFETREE_ID,FieldIdEnums.TREE_SERVERLIFETREE_SYNCEDFIELD_STATE_ID,ClientLifeTree.getLifeStateEnumEnumAsShort(tree.getState())));
|
||||||
} break;
|
} break;
|
||||||
case BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID: {
|
|
||||||
ServerStanceComponent tree = ServerStanceComponent.getServerStanceComponent(entity);
|
|
||||||
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID,FieldIdEnums.TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID,ClientStanceComponent.getCombatStanceEnumAsShort(tree.getState())));
|
|
||||||
} break;
|
|
||||||
case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: {
|
case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: {
|
||||||
ServerGroundMovementTree tree = ServerGroundMovementTree.getServerGroundMovementTree(entity);
|
ServerGroundMovementTree tree = ServerGroundMovementTree.getServerGroundMovementTree(entity);
|
||||||
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID,FieldIdEnums.TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID,ClientGroundMovementTree.getMovementRelativeFacingEnumAsShort(tree.getFacing())));
|
collection.setValue(new SynchronizedFieldValue(BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID,FieldIdEnums.TREE_SERVERGROUNDMOVEMENTTREE_SYNCEDFIELD_FACING_ID,ClientGroundMovementTree.getMovementRelativeFacingEnumAsShort(tree.getFacing())));
|
||||||
@ -155,6 +154,11 @@ public class StateCollection {
|
|||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case BehaviorTreeIdEnums.BTREE_SERVEREQUIPSTATE_ID: {
|
||||||
|
ClientEquipState tree = ClientEquipState.getClientEquipState(entity);
|
||||||
|
switch(syncedValue.getFieldId()){
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID: {
|
case BehaviorTreeIdEnums.BTREE_SERVERGRAVITY_ID: {
|
||||||
ClientGravityTree tree = ClientGravityTree.getClientGravityTree(entity);
|
ClientGravityTree tree = ClientGravityTree.getClientGravityTree(entity);
|
||||||
switch(syncedValue.getFieldId()){
|
switch(syncedValue.getFieldId()){
|
||||||
@ -179,14 +183,6 @@ public class StateCollection {
|
|||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case BehaviorTreeIdEnums.BTREE_SERVERSTANCECOMPONENT_ID: {
|
|
||||||
ClientStanceComponent tree = ClientStanceComponent.getClientStanceComponent(entity);
|
|
||||||
switch(syncedValue.getFieldId()){
|
|
||||||
case(FieldIdEnums.TREE_SERVERSTANCECOMPONENT_SYNCEDFIELD_STATE_ID): {
|
|
||||||
tree.setState(ClientStanceComponent.getCombatStanceShortAsEnum(((Double)syncedValue.getValue()).shortValue()));
|
|
||||||
} break;
|
|
||||||
}
|
|
||||||
} break;
|
|
||||||
case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: {
|
case BehaviorTreeIdEnums.BTREE_SERVERGROUNDMOVEMENTTREE_ID: {
|
||||||
ClientGroundMovementTree tree = ClientGroundMovementTree.getClientGroundMovementTree(entity);
|
ClientGroundMovementTree tree = ClientGroundMovementTree.getClientGroundMovementTree(entity);
|
||||||
switch(syncedValue.getFieldId()){
|
switch(syncedValue.getFieldId()){
|
||||||
|
|||||||
@ -613,7 +613,18 @@ public class Actor {
|
|||||||
* @param fragmentShader the fragment shader to apply
|
* @param fragmentShader the fragment shader to apply
|
||||||
*/
|
*/
|
||||||
public void maskShader(String mesh, String vertexShader, String fragmentShader){
|
public void maskShader(String mesh, String vertexShader, String fragmentShader){
|
||||||
shaderMasks.add(new ActorShaderMask(this.modelPath, mesh, vertexShader, fragmentShader));
|
shaderMasks.add(new ActorShaderMask(this.modelPath, mesh, vertexShader, null, fragmentShader));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Masks a shader with another shader
|
||||||
|
* @param mesh the mesh to apply the mask on
|
||||||
|
* @param vertexShader the vertex shader to apply
|
||||||
|
* @param geometryShader the geometry shader to apply
|
||||||
|
* @param fragmentShader the fragment shader to apply
|
||||||
|
*/
|
||||||
|
public void maskShader(String mesh, String vertexShader, String geometryShader, String fragmentShader){
|
||||||
|
shaderMasks.add(new ActorShaderMask(this.modelPath, mesh, vertexShader, geometryShader, fragmentShader));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -11,6 +11,8 @@ public class ActorShaderMask {
|
|||||||
String meshName;
|
String meshName;
|
||||||
//the vertex shader
|
//the vertex shader
|
||||||
String vertexShaderPath;
|
String vertexShaderPath;
|
||||||
|
//the geometry shader
|
||||||
|
String geometryShaderPath;
|
||||||
//the fragment shader
|
//the fragment shader
|
||||||
String fragmentShaderPath;
|
String fragmentShaderPath;
|
||||||
|
|
||||||
@ -19,12 +21,14 @@ public class ActorShaderMask {
|
|||||||
* @param modelName
|
* @param modelName
|
||||||
* @param meshName
|
* @param meshName
|
||||||
* @param vertexShaderPath
|
* @param vertexShaderPath
|
||||||
|
* @param geometryShaderPath
|
||||||
* @param fragmentShaderPath
|
* @param fragmentShaderPath
|
||||||
*/
|
*/
|
||||||
public ActorShaderMask(String modelName, String meshName, String vertexShaderPath, String fragmentShaderPath){
|
public ActorShaderMask(String modelName, String meshName, String vertexShaderPath, String geometryShaderPath, String fragmentShaderPath){
|
||||||
this.modelName = modelName;
|
this.modelName = modelName;
|
||||||
this.meshName = meshName;
|
this.meshName = meshName;
|
||||||
this.vertexShaderPath = vertexShaderPath;
|
this.vertexShaderPath = vertexShaderPath;
|
||||||
|
this.geometryShaderPath = geometryShaderPath;
|
||||||
this.fragmentShaderPath = fragmentShaderPath;
|
this.fragmentShaderPath = fragmentShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +56,14 @@ public class ActorShaderMask {
|
|||||||
return vertexShaderPath;
|
return vertexShaderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the geometry shader path
|
||||||
|
* @return the geometry shader path
|
||||||
|
*/
|
||||||
|
public String getGeometryShaderPath(){
|
||||||
|
return geometryShaderPath;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the fragment shader path
|
* Gets the fragment shader path
|
||||||
* @return the fragment shader path
|
* @return the fragment shader path
|
||||||
|
|||||||
@ -84,7 +84,7 @@ public class InstanceManager {
|
|||||||
data.fillBuffers();
|
data.fillBuffers();
|
||||||
|
|
||||||
//fetch model/shader and draw if both available
|
//fetch model/shader and draw if both available
|
||||||
ShaderProgram shader = Globals.assetManager.fetchShader(data.getVertexShader(), data.getFragmentShader());
|
ShaderProgram shader = Globals.assetManager.fetchShader(data.getVertexShader(), null, data.getFragmentShader());
|
||||||
Model model = Globals.assetManager.fetchModel(modelPath);
|
Model model = Globals.assetManager.fetchModel(modelPath);
|
||||||
if(model != null && shader != null){
|
if(model != null && shader != null){
|
||||||
openGLState.setActiveShader(renderPipelineState, shader);
|
openGLState.setActiveShader(renderPipelineState, shader);
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public class TextureInstancedActor {
|
|||||||
*/
|
*/
|
||||||
public void draw(RenderPipelineState renderPipelineState, OpenGLState openGLState){
|
public void draw(RenderPipelineState renderPipelineState, OpenGLState openGLState){
|
||||||
Model model = Globals.assetManager.fetchModel(modelPath);
|
Model model = Globals.assetManager.fetchModel(modelPath);
|
||||||
ShaderProgram shader = Globals.assetManager.fetchShader(vertexShaderPath, fragmentShaderPath);
|
ShaderProgram shader = Globals.assetManager.fetchShader(vertexShaderPath, null, fragmentShaderPath);
|
||||||
if(model != null && shader != null){
|
if(model != null && shader != null){
|
||||||
//setup render pipeline
|
//setup render pipeline
|
||||||
boolean instancedState = renderPipelineState.getInstanced();
|
boolean instancedState = renderPipelineState.getInstanced();
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public class DebugRendering {
|
|||||||
planeModel = Globals.assetManager.fetchModel(Globals.imagePlaneModelID);
|
planeModel = Globals.assetManager.fetchModel(Globals.imagePlaneModelID);
|
||||||
}
|
}
|
||||||
if(elementDrawDebugProgram == null){
|
if(elementDrawDebugProgram == null){
|
||||||
elementDrawDebugProgram = Globals.assetManager.fetchShader("Shaders/ui/debug/windowContentBorder/windowContentBound.vs", "Shaders/ui/debug/windowContentBorder/windowContentBound.fs");
|
elementDrawDebugProgram = Globals.assetManager.fetchShader("Shaders/ui/debug/windowContentBorder/windowContentBound.vs", null, "Shaders/ui/debug/windowContentBorder/windowContentBound.fs");
|
||||||
}
|
}
|
||||||
if(elementDrawDebugProgram != null && planeModel != null){
|
if(elementDrawDebugProgram != null && planeModel != null){
|
||||||
parentFramebuffer.bind(Globals.renderingEngine.getOpenGLState());
|
parentFramebuffer.bind(Globals.renderingEngine.getOpenGLState());
|
||||||
@ -89,7 +89,7 @@ public class DebugRendering {
|
|||||||
planeModel = Globals.assetManager.fetchModel(Globals.imagePlaneModelID);
|
planeModel = Globals.assetManager.fetchModel(Globals.imagePlaneModelID);
|
||||||
}
|
}
|
||||||
if(windowDrawDebugProgram == null){
|
if(windowDrawDebugProgram == null){
|
||||||
windowDrawDebugProgram = Globals.assetManager.fetchShader("Shaders/ui/debug/windowBorder/windowBound.vs", "Shaders/ui/debug/windowBorder/windowBound.fs");
|
windowDrawDebugProgram = Globals.assetManager.fetchShader("Shaders/ui/debug/windowBorder/windowBound.vs", null, "Shaders/ui/debug/windowBorder/windowBound.fs");
|
||||||
}
|
}
|
||||||
if(windowDrawDebugProgram != null && planeModel != null){
|
if(windowDrawDebugProgram != null && planeModel != null){
|
||||||
parentFramebuffer.bind(Globals.renderingEngine.getOpenGLState());
|
parentFramebuffer.bind(Globals.renderingEngine.getOpenGLState());
|
||||||
|
|||||||
@ -259,7 +259,7 @@ public class Model {
|
|||||||
if(shaderMask.containsKey(mesh.getMeshName())){
|
if(shaderMask.containsKey(mesh.getMeshName())){
|
||||||
ActorShaderMask specificMask = shaderMask.get(mesh.getMeshName());
|
ActorShaderMask specificMask = shaderMask.get(mesh.getMeshName());
|
||||||
ShaderProgram overwriteShader = null;
|
ShaderProgram overwriteShader = null;
|
||||||
if((overwriteShader = Globals.assetManager.fetchShader(specificMask.getVertexShaderPath(), specificMask.getFragmentShaderPath())) != null){
|
if((overwriteShader = Globals.assetManager.fetchShader(specificMask.getVertexShaderPath(), specificMask.getGeometryShaderPath(), specificMask.getFragmentShaderPath())) != null){
|
||||||
rVal = overwriteShader;
|
rVal = overwriteShader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ public class OutlineNormalsPipeline implements RenderPipeline {
|
|||||||
//
|
//
|
||||||
|
|
||||||
RenderingEngine.normalsOutlineFrambuffer.bind(openGLState);
|
RenderingEngine.normalsOutlineFrambuffer.bind(openGLState);
|
||||||
ShaderProgram program = Globals.assetManager.fetchShader("Shaders/core/anime/outlineNormals.vs", "Shaders/core/anime/outlineNormals.fs");
|
ShaderProgram program = Globals.assetManager.fetchShader("Shaders/core/anime/outlineNormals.vs", null, "Shaders/core/anime/outlineNormals.fs");
|
||||||
if(program != null){
|
if(program != null){
|
||||||
openGLState.setActiveShader(renderPipelineState, program);
|
openGLState.setActiveShader(renderPipelineState, program);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user