|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Static Public Member Functions
gameplay::MathUtil Class Reference

`#include <MathUtil.h>`

List of all members.

## Static Public Member Functions

static void | smooth (float *x, float target, float elapsedTime, float responseTime)
static void | smooth (float *x, float target, float elapsedTime, float riseTime, float fallTime)

## Detailed Description

Defines a math utility class.

This is primarily used for optimized internal math operations.

## Member Function Documentation

static void gameplay::MathUtil::smooth | ( | float * | x,
|  | float | target,
|  | float | elapsedTime,
|  | float | responseTime
| ) |  | `[static]`

Updates the given scalar towards the given target using a smoothing function. The given response time determines the amount of smoothing (lag). A longer response time yields a smoother result and more lag. To force the scalar to follow the target closely, provide a response time that is very small relative to the given elapsed time.

Parameters:

  x | the scalar to update.
  target | target value.
  elapsedTime | elapsed time between calls.
  responseTime | response time (in the same units as elapsedTime).

static void gameplay::MathUtil::smooth | ( | float * | x,
|  | float | target,
|  | float | elapsedTime,
|  | float | riseTime,
|  | float | fallTime
| ) |  | `[static]`

Updates the given scalar towards the given target using a smoothing function. The given rise and fall times determine the amount of smoothing (lag). Longer rise and fall times yield a smoother result and more lag. To force the scalar to follow the target closely, provide rise and fall times that are very small relative to the given elapsed time.

Parameters:

  x | the scalar to update.
  target | target value.
  elapsedTime | elapsed time between calls.
  riseTime | response time for rising slope (in the same units as elapsedTime).
  fallTime | response time for falling slope (in the same units as elapsedTime).

All Classes Functions Variables Typedefs Enumerations Enumerator