package electrosphere.game.data.foliage.type;

import electrosphere.game.data.collidable.CollidableTemplate;

/**
 * Describes characteristics about a type of tree (how do the limbs dispere, where to the leaves start growing, how sturdy is it, etc)
 */
public class TreeModel {
    
    //how quickly do the limbs shrink
    float limbScalarFalloffFactor;
    
    //How small are the terminal limbs, basically how small can it get before it stops generating
    float minimumLimbScalar;

    //The maximum a single branch can disperse from the current line
    float maximumLimbDispersion;

    //The minimum a single branch must disperse from the current line
    float minimumLimbDispersion;

    //The minimum number of branch forks per iteration
    int minimumNumberForks;

    //The maximum number of branch forks per iteration
    int maximumNumberForks;

    //The height of a single branch, should be the height of the model
    float branchHeight;

    //if true, always generates a central trunk
    boolean centralTrunk;

    //The maximum number of linear segments for the trunk (ie how many times can a function recurse)
    int maximumTrunkSegments;

    //The maximum number of linear segments for the branch (ie how many times can a function recurse)
    int maximumBranchSegments;

    //The rate at which number of branch segments from the current trunk falls off over time
    float maxBranchSegmentFalloffFactor;

    //The minimum segment number required to start spawning leaves
    int minimumSegmentToSpawnLeaves;

    //the minimum distance along a given segment to start spawning leaves at
    float minBranchHeightToStartSpawningLeaves;

    //the maximum distance along a given segment to start spawning leaves at
    float maxBranchHeightToStartSpawningLeaves;

    //The increment along the branch segment to spawn leaves at
    float leafIncrement;

    //the minimum leaves to spawn per leaf point
    int minLeavesToSpawnPerPoint;

    //the maximum leaves to spawn per leaf point
    int maxLeavesToSpawnPerPoint;

    //The distance from the central line of a branch to spawn a leaf at
    float leafDistanceFromCenter;

    //The branch count to stop generating physics for each branch
    int physicsCutoff;

    //The rigid body definition for a full scale tree branch
    CollidableTemplate physicsBody;


    //
    //Tree branch sway factors
    //

    //How much can the peel vary hypothetically while it's swinging
    double peelVariance;

    //a minimum amount of peel (For instance forcing weather to cause large motions in the branches)
    double peelMinimum;

    //The value of the sigmoid controlling branch way speed over time (check branch btree for details)
    double swaySigmoidFactor;

    //The minimum number of frames that a branch should sway for
    int minimumSwayTime;

    //The maximum amount of frames that can be added to minimumSwayTime to increase the time of a single sway
    int swayTimeVariance;

    //How much can the yaw vary hypothetically while it's swinging
    double yawVariance;

    //a minimum amount of yaw (For instance forcing weather to cause large motions in the branches)
    double yawMinimum;

    //The minimum scalar of a branch to generate a sway behavior tree
    float minimumScalarToGenerateSwayTree;

    //The maximum scalar of a branch to generate a sway behavior tree
    float maximumScalarToGenerateSwayTree;

    //The model for the trunk of the tree
    String trunkModelPath;

    //the model for a leaf blob
    String leafModelPath;

    /**
     * how quickly do the limbs shrink
     * @return
     */
    public float getLimbScalarFalloffFactor(){
        return limbScalarFalloffFactor;
    }

    /**
     * How small are the terminal limbs
     * @return
     */
    public float getMinimumLimbScalar(){
        return minimumLimbScalar;
    }

    /**
     * The maximum a single branch can disperse from the current line
     * @return
     */
    public float getMaximumLimbDispersion(){
        return maximumLimbDispersion;
    }
    
    /**
     * The minimum a single branch must disperse from the current line
     * @return
     */
    public float getMinimumLimbDispersion(){
        return minimumLimbDispersion;
    }

    /**
     * The minimum number of branch forks per iteration
     * @return
     */
    public int getMinimumNumberForks(){
        return minimumNumberForks;
    }

    /**
     * The maximum number of branch forks per iteration
     * @return
     */
    public int getMaximumNumberForks(){
        return maximumNumberForks;
    }

    /**
     * The height of a single branch, should be the height of the model
     * @return
     */
    public float getBranchHeight(){
        return branchHeight;
    }

    /**
     * if true, always generates a central trunk
     * @return
     */
    public boolean getCentralTrunk(){
        return centralTrunk;
    }

    /**
     * The maximum number of linear segments for the trunk (ie how many times can a function recurse)
     * @return
     */
    public int getMaximumTrunkSegments(){
        return maximumTrunkSegments;
    }

    /**
     * The maximum number of linear segments for the branch (ie how many times can a function recurse)
     * @return
     */
    public int getMaximumBranchSegments(){
        return maximumBranchSegments;
    }

    /**
     * The rate at which number of branch segments from the current trunk falls off over time
     * @return
     */
    public float getMaxBranchSegmentFalloffFactor(){
        return maxBranchSegmentFalloffFactor;
    }

    /**
     * The minimum segment number required to start spawning leaves
     * @return
     */
    public int getMinimumSegmentToSpawnLeaves(){
        return minimumSegmentToSpawnLeaves;
    }

    /**
     * the minimum distance along a given segment to start spawning leaves at
     * @return
     */
    public float getMinBranchHeightToStartSpawningLeaves(){
        return minBranchHeightToStartSpawningLeaves;
    }

    /**
     * the maximum distance along a given segment to start spawning leaves at
     * @return
     */
    public float getMaxBranchHeightToStartSpawningLeaves(){
        return maxBranchHeightToStartSpawningLeaves;
    }

    /**
     * The increment along the branch segment to spawn leaves at
     * @return
     */
    public float getLeafIncrement(){
        return leafIncrement;
    }

    /**
     * the minimum leaves to spawn per leaf point
     * @return
     */
    public int getMinLeavesToSpawnPerPoint(){
        return minLeavesToSpawnPerPoint;
    }

    /**
     * the maximum leaves to spawn per leaf point
     * @return
     */
    public int getMaxLeavesToSpawnPerPoint(){
        return maxLeavesToSpawnPerPoint;
    }

    /**
     * The distance from the central line of a branch to spawn a leaf at
     * @return
     */
    public float getLeafDistanceFromCenter(){
        return leafDistanceFromCenter;
    }

    /**
     * How much can the peel vary hypothetically while it's swinging
     * @return
     */
    public double getPeelVariance(){
        return this.peelVariance;
    }

    /**
     * a minimum amount of peel (For instance forcing weather to cause large motions in the branches)
     * @return
     */
    public double getPeelMinimum(){
        return this.peelMinimum;
    }

    /**
     * The value of the sigmoid controlling branch way speed over time (check branch btree for details)
     * @return
     */
    public double getSwaySigmoidFactor(){
        return this.swaySigmoidFactor;
    }

    /**
     * The minimum number of frames that a branch should sway for
     * @return
     */
    public int getMinimumSwayTime(){
        return this.minimumSwayTime;
    }

    /**
     * The maximum amount of frames that can be added to minimumSwayTime to increase the time of a single sway
     * @return
     */
    public int getSwayTimeVariance(){
        return this.swayTimeVariance;
    }

    /**
     * How much can the yaw vary hypothetically while it's swinging
     * @return
     */
    public double getYawVariance(){
        return this.yawVariance;
    }

    /**
     * a minimum amount of yaw (For instance forcing weather to cause large motions in the branches)
     * @return
     */
    public double getYawMinimum(){
        return this.yawMinimum;
    }

    /**
     * The minimum scalar of a branch to generate a sway behavior tree
     * @return
     */
    public float getMinimumScalarToGenerateSwayTree(){
        return this.minimumScalarToGenerateSwayTree;
    }

    /**
     * The maximum scalar of a branch to generate a sway behavior tree
     * @return
     */
    public float getMaximumScalarToGenerateSwayTree(){
        return this.maximumScalarToGenerateSwayTree;
    }


    /**
     * The branch count to stop generating physics for each branch
     * @return
     */
    public int getPhysicsCutoff(){
        return this.physicsCutoff;
    }

    /**
     * The rigid body definition for a full scale tree branch
     * @return
     */
    public CollidableTemplate getPhysicsBody(){
        return this.physicsBody;
    }

    /**
     * The model for the trunk of the tree
     * @return
     */
    public String getTrunkModelPath(){
        return trunkModelPath;
    }

    /**
     * the model for a leaf blob
     * @return
     */
    public String getLeafModelPath(){
        return leafModelPath;
    }

}
