//------------------------------------------------------------------------------ char RecordStage::encodePosInt(int a) const { if (a < 10) { return a + '0'; } else if (a < 36) { return a - 10 + 'A'; } else { HPC_SHOULD_NOT_REACH_HERE(); return '0'; } }
//------------------------------------------------------------------------------ /// 値の表すベクトル (x, y) を引数に与えられたベクトルに射影します。 /// /// @param[in] aVec 射影対象。求めたベクトルはこのベクトルと平行になります。 void Vec2::project(const Vec2& aVec) { const float l = aVec.length(); if (l == 0.0f) { HPC_SHOULD_NOT_REACH_HERE(); return; } const float len = this->dot(aVec) / l; Vec2 result = aVec.getNormalized() * len; x = result.x; y = result.y; }