<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>toburau</author_name>
  <author_url>https://blog.hatena.ne.jp/toburau/</author_url>
  <blog_title>ゲームが作れるようになるまでがんばる日記</blog_title>
  <blog_url>https://toburau.hatenablog.jp/</blog_url>
  <categories>
  </categories>
  <description>昨日、一定の入力値があったときに反応する処理について書いたが、スティックの入力では−1から+1の値を取ることがある。そこでマイナス方向についても考慮した方法。 #include &lt;cmath&gt; float input; // 入力 -1-&gt;1 float min; // 最小値 0-&gt;1 float absInput = abs(input); float absResult = max( (absInput-min) / (1.0f-min), 0.0f ); float result = std::copysign(absResult, input); 入力値の絶対値を取って求め、copy…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftoburau.hatenablog.jp%2Fentry%2F2019%2F06%2F25%2F230756&quot; title=&quot;一定値以上の入力があったときに反応する その2 - ゲームが作れるようになるまでがんばる日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-06-25 23:07:56</published>
  <title>一定値以上の入力があったときに反応する その2</title>
  <type>rich</type>
  <url>https://toburau.hatenablog.jp/entry/2019/06/25/230756</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
