Some general observations about Unreal. Note that I am dumb and some mistakes / misinformation might be present.
1 "unit" in unreal for setting something is approximately setting that object to 0.01 scale.
For example, for the default 100x100x100 cube, to make it 1x1x1, you set the scale of that to 0.01
I believe things are "technically" in cm, but don't quote me on that.
If you're coming from the GL side, you've undoubtedly heard of glMatrix. Unreal has a built in function called
FPerspectiveMatrix
It does take different parameters though, (while ignoring the "out" prop in glMatrix)
glMatrix
mat4.perspective(fov,aspect,near,far)
Unreal
FPerspectiveMatrix(halfFov,width,height,near,far)
Width and height refer to the viewport width,height. Half fov is just the same fov you'd pass into glMatrix divided by 2.
When adding classes to Plugin files, make sure to add the <plugin name>_API
qualifier to the class, otherwise the .cpp
files won't get built.
class MYPLUGIN_API ApiClass {
...
thanks to Petr Leontev
The global enum GPixelFormats
contains information about the various texture formats including byte size.
(still testing)
You can grab the current viewport's render target via
GEngine->GameViewport->Viewport->GetRenderTargetTexture()
Note that you should double check to make sure the GEngine
and GEngine->GameViewport
are not null before fetching; otherwise you'll hit memory issues.