terrain editing improvement + animation bugfix
This commit is contained in:
		
							parent
							
								
									45e0c98ee1
								
							
						
					
					
						commit
						7e2f4feaf5
					
				| @ -199,7 +199,7 @@ public class ClientGravityTree implements BehaviorTree { | |||||||
|                 break; |                 break; | ||||||
|             case NOT_ACTIVE: |             case NOT_ACTIVE: | ||||||
|                 if(hadEntityCollision()){ |                 if(hadEntityCollision()){ | ||||||
|                     start(); |                     // start(); | ||||||
|                 } |                 } | ||||||
|                 //nothing here atm |                 //nothing here atm | ||||||
|                 //eventually want to check if need to re-activate somehow |                 //eventually want to check if need to re-activate somehow | ||||||
|  | |||||||
| @ -109,7 +109,7 @@ public class Actor { | |||||||
|         // playingAnimation = true; |         // playingAnimation = true; | ||||||
|         // animation = animationName; |         // animation = animationName; | ||||||
|         Model model = Globals.assetManager.fetchModel(modelPath); |         Model model = Globals.assetManager.fetchModel(modelPath); | ||||||
|         if(model != null){ |         if(model != null && model.getAnimation(animationName) != null){ | ||||||
|             double length = model.getAnimation(animationName).duration; |             double length = model.getAnimation(animationName).duration; | ||||||
|             ActorAnimationMask animMask = new ActorAnimationMask(priority, animationName, 0, length); |             ActorAnimationMask animMask = new ActorAnimationMask(priority, animationName, 0, length); | ||||||
|             for(Bone bone : model.bones){ |             for(Bone bone : model.bones){ | ||||||
|  | |||||||
| @ -62,7 +62,7 @@ public class TerrainEditing { | |||||||
|                 ){ |                 ){ | ||||||
|                     float current = data.getWeights()[voxelPos.x][voxelPos.y][voxelPos.z]; |                     float current = data.getWeights()[voxelPos.x][voxelPos.y][voxelPos.z]; | ||||||
|                     //hard clamp so it doesn't go over 1 |                     //hard clamp so it doesn't go over 1 | ||||||
|                     float finalValue = Math.max(Math.min(current + weight,1),-1); |                     float finalValue = Math.max(Math.min(current + weight * distance,1),-1); | ||||||
|                     voxelCellManager.editChunk(chunkPos, voxelPos, finalValue, type); |                     voxelCellManager.editChunk(chunkPos, voxelPos, finalValue, type); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user