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

learn more… | top users | synonyms

0
votes
0answers
24 views

cocos2d c++ Collision between edge physics bodies

I'm working on a game with cocos2d, need to detect collision between two PhysicsEdgeBody. I've created an EventListener for contact and added it to the layer i'm working on, PhysicsContact and ...
3
votes
2answers
153 views

How do i implement a hit box system in a fighting game?

In a fighting game a move that you execute is basically just a series of hit boxes that are enabled and disabled at certain times. I want to know how do you create this hit box system. I have no idea ...
0
votes
1answer
40 views

Cocos2d: Tweening primitive data-types

I asked in SO, but no responses so I'm posting here since it's probably more relevant here. EDIT: SO question closed. I'm trying to tween primitive data-types the way Action tweens position to ...
0
votes
1answer
37 views

Moving at constant speed and angle [duplicate]

The picture illustrates I cannot figure out the math on this. The "arrows" should move at the same speed in both examples.
1
vote
0answers
23 views

trouble getting correct transforms for multiple meshes from assimp importer

I have had excellent success in extracting almost everything i need from a collada file that i imported with assimp, however I am struggling to get the correct transforms for each mesh in the file. ...
2
votes
0answers
40 views

Moving Draw functions out of GameObjects

This is basically the issue as in Tactics for moving the render logic out of the GameObject class with the topic already discussed here and here However I'm not really satisfied with the given answers....
0
votes
0answers
14 views

Update constraint pivot position in world space in Bullet Physics

The task is: we have N rigid bodies connected with each other by point-to-point constraint. In every frame we have new position of point where first rigid should be attached in world space. How to ...
1
vote
0answers
47 views

rendering a terrain

I'm trying to render a terrain using directx 11 and applying a heightmap to it. I load the heightmap then I copy it to a integer vector, then for each vertex position I assign the Y position of that ...
0
votes
0answers
37 views

Box2D + SDL - Weird body positions

I'm having a problem where either my sprite, or my body position is off. Here's a picture so you can see exactly what's going on : (The box has stopped on the picture, probably because it's colliding ...
0
votes
1answer
35 views

Having trouble with EOF in Xcode [closed]

I'm getting an error that says "control may reach end of function" and I have gone through my code several times now and am not spotting the error. It may be something simple too. // loop ...
0
votes
2answers
72 views

The best way to store and protect game data [duplicate]

I'm writing a sandbox-type game and i'm looking for a good way to store game data. I tryed Lua and plain text files, but the have a big minus - player can edit them his self! So how do I protect data ...
0
votes
2answers
46 views

How to create a linear plateform between two points?

I have a set of 2D coordinates. Their positions are regular on the X axis, but unpredictable on the Y axis: I would like to create slim platform between each point in order tu use it as ground for ...
2
votes
1answer
47 views

Normals showing unexpected results

I am making a game in c++ with opengl and glm and was working on my terrain when this happend : as it appears it is renderering just the way i planned it, but my question was, how do i make it ...
2
votes
1answer
109 views

2D infinite grid data structure

I'm currently developing a game, and I'm in a process of experimenting with various data structures to support my game model and simulation. Here are some of the requirements: Grid structure where ...
0
votes
0answers
46 views

3d rotation of a cube using DirectX

I can't solve an apparently simple problem: i have a cube, similar to the one in the following picture I've tried to write a small demo where i can rotate the cube by dragging the mouse, but i can'...
0
votes
1answer
45 views

Terrain not rendering like it should be

i was following this tutorial here: https://www.youtube.com/watch?v=yNYwZMmgTJk, in which i was translating from Java to C++ to generate a terrain, and stumbled across this issue: As it appears, it ...
0
votes
2answers
114 views

Tetris implementing rotation

I am currently at the last stage of the Tetris Clone using SDL library, the only thing left is rotation. For each piece I have a separate class, and in order to move the pieces down I use a method: ...
3
votes
1answer
76 views

How to make expanding ring with constant thickness?

I need to generate this burst or (donut-shaped) pulse. I'm having a difficult time how to generate such shape. At first, I was thinking of scaling the image but that didnt work out because the line or ...
1
vote
1answer
75 views

Parsing .OBJ to fit the gldrawelements() call. c++/opengl

I'm struggling trying to get this to work like it should. Ive been able to make an obj loader that fits the glDrawArrays() call, with uv and facenormals, but when trying to modify it to fit ...
5
votes
0answers
117 views

Diamond-Square algorithm output is random and noisy

I have implemented a rough interpretation of the Diamond-Square algorithm in C++ to create some semi-realistic fractal terrain, but the output just seems like a random y value at each point rather ...
1
vote
0answers
38 views

Swept AABB vs AABB Calculation Error

I'm having issues running simple AABB vs AABB collision detection. I'm able to successfully detect collisions without checking with velocity. But for some reason my code keeps prematurely firing ...
0
votes
1answer
100 views

Bullet: No Bouncing off the walls

I'm using Bullet Physics for Collision Detection in a first person game. The collision basically work fine, I cannot walk through objects. But if I walk against the wall and release the key I get ...
0
votes
0answers
33 views

Defining camera/view space

Im working on expanding my camera class, but having trouble defining camera/view space in the manner of this diagram: What Im trying to achieve is to define the camera as a true object much like a ...
0
votes
0answers
63 views

Weird Collisions in ODE

I'm trying to get a basic OBB/OBB Collision System working. For this I use ODE. My problem is: Whenever I use the dSpaceCollide and pass in my Space and my Callback, my Callback shows me, that a ...
3
votes
0answers
40 views

RWTexture3D in Compute Shader on Intel HD 4000

I'm having some weird issues running a Compute Shader with DirectX 11 on an Intel HD 4000 GPU. The goal is to write different shapes into a DXGI_FORMAT_R32_FLOAT 3D Texture with a size of ...
1
vote
1answer
28 views

Convert Triangle/OBB Test to OBB/OBB Test

I'm using the collision library OZCollide (http://www.tsarevitch.org/ozcollide/) and I want to do OBB vs. OBB collision tests. The problem is, that this function doesn't seem to exist (see my other ...
1
vote
1answer
128 views

Frustum culling takes ages c++

I have two ways of doing frustum culling taken from different web sources. First one takes 200ms to check 10k AABBs, second around 50ms for the same box count. I read some forum answers, people say 0....
0
votes
1answer
75 views

Is window creation decoupled from game engine?

I'm new to game development, and I was wondering about a architecture question. The window creation code in C++ is given by doing the following: Fill out a WNDCLASS struct Register the window class ...
0
votes
1answer
40 views

Why when releasing a DirectX Texture it fail

I have an instance where a class creates a DX9 texture via UINT usage = D3DUSAGE_RENDERTARGET; HRESULT hr = D3DXCreateTexture (m_D3DDevice, 200, ...
0
votes
0answers
16 views

Config SFML in QTCreator with file.pro

I know that are a method with cmake , but i wouldlike config my project in Qtcreator usinig qmake and my doubt is what my file .pro must have for work it ?. I will run in windows , maybe later linux . ...
1
vote
1answer
80 views

How do I correctly shift arrays on a Tetris line clear?

I'm writing a Tetris clone in C++ and I am at the last stage, I need to delete a row when it is full. Once a piece falls it is stored in a boolean array grid[20][10]. For example I check which row is ...
0
votes
0answers
28 views

OBB Collision Intersection Problem

I'm trying to create OBB's around objects and then collide them using DirectX 11 and C++. It all works fine until I rotate one (or more) of the boxes and then the collision detection returns true too ...
59
votes
10answers
16k views

Is UDP still better than TCP for data-heavy realtime games?

I know that UDP is usually recommended for real-time multiplayer games with high data usage. Most articles are serval years old, and since ~80% of all data transmitted on the internet is TCP, a lot ...
2
votes
4answers
625 views

Why is my A* Pathfinding incredibly slow?

I'm trying to use A* to make my enemies move about, but it takes up to 20 seconds to get a path to walk. My grid is only 64*64. This is my code: #include "AStar.h" #include "Node.h" #include "...
1
vote
1answer
115 views

How to Load and Apply a Cube Map with DDS Texture Loader?

So I have been spending a lot of time recently implementing a working skybox/skysphere, and have almost completed it. The last thing that I need to do is to load my given texture, a skybox texture ...
0
votes
0answers
46 views

OBB/OBB Test in OZCollide

I want to know if anybody, who tried OZCollide (http://www.tsarevitch.org/ozcollide/), knows whether OBB vs. OBB Tests are possible or not. I know there is a AABB vs. OBB function but I can't find one ...
1
vote
1answer
122 views

Create a crosshair openGL

How do I draw a white crosshair in the middle of screen in openGL, it's all well and good knowing how to render objects in 3d space, but I have literally no idea on how to draw something that sticks ...
0
votes
0answers
15 views

Unreal Engine Physics creation is slower in Editor

I just figured out that when UPrimitiveComponent::CreatePhysicsState() is called, it calculates the mass, but only in editor, also when i build for non-editor it is faster (standalone) this is not ...
1
vote
1answer
61 views

Drawn frustum does not match with glm::perspective

I am working on a personal project and I got a 3d viewport with moving camera working nicely. Now I am working on being able to freeze the time and switch to a debug camera and move in the game freely....
0
votes
1answer
46 views

Trouble applying a texture to a cube

Currently working on applying a texture to a cube and I am at a road block. I am using UV coordinates to apply the texture. Currently using 24 uv coordinates with indices. I am using glDrawElement and ...
0
votes
1answer
53 views

SDL Key Input previous and current key states not working as expected, how to fix?

Here is my code that's part of the main game loop: // ResetKeyState stores currentKeyState in previousKeyState // and then clears currentKeyState engine.ResetKeyState(); // Fill ...
1
vote
0answers
73 views

C++ Modern OpenGL - Calculate Vertex Normals

I'm learning modern OpenGL and i just got started so go easy on me :). Right now im trying to understand normals but im having some difficulties. On my program i have this class which i use to draw ...
1
vote
3answers
114 views

C++ Platformer Collision

This is very simple, but I have spent nearly 6 months messing with this and it is always messed up. This is a tile platformer, everything is "normal", x and y correspond to tile. Tiles are 32 x 32 ...
0
votes
1answer
68 views

Rendering three-dimentional array of tiles (as a tilemap)

I'm trying to create 2d game engine in C++ using SDL2 (actually some code was migrated from SFML). I want to have a flexible multilayer tilemap that can store different types of tiles. My current ...
1
vote
0answers
37 views

OpenGL texture not loading onto the model

I am still learning and I'd like to apologize if I don't explain something clear enough or anything like that. please forgive me :) So I am experimenting with 3D graphics for my university assignment....
1
vote
0answers
22 views

error: ‘struct RakNet::SocketDescriptor’ has no member named ‘socketFamily’| [closed]

when i run my client code i get this error i using code::blocks and im linux system in the tutorial that i follow the code working without any errors my includes files in the project #include "...
1
vote
0answers
28 views

Skin Mesh Animation Shader Issue

I'm having troubles with properly animating a skin mesh from an .fbx file. I feel like the issue is in the shader, but not sure what is going on. All I know is that I am getting unexpected results ...
0
votes
0answers
58 views

vertex shader doesn't work properly

Linux, OPenGL 3.0, GLSL 130 (Intel card) I'm learning OpenGL and successfully rendered a triangle, but as soon as I create the matrix of projection I get an error. The shader compiles and works ...
0
votes
0answers
18 views

Fbx Importer/exporter groups

I want to create Groups (empty transforms in a Scene Graph) but i find no documentation on how to go about it, to create a fbx loader which can create groups or show the different objects in that ...
1
vote
1answer
80 views

Rotating A model in 3D so it matches its direction of movement

So I have a model of a spear and when it gets thrown I want to set the orientation of the spear to its direction. ( I also want to use this for other things like bullets pointing in the direction ...