{"id":2591,"date":"2025-02-07T09:49:55","date_gmt":"2025-02-07T01:49:55","guid":{"rendered":"https:\/\/courtship.top\/?p=2591"},"modified":"2025-02-07T09:49:55","modified_gmt":"2025-02-07T01:49:55","slug":"%e8%ae%b0%e5%bd%95%e7%82%b9%e4%b9%8b%e5%89%8d%e6%b2%a1%e8%ae%b0%e8%bf%87%e7%9a%84ue-c%e5%a5%87%e6%8a%80%e6%b7%ab%e5%b7%a74","status":"publish","type":"post","link":"https:\/\/courtship.top\/index.php\/2025\/02\/07\/%e8%ae%b0%e5%bd%95%e7%82%b9%e4%b9%8b%e5%89%8d%e6%b2%a1%e8%ae%b0%e8%bf%87%e7%9a%84ue-c%e5%a5%87%e6%8a%80%e6%b7%ab%e5%b7%a74\/","title":{"rendered":"\u8bb0\u5f55\u70b9\u4e4b\u524d\u6ca1\u8bb0\u8fc7\u7684UE C++\u5947\u6280\u6deb\u5de74"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u7c7b\u578b\u5bf9\u5e94Getter<\/h2>\n\n\n\n<p>\u5728<code>InputActionValue<\/code>\u8fd9\u4e2a\u7c7b\u4e2d\uff0c\u4f7f\u7528\u6a21\u677fGet\u5904\u7406\u4e0d\u540c\u7c7b\u578b\u7684\u7279\u5316Get<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>template&lt;&gt;\ninline bool FInputActionValue::Get() const \n{ return IsNonZero(); }\n\ntemplate&lt;&gt;\ninline FInputActionValue::Axis1D FInputActionValue::Get() const \n{ return Value.X; }\n\ntemplate&lt;&gt;\ninline FInputActionValue::Axis2D FInputActionValue::Get() const \n{ return Axis2D(Value.X, Value.Y); }\n\ntemplate&lt;&gt;\ninline FInputActionValue::Axis3D FInputActionValue::Get() const \n{ return Value; }<\/code><\/pre>\n\n\n\n<p>\u8fd9\u6837\u5728\u60f3\u83b7\u53d6\u4e00\u4e2a\u7c7b\u578b\u5bf9\u5e94\u7684Get\u7684\u65f6\u5019\u5c31\u53ef\u4ee5\u7528\u6a21\u677f\u6765\u5b9e\u73b0\uff0c\u5982<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SetDesiredGait(ActionValue.Get&lt;bool>() ? A : B);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5f27\u5ea6\u4e4b\u95f4\u7684\u8fd1\u4f3c\u5224\u65ad<\/h2>\n\n\n\n<p><code>if(constexpr float AngleTolerance = 1e-3f, !FMath::IsNearlyEqual(CurrentRotation.Yaw, DesiredRotation.Yaw, AngleTolerance)<\/code><\/p>\n\n\n\n<p><strong><code>1e-3f<\/code>\u00a0<\/strong>\u662f\u4e00\u4e2a\u8f83\u5c0f\u7684\u503c\uff0c\u8868\u793a\u5141\u8bb8\u7684\u89d2\u5ea6\u8bef\u5dee\u8303\u56f4\u3002\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u8fd9\u4e2a\u7cbe\u5ea6\u5df2\u7ecf\u8db3\u591f\u6ee1\u8db3\u6e38\u620f\u6216\u56fe\u5f62\u5e94\u7528\u4e2d\u5bf9\u65cb\u8f6c\u89d2\u5ea6\u7684\u5224\u65ad\u9700\u6c42\u3002\u5982\u679c\u4e24\u4e2a\u89d2\u5ea6\u7684\u5dee\u503c\u5c0f\u4e8e\u00a0<code>1e-3f<\/code>\uff0c\u5219\u8ba4\u4e3a\u5b83\u4eec\u662f\u201c\u51e0\u4e4e\u76f8\u7b49\u201d\u7684\u3002<\/p>\n\n\n\n<p>\u6d6e\u70b9\u6570\u8ba1\u7b97\u5b58\u5728\u7cbe\u5ea6\u9650\u5236\uff0c\u76f4\u63a5\u6bd4\u8f83\u4e24\u4e2a\u6d6e\u70b9\u6570\u662f\u5426\u5b8c\u5168\u76f8\u7b49\u901a\u5e38\u662f\u4e0d\u5b89\u5168\u7684\u3002\u4f7f\u7528\u4e00\u4e2a\u5c0f\u7684\u5bb9\u5dee\u503c\uff08\u5982\u00a0<code>1e-3f<\/code>\uff09\u53ef\u4ee5\u907f\u514d\u56e0\u6d6e\u70b9\u6570\u7cbe\u5ea6\u95ee\u9898\u5bfc\u81f4\u7684\u8bef\u5224\u3002<code>1e-3f<\/code>\u00a0\u662f\u4e00\u4e2a\u5728\u6027\u80fd\u548c\u51c6\u786e\u6027\u4e4b\u95f4\u53d6\u5f97\u5e73\u8861\u7684\u5e38\u7528\u503c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7f3a\u5c11\u5bfc\u51fa\u5b8f\u5bfc\u81f4\u5728\u9879\u76ee\u65e0\u6cd5\u94fe\u63a5\u5230\u63d2\u4ef6\u4e2d\u7684\u51fd\u6570<\/h2>\n\n\n\n<p>\u5982\u679c\u5728\u9879\u76ee\u4e2d\u5f15\u7528\u63d2\u4ef6\u4e2d\u7684\u7c7b\uff0c\u7ed3\u6784\u4f53\uff0c\u4f46\u4e0d\u80fd\u4f7f\u7528\u8fd9\u4e2a\u7c7b\u4e2d\u7684\u51fd\u6570\uff0c\u7f16\u8bd1\u65f6\u4f1a\u63d0\u793a\u65e0\u6cd5\u94fe\u63a5\uff0c\u5219\u6709\u53ef\u80fd\u662f\u7f3a\u5c11\u5bfc\u51fa\u5b8f\u3002<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\u5bfc\u51fa\u548c\u5bfc\u5165\u7b26\u53f7<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u5f53\u4e00\u4e2a\u6a21\u5757\uff08\u4f8b\u5982\u4e00\u4e2a\u63d2\u4ef6\u6216\u6e38\u620f\u6a21\u5757\uff09\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7c7b\u6216\u51fd\u6570\uff0c\u5e76\u4e14\u5e0c\u671b\u5176\u4ed6\u6a21\u5757\u80fd\u591f\u4f7f\u7528\u5b83\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u8fd9\u4e2a\u5b8f\u6765\u6807\u8bb0\u8be5\u7c7b\u6216\u51fd\u6570\u4e3a\u201c\u5bfc\u51fa\u201d\u3002<\/li>\n\n\n\n<li>\u5f53\u5176\u4ed6\u6a21\u5757\u4f7f\u7528\u8fd9\u4e2a\u7c7b\u6216\u51fd\u6570\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u8fd9\u4e2a\u5b8f\u6765\u6807\u8bb0\u4e3a\u201c\u5bfc\u5165\u201d\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u8de8\u6a21\u5757\u8fb9\u754c<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u5728Windows\u5e73\u53f0\u4e0a\uff0cDLL\uff08\u52a8\u6001\u94fe\u63a5\u5e93\uff09\u9700\u8981\u660e\u786e\u6307\u5b9a\u54ea\u4e9b\u7b26\u53f7\uff08\u7c7b\u3001\u51fd\u6570\u3001\u53d8\u91cf\uff09\u662f\u5bfc\u51fa\u7684\uff08\u4f9b\u5176\u4ed6\u6a21\u5757\u4f7f\u7528\uff09\uff0c\u54ea\u4e9b\u662f\u5bfc\u5165\u7684\uff08\u4ece\u5176\u4ed6\u6a21\u5757\u4f7f\u7528\uff09\u3002\u8fd9\u4e2a\u5b8f\u5e2e\u52a9\u7f16\u8bd1\u5668\u6b63\u786e\u5904\u7406\u8fd9\u4e9b\u7b26\u53f7\u3002<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u5e73\u53f0\u517c\u5bb9\u6027<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u8fd9\u4e2a\u5b8f\u5728\u4e0d\u540c\u5e73\u53f0\u4e0a\u6709\u4e0d\u540c\u7684\u5b9a\u4e49\u3002\u4f8b\u5982\uff0c\u5728Windows\u4e0a\uff0c\u5b83\u53ef\u80fd\u4f1a\u6269\u5c55\u4e3a\u00a0<code>__declspec(dllexport)<\/code>\u00a0\u6216\u00a0<code>__declspec(dllimport)<\/code>\uff0c\u800c\u5728\u5176\u4ed6\u5e73\u53f0\u4e0a\uff08\u5982Linux\u6216Mac\uff09\uff0c\u5b83\u53ef\u80fd\u4ec0\u4e48\u90fd\u4e0d\u505a\uff08\u56e0\u4e3a\u4e0d\u9700\u8981\u663e\u5f0f\u5bfc\u51fa\/\u5bfc\u5165\u7b26\u53f7\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u7c7b\u578b\u5bf9\u5e94Getter \u5728InputActionValue\u8fd9\u4e2a\u7c7b\u4e2d\uff0c\u4f7f\u7528\u6a21\u677fGet\u5904\u7406\u4e0d\u540c\u7c7b\u578b\u7684\u7279\u5316Get \u8fd9\u6837\u5728\u60f3\u83b7\u53d6\u4e00\u4e2a\u7c7b\u578b\u5bf9\u5e94 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[6,12],"tags":[],"class_list":["post-2591","post","type-post","status-publish","format-standard","hentry","category-engine","category-ue"],"_links":{"self":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts\/2591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/comments?post=2591"}],"version-history":[{"count":24,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts\/2591\/revisions"}],"predecessor-version":[{"id":2621,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts\/2591\/revisions\/2621"}],"wp:attachment":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/media?parent=2591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/categories?post=2591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/tags?post=2591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}