foliage serialization/deserialization
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-08-17 11:11:07 -04:00
parent 277b9b6ee3
commit 0eb002df82
6 changed files with 29 additions and 9 deletions

View File

@ -266,10 +266,10 @@
"isDefault" : true
}
],
"Models/proceduralTree2/proceduralTree2v2.fbx": [
"Models/foliage/proceduralTree2/proceduralTree2v2.fbx": [
{
"meshName" : "Trunk",
"diffuse" : "/Textures/foliage/proceduralTree2/Trunk.png",
"diffuse" : "/Models/foliage/proceduralTree2/Trunk.png",
"isDefault" : true
}
],

View File

@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Fri Aug 16 19:38:51 EDT 2024
buildNumber=258
#Fri Aug 16 22:21:28 EDT 2024
buildNumber=259

View File

@ -6,6 +6,7 @@
+ on clearing the tutorial, continue the game when the sword is equipped, create another popup to teach sword controls. it pauses the game
+ when popup is accepted, spawn an enemy with an effect
Script engine ability to spawn entities
Particles and particle manager
+ rearchitecture
Quad tree implementation to support grass placement and eventually chunk LOD management
@ -17,6 +18,9 @@
Ticketed randomizer node for BTs to more heavily weight attacking and waiting
+ bug fixes
Fix anime outlines drawing over solid geometry
Fix anime outlines not drawing for first person pipeline
Fix cursor transparency rendering for cursor, skybox
Fix AI tracking deleted entity
Fix server ground movement tree playing animation over falling animation
Fix empty item slot not showing underneath dragged item

View File

@ -603,6 +603,9 @@ Fix rotation not sending correctly on initialization of creatures on client
Fix F2 menu not regaining controls when Xing menu instead of hitting F2 to close
Logger toggle debug window
(08/17/2024)
Foliage serialization/deserialization
# TODO

View File

@ -87,8 +87,7 @@ public class InstancedActor implements Comparable<InstancedActor> {
*/
@Override
public int compareTo(InstancedActor o) {
InstancedActor otherActor = (InstancedActor)o;
return this.priority - otherActor.priority;
return this.priority - o.priority;
}
/**

View File

@ -7,7 +7,6 @@ import electrosphere.entity.Entity;
import electrosphere.entity.EntityUtils;
import electrosphere.entity.state.equip.ServerEquipState;
import electrosphere.entity.state.inventory.InventoryUtils;
import electrosphere.entity.types.attach.AttachUtils;
import electrosphere.entity.types.creature.CreatureEquipData.EquippedItem;
import electrosphere.entity.types.creature.CreatureTemplate;
import electrosphere.entity.types.creature.CreatureUtils;
@ -66,10 +65,20 @@ public class ContentSerialization {
rVal.serializedEntities.add(serializedEntity);
}
if(StructureUtils.isStructure(entity)){
throw new UnsupportedOperationException();
throw new UnsupportedOperationException("Not implemented");
}
if(FoliageUtils.isFoliage(entity)){
throw new UnsupportedOperationException();
if(FoliageUtils.hasSeed(entity)){
EntitySerialization serializedEntity = new EntitySerialization();
serializedEntity.setPosition(EntityUtils.getPosition(entity));
serializedEntity.setRotation(EntityUtils.getRotation(entity));
serializedEntity.setType(FoliageUtils.ENTITY_TYPE_FOLIAGE);
serializedEntity.setSubtype(FoliageUtils.getFoliageType(entity).getName());
serializedEntity.setTemplate(FoliageUtils.getFoliageSeed(entity) + "");
rVal.serializedEntities.add(serializedEntity);
} else {
throw new UnsupportedOperationException("Not implemented");
}
}
}
}
@ -121,6 +130,11 @@ public class ContentSerialization {
Entity object = ObjectUtils.serverSpawnBasicObject(realm, serializedEntity.getPosition(), serializedEntity.getSubtype());
EntityUtils.getRotation(object).set(serializedEntity.getRotation());
} break;
case FoliageUtils.ENTITY_TYPE_FOLIAGE: {
long seed = Long.parseLong(serializedEntity.getTemplate());
Entity foliage = FoliageUtils.serverSpawnTreeFoliage(realm, serializedEntity.getPosition(), serializedEntity.getSubtype(), seed);
EntityUtils.getRotation(foliage).set(serializedEntity.getRotation());
} break;
}
}
}