From 5ee0e7a8dbd647b79073beee88e82870e181b363 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Sat, 16 Oct 2021 07:45:45 -0400 Subject: Tree that moves around more believably --- themes/TreeShape.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'themes/TreeShape.h') diff --git a/themes/TreeShape.h b/themes/TreeShape.h index 06a8f81..987295a 100644 --- a/themes/TreeShape.h +++ b/themes/TreeShape.h @@ -32,8 +32,11 @@ struct TreeBranchLoadData { struct TreeBranchUpdateData { int32 tier = 0; - float32 randomOffset = 0; + float32 period = 0; + float32 amplitude = 0; + Vector2 currentOffset; Renderer2dVertex* vertices = NULL; + TreeBranchUpdateData* branchToFollow = NULL; }; struct TreeShapeLoadResult { @@ -62,7 +65,7 @@ struct TreeShape { TreeShapeLoadResult load(Renderer2d* renderer); void createBranch(TreeLoadData* ld, TreeBranchLoadData* branchList, int32 numBranches, int32* branchIndex, int32 branchLevel, float32 width, float32 height, - Vector2 position, float32 rotation, Renderer2dVertex* vertices, TreeShapeLoadResult* lr); + Vector2 position, float32 rotation, TreeBranchUpdateData* parent, Renderer2dVertex* vertices, TreeShapeLoadResult* lr); void update(float32 dtSeconds); void render(Renderer2d* renderer); void unload(); -- cgit v1.2.1