Ushi Arcade Car Physics Free 1.0.0
 
Loading...
Searching...
No Matches
UshiSoft.Common.UshiMath Class Reference

数学的処理をまとめたクラス More...

Static Public Member Functions

static Vector3 GetClosestPointOnLineSegment (Vector3 lineStart, Vector3 lineEnd, Vector3 point, out float t)
 点に最も近い線分上の点を返す
 
static int Modulo (int x, int y)
 負に対応した剰余。 Modulo(-1,4)だったら3になる
 
static float Modulo (float x, float y)
 負に対応した剰余の実数バージョン。 Modulo(-1f,4f)だったら3fになる
 
static float CalcSignedDistance (float x, float y, float length)
 ループを考慮してxとyの距離を求める(符号付き)
 
static float CalcDistance (float x, float y, float length)
 ループを考慮してxとyの距離を求める(符号なし)
 
static bool RandomBool ()
 ランダムなboolを返す
 
static float EngineRPMToSpeedKPH (float engineRPM, float gearRatio, float finalGearRatio, float wheelRadius)
 エンジン回転数から速度を求める
 
static float SpeedKPHToEngineRPM (float speedKPH, float gearRatio, float finalGearRatio, float wheelRadius)
 速度からエンジン回転数を求める
 

Static Public Attributes

const float MPSToKPH = 3.6f
 m/sをkm/hに変換する定数
 
const float KPHToMPS = 1f / MPSToKPH
 km/hをm/sに変換する定数
 
const float RPSToRPM = 30f / Mathf.PI
 rad/sをRPMに変換する定数
 
const float RPMToRPS = 1f / RPSToRPM
 RPMをrad/sに変換する定数
 
const float NmToFTLB = 0.737562f
 Nmをft-lbに変換する定数
 
const float WToPS = 0.00135962f
 WをPSに変換する定数
 

Detailed Description

数学的処理をまとめたクラス

Member Function Documentation

◆ CalcDistance()

static float UshiSoft.Common.UshiMath.CalcDistance ( float x,
float y,
float length )
static

ループを考慮してxとyの距離を求める(符号なし)

Parameters
x距離1
y距離2
length全体の距離
Returns
xとyの距離

◆ CalcSignedDistance()

static float UshiSoft.Common.UshiMath.CalcSignedDistance ( float x,
float y,
float length )
static

ループを考慮してxとyの距離を求める(符号付き)

Parameters
x距離1
y距離2
length全体の距離
Returns
xとyの距離

◆ EngineRPMToSpeedKPH()

static float UshiSoft.Common.UshiMath.EngineRPMToSpeedKPH ( float engineRPM,
float gearRatio,
float finalGearRatio,
float wheelRadius )
static

エンジン回転数から速度を求める

Parameters
engineRPMエンジン回転数
gearRatioギア比
finalGearRatio最終減速比
wheelRadius駆動輪の半径
Returns
速度

◆ GetClosestPointOnLineSegment()

static Vector3 UshiSoft.Common.UshiMath.GetClosestPointOnLineSegment ( Vector3 lineStart,
Vector3 lineEnd,
Vector3 point,
out float t )
static

点に最も近い線分上の点を返す

Parameters
lineStart線分の始点
lineEnd線分の終点
point
t正規化された線分上の点の位置(0~1)
Returns
点に最も近い線分上の点

◆ Modulo() [1/2]

static float UshiSoft.Common.UshiMath.Modulo ( float x,
float y )
static

負に対応した剰余の実数バージョン。 Modulo(-1f,4f)だったら3fになる

Parameters
x被除数
y除数
Returns
剰余

◆ Modulo() [2/2]

static int UshiSoft.Common.UshiMath.Modulo ( int x,
int y )
static

負に対応した剰余。 Modulo(-1,4)だったら3になる

Parameters
x被除数
y除数
Returns
剰余

◆ RandomBool()

static bool UshiSoft.Common.UshiMath.RandomBool ( )
static

ランダムなboolを返す

Returns
ランダムなbool

◆ SpeedKPHToEngineRPM()

static float UshiSoft.Common.UshiMath.SpeedKPHToEngineRPM ( float speedKPH,
float gearRatio,
float finalGearRatio,
float wheelRadius )
static

速度からエンジン回転数を求める

Parameters
speedKPH速度
gearRatioギア比
finalGearRatio最終減速比
wheelRadius駆動輪の半径
Returns
エンジン回転数

Member Data Documentation

◆ KPHToMPS

const float UshiSoft.Common.UshiMath.KPHToMPS = 1f / MPSToKPH
static

km/hをm/sに変換する定数

◆ MPSToKPH

const float UshiSoft.Common.UshiMath.MPSToKPH = 3.6f
static

m/sをkm/hに変換する定数

◆ NmToFTLB

const float UshiSoft.Common.UshiMath.NmToFTLB = 0.737562f
static

Nmをft-lbに変換する定数

◆ RPMToRPS

const float UshiSoft.Common.UshiMath.RPMToRPS = 1f / RPSToRPM
static

RPMをrad/sに変換する定数

◆ RPSToRPM

const float UshiSoft.Common.UshiMath.RPSToRPM = 30f / Mathf.PI
static

rad/sをRPMに変換する定数

◆ WToPS

const float UshiSoft.Common.UshiMath.WToPS = 0.00135962f
static

WをPSに変換する定数