Here you can find the source of lerp(final float percent, final float startValue, final float endValue)
Parameter | Description |
---|---|
percent | a parameter |
startValue | a parameter |
endValue | a parameter |
public static float lerp(final float percent, final float startValue, final float endValue)
//package com.java2s; /**//from www . ja v a 2s . c om * Copyright (c) 2008-2012 Ardor Labs, Inc. * * This file is part of Ardor3D. * * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ public class Main { /** * * @param percent * @param startValue * @param endValue * @return */ public static float lerp(final float percent, final float startValue, final float endValue) { if (startValue == endValue) { return startValue; } return (1 - percent) * startValue + percent * endValue; } /** * * @param percent * @param startValue * @param endValue * @return */ public static double lerp(final double percent, final double startValue, final double endValue) { if (startValue == endValue) { return startValue; } return (1 - percent) * startValue + percent * endValue; } }