2017-06-01ãã1ã¶æéã®è¨äºä¸è¦§
ç¾ç¶ã® UE4 㧠C++ ã® namespace ã使ããã¨æã£ã¦ãé¢åäºãå¢ããã ããªã®ã§ãç¾å®åé¡ã¨ãã¦ã¯ãããã UE4 ã® C++ ã³ã¼ããè¨è¿°ããã«å½ãã£ã¦ã¯ namespace ãç¨ããªãã»ããè³¢ããå°ãªãã¨ã UE-4.16 ç¾å¨ã¯ã ããããããã¯è¨ã£ã¦ããä¸ã®ä¸ã®ç´ æµãª â¦
// âãã«ã¼ããªã³ãã§ä½¿ããªãå ´åã¯ãã®1è¡ã¯ä¸è¦ UENUM( BlueprintType, meta=( Bitflags ) ) enum class EHoge: uint8 { EV_Nothing = 0 , EV_Flag1 = 0x01 , EV_Flag2 = 0x02 , EV_Flag3 = 0x04 , EV_Flag4 = 0x08 , EV_FlagAll = EV_Flag1 | EV_Flag2 |â¦
ç¶æ³ (½) ããããç·¨: AActor::AActor ï¼ã¢ã¯ã¿ã¼ã®ã³ã³ã¹ãã©ã¯ã¿ã¼ï¼ ã§çæããå ´å // .h UHogeComponent* HogeComponent; // .cpp AActor::AActor() { RootComponent = CreateDefaultSubobject< USceneComponent >( TEXT( "RootComponent" ) ); HogeComâ¦
UE4/C++ FORCEINLINE ã«ããããã© Debug ãã«ãã®æ㯠inline æé©åãããããªãé¢æ°ãå®ç¾©ããæ¹æ³ #ifndef UE_BUILD_DEBUG FORCEINLINE #endif void hogehoge() { /* fugafuga */ } ã¨ããããã㧠#ifdef ã§OKã Debug ãã«ãã§å®ç¾©ããã UE_BUILD_DEBâ¦
æ¦è¦ ååã®ãã¹ããVSCode 㧠UE4/C++: ãããã°å®è¡ã«å¿ è¦ãª launch.json ã®è¨å®ã®ä»æ¹ - C++ ã¨ãã©ã ãã¯ããããã¨ã¦ãã¼ã¶ãããâã㧠VSCode ã® launch.json ãè¨å®ã㦠UE4 ã®ãããã°å®è¡ã VSCode ãã"ãã"ã¹ã¿ã³ãã¢ãã¼ã³é¢¨ã«å®è¡ããæ¹æ³ãâ¦
æ¦è¦ VSCode 㧠UE4/C++ ãéçºããéã«ãããã°å®è¡ã«å¿ è¦ãª launch.json ã®è¨å®æ¹æ³ãç´¹ä»ã âãããªæã㧠VSCode ããèµ·åãã¦ããªãç¶æ ãã"ãã"ã¹ã¿ã³ãã¢ãã¼ã³é¢¨ã®å®è¡ãã§ããããã¡ãããèµ·åä¸ã® UE4Editor ã¸ã®ã¢ã¿ãããã§ããã VSCode ã®è¨â¦
åé¡ UE4 C++er 㯠.cpp ã追å ããããªãã¼ã ãããã³ã«ãProject.uproject ãå³ã¯ãªãã¯ã㦠Generate Visual Studio project filesãããªããã°ãªããªããäºã«ãªã£ã¦ããï¼ç®ã«ã¤ãããã¥ã¡ã³ãã AnswerHub çãªã¹ã¿ã³ãã¼ããªåçã«ããã°ï¼ã ã ããã»â¦
ç¶æ³ Visual Studio 2017 ã® cl.exe ã®ã¡ãã»ã¼ã¸ã English ã«ãããã âgooglabilityâ ã âstackoverflowabilityâ ã âue4-answerhubabilityâ çãªé½åã§ãåççã ãã UE4 ã® UE4Editor ãã C++ ã³ã¼ãããã«ãããéã«åé¡ãçããå ´åã« UE4Editor ã®â¦
C++ æ¨æºã® std::promise / std::future / std::thread C++erã«ã¨ã£ã¦ã¯åºç¤çãªããããã #include <iostream> #include <future> int main() { using namespace std; promise< int > p; auto f = p.get_future(); auto t = thread( [ =, p = move(p) ] () mutable { p.set_v</future></iostream>â¦
ãã¡ãã¡ã®ãµã¼ãã¹ã試ãäºã¯ãã£ã¦ããçµæçã«ã¯ git ãªãã¸ããªã¼ã® remote origin ã¯åºæ¬çã«ã¯ãªãã§ã GitHub ã使ã£ã¦ãã¾ããããããã GitHub ã 㨠100 MB ãè¶ ãããã¡ã¤ã«ãå°ãªãã¨ããã®ã¾ã¾ã§ã¯æ¾ãæããããªãã®ã§ã¡ãã£ã¨å·¥å¤«ã¨ãé¢åãâ¦
ãã³ãã¬ããã¸ã§ã¯ãã§ã¯ @ ãã¼ã§ã§ã¦ãã便å©ãªã³ã³ã½ã¼ã«ã«ã¦ã¼ã¶ã¼å®ç¾©ã®ã³ãã³ãã追å ããä¾: // MyActor.h // ... public: // ã³ã³ã½ã¼ã«ããå¼ã³ãã UFUNCTION ã®å®£è¨ UFUNCTION( BlueprintCallable ) void hoge(); // ... AMyActor::AMyActor() {â¦
C++/TPSã®ãã³ãã¬ããã¸ã§ã¯ããä½ã£ã¦ã½ã¼ã¹ãçºããã¨ãå°ä¸ãæ©ãããã£ã©ã¯ã¿ã¼ãã®ä½ãæ¹ããããã¾ããããã§ã追å è¦ç´ ã¨ãã¦ããã® ACharacter ã空ãé£ã¹ãããã«ããããã¨æã£ã¦ããã¨ãã£ã¿ã¼ã§ âCan Flyâ ããã§ãã¯ONããã ãã§ã¯ã¾ã£ããé£â¦
ç¹ã« UProceduralMeshComponent ã使ãå ´åãªã© UMeshComponent ç³»ã®ã¡ãã·ã¥ mesh ã®ãããªã¢ã«ãå®è¡æã«å¤æ´ãããå ´åã¯ä»¥ä¸ã®ããã«ããã mesh->SetMaterial ( 0 // Note: ãããªã¢ã«ãã»ãããããã¡ãã·ã¥å ã®ã»ã¯ã·ã§ã³çªå· , Cast<UMaterial> // Note: ä»åã¯</umaterial>â¦
以ä¸ã®ã³ã¼ãã®çµæã¯åãã§ãã»ï½ã» // code-1 ... mesh->CreateMeshSection_LinearColor ( 0 , vertices , indices , normals , texcoords0 , vertex_colors , tangents , true ); // code-2 ... mesh->CreateMeshSection_LinearColor ( 0 , vertices , inâ¦