cocos2d-x  3.3rc0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MathUtil Class Reference

Copyright 2013 BlackBerry Inc. More...

#include <MathUtil.h>

Static Public Member Functions

static void smooth (float *x, float target, float elapsedTime, float responseTime)
 Updates the given scalar towards the given target using a smoothing function. More...
 
local smooth ( local x, local target, local elapsedTime, local responseTime)
 Updates the given scalar towards the given target using a smoothing function. More...
 
static void smooth (float *x, float target, float elapsedTime, float riseTime, float fallTime)
 Updates the given scalar towards the given target using a smoothing function. More...
 
local smooth ( local x, local target, local elapsedTime, local riseTime, local fallTime)
 Updates the given scalar towards the given target using a smoothing function. More...
 

Friends

class Mat4
class Vec3

Detailed Description

Copyright 2013 BlackBerry Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Original file from GamePlay3D: http://gameplay3d.org

This file was modified to fit the cocos2d-x project Defines a math utility class.

This is primarily used for optimized internal math operations.

Member Function Documentation

static void 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
xthe scalar to update.
targettarget value.
elapsedTimeelapsed time between calls.
responseTimeresponse time (in the same units as elapsedTime).
var smooth ( var  x,
var  target,
var  elapsedTime,
var  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
xthe scalar to update.
targettarget value.
elapsedTimeelapsed time between calls.
responseTimeresponse time (in the same units as elapsedTime).
local smooth ( local  x,
local  target,
local  elapsedTime,
local  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
xthe scalar to update.
targettarget value.
elapsedTimeelapsed time between calls.
responseTimeresponse time (in the same units as elapsedTime).
static void 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
xthe scalar to update.
targettarget value.
elapsedTimeelapsed time between calls.
riseTimeresponse time for rising slope (in the same units as elapsedTime).
fallTimeresponse time for falling slope (in the same units as elapsedTime).
var smooth ( var  x,
var  target,
var  elapsedTime,
var  riseTime,
var  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
xthe scalar to update.
targettarget value.
elapsedTimeelapsed time between calls.
riseTimeresponse time for rising slope (in the same units as elapsedTime).
fallTimeresponse time for falling slope (in the same units as elapsedTime).
local smooth ( local  x,
local  target,
local  elapsedTime,
local  riseTime,
local  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
xthe scalar to update.
targettarget value.
elapsedTimeelapsed time between calls.
riseTimeresponse time for rising slope (in the same units as elapsedTime).
fallTimeresponse time for falling slope (in the same units as elapsedTime).

Friends And Related Function Documentation

friend class Mat4
friend
var Mat4
friend
local Mat4
friend
friend class Vec3
friend
var Vec3
friend
local Vec3
friend

The documentation for this class was generated from the following file: