Unity API Parsing (5)--MATHF class

Source: Internet
Author: User

This class belongs to struct type, only static property and static method, not instantiated

Deg2rad Property--from angle to Radian constant (2*PI)/360

Rad2deg Properties--from radians to angular constants

Infinity Property--positive infinity

Clamp Method-Returns a finite range value

Returns a range-restricted value value

closestpoweroftwo--returns a power of 2

A value that returns the power of 2 of the nearest parameter value value

deltaangle--Minimum increment angle

(-180,180]

inverselerp--Calculating the scale value

(Value-from)/(To-from)

lerp--linear interpolation

From interpolation start, to interpolation end, T to interpolation factor

lerpangle--angle Interpolation

movetowards--selective interpolation

Current value, target value, maximum constraint value

Selective interpolation of movetoawrdsangle--angles

pingpong--Reciprocating Motion

repeat--modulo operation

Integer value of round--floating-point number

Smoothdamp Method--simulating damping motion

public static float Smoothdamp (float current, float target, ref float Currentvelocity,float smoothtime)

public static float Smoothdamp (float current, float target, ref float Currentvelocity,float smoothtime, float maxspeed)

public static float Smoothdamp (float current, float target, ref float Currentvelocity,float smoothtime, float maxspeed, FL Oat deltatime)

Start value, target value, current frame speed, expected smoothing time, current frame maximum speed value

The closer the object is to the target, the less the absolute value of acceleration

Smoothdampangle Method-Damping rotation

smoothstep--Smoothing Interpolation

Unity API Parsing (5)--MATHF class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.