en:toolworks:docs:apparatus:mechanical

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
en:toolworks:docs:apparatus:mechanical [2021/06/09 10:48] vladiusen:toolworks:docs:apparatus:mechanical [2021/06/11 16:03] vladius
Line 12: Line 12:
   - Click "Next" and you should see a name choosing dialog. Adjust the name of the class as needed and proceed by pressing the green "Create Class" button at the bottom: {{ :en:toolworks:docs:apparatus:ue-name-cpp-mechanical-actor.png?nolink&600 |}}   - Click "Next" and you should see a name choosing dialog. Adjust the name of the class as needed and proceed by pressing the green "Create Class" button at the bottom: {{ :en:toolworks:docs:apparatus:ue-name-cpp-mechanical-actor.png?nolink&600 |}}
   - The new class gets created as a combo of its header (.h) and a source file (.cpp). All in the Source (sub)folder of your project. You should now see them in the IDE of your choice:{{ :en:toolworks:docs:apparatus:vscode-new-mechanical-actor-class-sources.png?nolink |}}   - The new class gets created as a combo of its header (.h) and a source file (.cpp). All in the Source (sub)folder of your project. You should now see them in the IDE of your choice:{{ :en:toolworks:docs:apparatus:vscode-new-mechanical-actor-class-sources.png?nolink |}}
-  - Note that you may have to recompile the project and/or restart the Editor after that. Don't be scared by some possible errors here, regenerate the IDE project, rebuild and start again.+  - Note that you may have to recompile the project and/or restart the Editor after that. Don't be scared by some possible errors here, regenerate the IDE project, rebuild and start again.{{ :en:toolworks:docs:apparatus:vscode-generate-project-files.png?nolink |}}
   - The corresponding file contents should be as:   - The corresponding file contents should be as:
     * ''MyMechanicalActor.h'':<code cpp>     * ''MyMechanicalActor.h'':<code cpp>
Line 27: Line 27:
  */  */
 UCLASS() UCLASS()
-class APPARATUSMARK_API AMyMechanicalActor : public AMechanicalActor+class MY_API AMyMechanicalActor : public AMechanicalActor
 { {
  GENERATED_BODY()  GENERATED_BODY()
Line 38: Line 38:
  
 #include "MyMechanicalActor.h" #include "MyMechanicalActor.h"
 +</code>
 +  - Now you can override one (or multiple) of the Tick methods and implement your actual Mechanics as usually in C++...
 +    * ... in the header:<code cpp>
 +void Tick(float DeltaTime) override;
 +</code>
 +    * ... and the source file:<code cpp>
 +void AMyMechanicalActor::Tick(float DeltaTime)
 +{
 +    // Your mechanical code here...
 +}
 </code> </code>
  • en/toolworks/docs/apparatus/mechanical.txt
  • Last modified: 2021/06/18 22:23
  • by vladius