x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How To Add A Inlined .h DataType?

I'm porting some std c++ code over to UE4. I have a certain class and I ported the header over just fine replacing all instances of angle with float.

However, short of figuring out how the heck this angle.h file used does all its magic, I need to use angle instead of floats.

angle is a type used to define nautical angles instead of mathematical angles so that I can get 0-360 rotation instead of 0-180 +/- using standard rotations.

I tried adding the stock angles.h from the project, tried adding UCLASS() etc. macros tried #include "AllowWindows..."

I even created a basic c++ class in the class wizard, commented out the cpp and modified the file to look exactly like the original, just replacing all instances of angle with the class I made which I called NauticalAngle

Here is the file I'm trying to use. https://sourceforge.net/p/dangerdeep/code/HEAD/tree/trunk/dangerdeep/src/angle.h

And the code I'm porting to UE4. 99% of it should just be for data purposes, I only need to display some of the void const getter functons values on a GUI as well as set the values from a GUI/code/BP's. https://sourceforge.net/p/dangerdeep/code/HEAD/tree/trunk/dangerdeep/src/tdc.cpp https://sourceforge.net/p/dangerdeep/code/HEAD/tree/trunk/dangerdeep/src/tdc.h

I'm no wizard at C++ I've only taken c++ 100 in uni and done the Udemy c++ class but it was going really well until I needed that angle.h classes wizardy for the logic to be ported to the UE4 API without figuring out how all that wizardy works and then putting it in each line that its used in a function in files using it as a data type (its gibberish to me compared to other classes how its all inlined and dont even know how the constructor works at all if at all and how tis returning values back etc)

Hopefully this explains it, I'm quite confused as to why its so hard to use a very well defined datatype in std c++. No matter what I do I constantly get "SOMECLASS - type not recognized must be a UCLASS USTRUCT OR UENUM etc.

Thanks.

Edit: I should note I've also replaced all instances of double with float for compatiblity with UE4's API, I tried copying the stock code into angle.h (which resides in /source/mygamename/public/libraries/ with the doubles left in and no go "angle" seems to just be a totally missing type.

I've looked at modules and plugins and linking static libraries, but this is a simple header file.... I assume since its a custom type I would have to integrate it into the engine (like the age old double argument).

Better off figuring out how the angle.h file works and replace my regular class where it calls these header functions with that logic?

Product Version: UE 4.12
Tags:
more ▼

asked Aug 25 '16 at 01:59 AM in C++ Programming

avatar image

Nsomnia
1.8k 67 27 137

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I created a proper implementation CPP file with the constructors and fuxtions returns and i can use the type. Go figure.

more ▼

answered Aug 25 '16 at 02:03 PM

avatar image

Nsomnia
1.8k 67 27 137

avatar image Nsomnia Aug 25 '16 at 04:21 PM

On second thought I dont... I thought IT compiled but now I'm getting unrecognized type again.

I removed every declarared function and implmentation using that type except one for testing, ensured the class was #included in the classes header...

Tried UObject tried basic class with constructor and destructor, tried moving all definitions to the .cpp file, tried removing all cstdlib stuff.

I'm guessing since its not a stock engine data type I cant use a "class" as a data type.

Trying an object based class called FAngle and going to try using that just blank and see.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Anyone have any tips? I'm just doing the math in each call and its very cluttered. Could I create a new Object(Outer); ?

more ▼

answered Aug 26 '16 at 02:44 PM

avatar image

Nsomnia
1.8k 67 27 137

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question