Questions tagged [c++]

C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language.

Filter by
Sorted by
Tagged with
0 votes
0 answers
15 views

clion.sh does not exist

I have Unreal Engine in Linux launched with ./UnrealEditor This file here ...
1 vote
1 answer
2k views

Assimp - Error loading .obj files

I'm trying to load .obj files in my little game. I decided to use assimp as tool to import those models. But it seems that assimp does not import them correctly. I looked for a simple cube mesh ...
2 votes
1 answer
29 views

Godot 3.5: Web Build using custom GDNative C++ Library does not work due to `dlopen` error and failed linking

The Problem Currently I am trying to get the official GDNative C++ example for Godot 3.5, which can be found here working in the Web Export context. So far, I managed to export to X11.64 without any ...
0 votes
1 answer
16 views

In Unreal Engine 5, how do I include and use UPlayMontageCallbackProxy::CreateProxyObjectForPlayMontage in C++?

I want to play my UAnimMontage via C++, and in particular, want to make use of the conveniences of UPlayMontageCallbackProxy. ...
0 votes
0 answers
17 views

3D Impulse based collision resolution not behaving correctly, what could be wrong?

I've implemented a collision resolution system based on Ian Mellington's System Cyclone and afterwards based on the Game Physics Cookbook. Currently the last one is implemented. For some reason the ...
1 vote
0 answers
31 views

Separating axis theorem implementation results in limitless extending colliders along the Z axis

I am trying to implement SAT and it works except for the fact that colliders extend infinitely along the Z axis and I can never get past them. I also have confirmed that ...
7 votes
3 answers
4k views

How do I Rigidbody.AddForce(Vector3) in Unreal Engine?

I am coming from the Unity Engine, and trying to get my feet wet with Unreal Engine 4.8.x. I want to add a one-time force to an object. To accomplish this in Unity 5, I would use: ...
0 votes
0 answers
24 views

Clarification on scene graph implementation. Adding object/node to a root node or container?

I learned about scene graphs from this chapter on learnopengl and using this I'm trying to make a simple imgui window that can display the scene graph, but one thing that wasn't made clear/I'm having ...
0 votes
1 answer
39 views

Simulated light for a 2D tile-map with just SDL2?

I'm working on a 2D tile-map RPG with C++17 and SDL2 + SDL_Image. There are daily cycles, weekly cycles and seasons. Even a kind of weather engine provides atmosphere. The moods and times of day are ...
0 votes
0 answers
8 views

Unreal Engine FDirectoryWatcherModule catching multiple events per file operation

I followed this post to implement a delegate on a directory that notifies me when a change has happened (add file, delete file or remove file). This works fine, though the issue is that for each ...
0 votes
3 answers
83 views

What is the best way to implement a scene manager?

I'm trying to create a scene manager system for a small framework I'm writing on top of SDL2. I have implemented a scene management system that works, but I am not sure if it is structured how it ...
4 votes
1 answer
516 views

Limit/Clamp camera movement using quaternions

I'm making a camera object for rendering with OpenGL. However, instead of using the typical "LookAt" method I'm trying to use just a Quaternion for orientation and a Vector3 for position. Instead of ...
0 votes
0 answers
66 views

Seperating axis theorem is bugged

I am attempting to make split axis theorem for 2d collision physics. It does works, but is inaccurate. It is based off of: https://www.gamedev.net/tutorials/programming/math-and-physics/a-verlet-based-...
2 votes
1 answer
2k views

Using UPawnMovementComponent to control a Pawn with Keyboard sharing code between Pawns

I've just started to learn Unreal and reading the tutorial Components and Collisions I have found that they use the UPawnMovementComponent to control their ...
1 vote
0 answers
66 views

Use of a Global Shaders in Unreal Engine to apply some pre-processing operations

I'm a little experienced in Unreal Engine, but I don't know the Unreal's graphics programming from a very low level. More in details I would like to know how could use an Unreal's Global Shader to ...
0 votes
1 answer
30 views

c++ SFML Window in std::thread ignore animation

I have a main window whose loop is just in the program and a Window class in which separate sf::RenderWindow objects are created and the loops for them are in ...
0 votes
0 answers
33 views

How does bullet physics filter 4+ contacts in GJK?

If the bullet GJK (Convex vs convex) collision algorithm has more than four penetrating points, then how is it filtering that down to the four it needs? What I've tried Staring at the code, but I get ...
0 votes
3 answers
673 views

Collision detection between transformed meshes (not primitives)

I know questions related to collision detection have been asked multiple times, but I find all of them like this and this depend on the assumption that I have some sort of measurement of the object ...
0 votes
0 answers
35 views

Need help with artefacts when rendering shadows using a shadow map

I am encountering some weird artefacts when rendering shadows using a shadow map. I am using C++ with Vulkan and GLSL shaders. This is the vertex shader that calculates the ...
0 votes
1 answer
745 views

text rendering artifact when rendering in 3D opengl GLfW

Main.cpp ...
-1 votes
0 answers
11 views

IDE cannot build task core minimal.h no such file directory [closed]

I am following udemy and created a cryptraider project I added a grabber component at first it worked fine I added some c++ code to that component bt now I added two more function in the c++ file but ...
0 votes
1 answer
106 views

Increased CPU usage when rendering sprites

I'm creating a game in modern OpenGL, C++ but I'm having problems with optimization. Whenever I render the sprites the CPU usage starts to increase. Code: ...
1 vote
1 answer
1k views

Rotate camera around its center in 2D

I'm currently trying to develop my own little game engine (trying to understand maths in games). I have implemented 4x4 matrices and 2d vectors (I don't need 3d since I'm aiming at orthographic ...
1 vote
2 answers
639 views

How to render a bevel effect with SDL2 Texture?

I develop 2D games using CodeBlocks (C++) with SDL2. I can load a texture (ex. a gray square) and render it to the screen. All is fine. If I want to change the color of the square? Yes, I can do it. ...
0 votes
1 answer
44 views

Vulkan Phong shader problem

Light increases its intensity as it come closer the origin model. Vertex Shader: ...
1 vote
1 answer
75 views

How to use the godot::String % operator for string formating of multiple values?

I tried this: godot::String str = "values: %f,%f"; double a = 1.0; double b = 2.0; str = str % a % b; Result string is: ...
0 votes
1 answer
47 views

When I inherit my own GDExtension class, editor can no longer see the inheriting class

I had two classes in my game, Player and ShootableObject. Both set up as such: ...
1 vote
3 answers
1k views

How do I fix my planet-facing camera?

Summary I'm having trouble implementing a camera controller suitable for first person use around a planet. The camera needs to be oriented correctly according to gravity (vector from camera ...
0 votes
2 answers
527 views

Game movement in 2D SFML game

I am making simple 2D game, imagine it as 2D Minecraft where you can dig blocks and build other things. Currently I am struggling with movement. I have none experience in game development, but I am ...
0 votes
0 answers
46 views

UE5; fatal error: CoreMinimal.h: No such file or directory

I am leaning to use UE5 and am following this tutorial : https://www.youtube.com/watch?v=KQgOqyYoHAs However, when I try to compile a simple pawn class on vscode, I am given the error: "...
2 votes
1 answer
749 views

Physics bodies randomly losing Velocity along an axis after impact

This just started occurring and seems to randomly happen during, and between, game sessions. A dynamic moving body collides with a static body and instead of bouncing off looses (almost completely) ...
0 votes
0 answers
30 views

How can i move actor's bounding box center in relative location in Unreal Engine 5?

This is my situation. I need align the center of the object (it's box) and the center of the scene component. I have only center of the box TVector type or FVector. How can i do it? ...
1 vote
2 answers
1k views

Single or multiple inheritance for game world objects

So I am currently laying out on paper the system I want to code for a game in C++. Now currently I am debating whether to have e.g. a class object_door that inherits from another class ...
0 votes
1 answer
409 views

SDL2 and TmxLite (Tiled) (Reading the actual TILE data from the layer)

I am trying to make use of the Tiled Map Editor for my SDL2 projects. (By using the TMXLITE parser from Fallahn on Github) https://github.com/fallahn/tmxlite ...
1 vote
1 answer
126 views

How to use key bindings in Godot from C++ extension code?

I have created a simple C++ "game" in godot. Lacking any good documentation, I based my work off examples on the internet, and for input I have this: ...
1 vote
1 answer
170 views

Object::cast_to in godot still casts even when the cast is invalid

I have a class for a projectile defined like this: ...
1 vote
1 answer
740 views

Passing heightmap data to btHeightfieldTerrainShape constructor

I was searching for a couple of hours, but I didn't find final solution, after trying many ways. I'm trying to get heightmap heights data, and pass it to btHeightfieldTerrainShape. Let's say my ...
0 votes
1 answer
504 views

Calculate the Right and Up vectors using yaw and pitch in right-handed coordinates

I have an assignment where they ask me to calculate Vector Right and Vector Up, it's for a camera creation using C++ and DirectX. For the Vector Right, they specify I should use 90-yaw, so I got: \$ ...
3 votes
2 answers
3k views

What does linearDamping mean in Box2D?

If I set linearDamping on a body, it's velocity will be decreased slowly, until it stops. The documentation says, that the units are 1/time, which is unclear for me. If the velocity of a body is 10 m/...
5 votes
2 answers
30k views

How can I render a texture to the screen in SDL2?

I've recently started upgrading my SDL version from 1.2 to 2.0.3, and while on the SDL Wiki, I've come across SDL_Renderer, SDL_Window, and SDL_Texture. I did some research and found a link at ...
0 votes
0 answers
85 views

Fast Fourier Transform for Water surface simulation

I want to implement water in my game and have already done it using the Gerstner equation, but the result is not too impressive, then searching the Internet I found an article about how someone made ...
14 votes
2 answers
19k views

Render in a imGui Window

How do i render my game scene into an imgui window? I want to get from this: to this :
1 vote
1 answer
69 views

Blitting GStreamer's decoded buffer into a Unity render texture

I'm working on a Unity native plugin that runs a gstreamer pipeline in the background, decodes it using hardware decoding, then copies the texture over to a render ...
0 votes
0 answers
35 views

How can I display properties/attributes of an object in an editor?

I'm learning how to make a game engine using SDL and OpenGL and I'm using imgui for the engine editor UI and I'm trying to make a properties panel that displays the properties of the selected object. ...
0 votes
1 answer
115 views

Untraceable exception in XAudio dll

I'm developing a game using OpenGL and XAudio 2.9. For some reason I am getting an exception in release builds inside the XAudio dll. Here is the exception : Exception thrown at 0x00007FFBB5416EF1 (...
3 votes
1 answer
138 views

Character overlaps with static objects

I am creating a simple OpenGL C++ game. I have a main character (green box) and some static objects (red boxes) positioned as stairs. The problem is as green box is descending down the stairs, it ...
0 votes
0 answers
37 views

Box2d's SetLinearVelocity not working as expected

I'm working in a SFML and Box2d project, and I stumbled with a problem related to the linear velocity of bodies. I've created a simplified version of the project, and the problem still persists, this ...
0 votes
1 answer
89 views

In C++, should POD-types be used for performance-critical parts, where many instances of the type will be handled?

(In C++) For a type whose instances will be handled in great numbers in performance-critical areas, such as a Vector2 class representing 2D-positions, should such ...
0 votes
1 answer
695 views

How to get image component from blueprint in c++

I have a dialog screenwith character icon and I need to be able to set up this image in code. But I don't know how to access this Image component (I put material instances in it). .h ...
0 votes
0 answers
45 views

C++ OpenGL texture coords VBO indexes changes between models

I just load 3 models using assimp into my Engine and have some problems with textures. Through some research, I realized that texture coordinates VBOs indexes changes between models, according to this ...

1
2 3 4 5
86