# Tagged Questions

Relating to the motion of objects through space and time. Including concepts such as acceleration (thrust and gravity), mass, collision response, friction and more.

101 views

### Unity Player Smooth Left - Right Movement

I am learning Unity 3d . Now I want to move the player object (The Ball) , Left and right by Left Arrow and Right Arrow key . I want smooth movement when the player goes left , but I don't know how to ...
96 views

### How do I make a box don't slide up/walk normally on a slope?

I'm trying to implement slopes in my game. When I walk up the slope and suddenly stop, here is what happens: And when I move down, it goes like this: I have set density to 0.5, friction to 0 on ...
83 views

### Bullet Physics: Applying a force at the point of collision

Suppose I want to simulate some kind of gripper with two "fingers" (such as pair of pliers, or two-fingered robot hand), picking up an object from the ground. Both the gripper and the object are ...
998 views

### How does a car earn nitrous in racing game?

Take the case of Need for Speed, why would a car earn nitrous gas by drifting or by flying in the air? What's the rule of collecting nitrous in other racing game? Is there a general formula within ...
87 views

### Should I compute impact damage with energy or momentum?

My game uses physics (Box2D in particular). Just about every object in the game can be destroyed, and the primary method of combat is by slamming objects into one another at high speed. It makes ...
83 views

### 3D Planetary gravity

so i am making a thing in javascript and i want to have planetary gravity in my "universe". But when i use an equation to calculate the acceleration by gravity i get one number. That is how fast the ...
98 views

### Bullet Physics Collision is Not Detected

I have created two btConvexTriangleMeshShape objects. One is a cube of size (0.1 x 0.1 x 0.1), and the other is is a plane of size (1.0, 0.1, 1.0). The plane is static, and the cube is dynamic, and ...
59 views

### Interpolating positions between FixedUpdate frames in Unity?

Lockstep Framework uses FixedUpdate () in Unity to match an assumed fixed timestep. At higher rates, FixedUpdate doesn't at all run at a fixed rate but instead runs multiple times in a single frame to ...
378 views

### Configurable Joint, linear limit range

I am working on a physics driven pressable button, but I cannot seem to tackle the minimum and maximum limits. This is the rig I have set up for the button (as it looks when pressed down). 2D view: ...
77 views

### How to Create levels in game in libgdx [closed]

I am create trying to create a Android game using Libgdx. I want to Create levels in game . So what i do. Which classes i need to use and how to create them explained. Plz help.Also i want to add ...
118 views

### How to predict future position of an object(bullet sync)?

There is a multiplayer game and server sends to all clients a message when a shot happens, containing bullet position, bullet velocity and timestamp. By having timestamp, we can calculate the lag, let'...
128 views

### Can this script be edited to create a “shotgun” type spread when firing? [Top down shooter]

I have this code and I'd like to add a shotgun to the game by slightly modifying the code. I've looked online for any example but everything I find is for FPS not a TDS. void Shoot () { timer = ...
46 views

### How can I change my angular momentum correctly using Unity3d physics?

This is an odd question to ask here, but I've almost been pulling my hair out trying to solve this. Plus its more of a mathematical/physics problem than a programming one. I'm trying to implement ...
217 views

### Why do Physics Engines use collision margins?

When using a physics engine in a game (such as Bullet), you usually need to define a collision margin for each object. I'm a beginner to game development, and I don't understand the purpose of a ...
88 views

### Test if Jump can reach target

I have an object that can jump. When it jumps, its Y velocity becomes -600 (pixels/second). For up to .2 seconds, it can ignore gravity. After .2 seconds, it begins to accelerate downward at 2100 (...
71 views

### Computing a full revolution for an arbitrary orbit?

I'm making a game in which the goal is to get as many planets as possible to orbit around a star. The user launches planets at any distance away from the sun (as long as it's on-screen), and in any ...
250 views

### OnTriggerEnter() without rigidbody?

I know this is an old question and it has been answered for a lot of people. Unfortunately none of the solutions apply to the problem I seem to have with rigidbodies. I have a moving AI character and ...
58 views

### Newton physics “hiding” rigid bodies

It seems like creating a bunch of rigid bodies (say 100K) causes a huge slowdown. However, what if the model the rigid body is attached to isn't visible. Is there a way to remove the rigid body from ...
76 views

### Box falls extremely slow? (~1 pixel per second)

As the title says I have a problem where my box2d bodies falls extremely slow. Around 1 pixel per second. My world is stepped like this world.Step(1 / 60.0f, 8, 3);, each frame. The way I update ...
55 views

### Calculate Jump Limits

My question is in a similar vein to this question, I am creating a pre-mapped pathfinding solution much akin to how Ash Blue was for my 2D platformer-style game (in XNA). As part of the process, I ...
91 views

### How to adjust my games speed to fps [duplicate]

Hi so i am making a small sort of physics engine, but if your fps is really slow the physics will update slower and objects will move slower. How do i make the speed of objects greater if the fps is ...
165 views

### Calculating Linear force required to hit a specific vertex on a parabola

The idea is a user presses somewhere on the screen and the program will fire an object in a parabola shape from a defined start position that has it's vertex where the user touched the screen. I have ...
9 views

### What is vector<E> how to use in android java [duplicate]

I making game i want use vector into velocity,position and rotation. But i don't know how to wark vector so please help. Thank you
148 views

### 2D Physics: storing previous position vs storing velocity

I saw a number of 2d game tutorials and books where previous position of an object was stored in state instead of velocity vector. Velocity is then calculated each frame as a difference between ...
233 views

### Why do my Box2D bodies not fall, even though world.step is called?

I have SFML set up with a Box2D world that has gravity, but my bodies won't move. I std::cout'ed the position of the body in the game loop, but it's always at (0, 14)! No errors or warnings, just no ...
85 views

### Cant jump from ground collision

I have a character that starts in the air and applying gravity to it to collide with platforms in my level. At the start, the character gradually gains speed descending until it collides with a ...
174 views

### Is this a correct backward Euler implementation?

I want to simulate a mechanic object like this: init acceleration a; init velocity v; init position x; loop { get delta time dt; v = v + a*dt; x = x + v*dt; } I use the velocity (which is the ...
55 views

### Trying to get Box2D bodies to fall [SFML, Box2D, C++] [duplicate]

As the title says I'm trying to make my Box2D body to fall, but it won't work. It just stays at the same position. Sorry for the long codes but I have no idea where I'm doing something wrong, so I ...
196 views

### Unity 2D Hingejoints break under extreme force

I have added a rope to my game that is made up of multiple small gameobjects, each connected to eachother by a HingeJoint2D. Since 1 unit of mass in Unity is supposed to represent 1 kg, I've made the ...
117 views

### Bullet Physics / OpenGL Meshes Not Colliding

This is for a school project, and I'm having a bit of trouble with Bullet acting strangely. I have an OpenGL project with Bullet Physics library working with Assimp model loaders and Magick++ ...
159 views

### How to prevent accelerating along wall during 2d sliding collision response

I'm writing a simple 2d physics system using a circle colliding with edges. When the user presses a key the circle's velocity is incremented by some amount in the direction they pressed. There is ...
251 views

### Orbital mechanics: orbit as a function of time. Universal variable formulation?

I am trying to model a two dimensional orbit for a two body Kepler problem but have gotten stuck when introducing the time variable. For a satellite with known semi major axis (a), eccentricity (e), ...
252 views

### How do you apply relativistic physics to a 4x strategy game?

I had the big idea of trying to create a hard science fiction 4x strategy game (with the obvious space setting), which is supposed to simulate a realistic way of creating interstellar societies while ...
58 views

### Finding the components of Proportional Navigation in 2D

So, I've been scouring this, the Physics Exchange, Wikipedia, and the general web for information about Proportional Navigation, and I can't seem to wrap my head around how to find the individual ...
155 views

I am new to data oriented design and I am currently developing a physics engine as a hobby project. I am really interested in data orinted design but I am not sure how to apply data oriented design to ...
65 views

### Do physics engines take shape into account or they operate solely on predefined variables?

I have never given it much of a thought about how physics engines operate behind the scenes. Though, I am currently working on a game that would greatly benefit from as precise as possible physics ...
52 views

### What does maximum normalized frictional force mean in this tutorial?

I tried following this tutorial: https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc12/Srisuchat/Thesis.pdf, but in page 19 I ran onto a problem - I don't understand the step 4. It is also ...
105 views

### Connect phone to computer? [closed]

In order to test out my game, I need to use my real life device. The problem is, android studio isn't recognizing my device plugged in: The problem: My device isn't getting detected in android studio ...
53 views

### Why is my gravity script repelling and not attracting?

I'm currently working on a small simulation of Newton's Law of Gravitation in Unity3d, and it seems to be working pretty well, except, it's doing the opposite of what I expected. Instead of attracting ...
82 views

### Get collision time between two moving, non uniform Axis Aligned bounding boxes

I have a problem finding the exact time of collision of two possibly moving or static objects. Both objects have AABB data (HalfExtents, Min, Max, Center vector and stuff) and a velocity vector. The ...
12 views

### SpriteKit Obj-C – How to add a force on a node a certain distance according to screen size

I have an SKSpriteNode that I'm trying to throw up to a certain point on the screen. I've tried applying an impulse and/or force according to the screen size, but that has strange results. I've also ...
76 views

### multiple contacts for SAT collision detection

I have implemented SAT algorithm for obb-obb intersection and I am able to generate a contact for this collision type. My problem is that SAT only generate ONE contact and in many situation I need ...
248 views

### Writing my own gravity

I am writing a little game engine in LWJGL. I want to have a gravity, but I don't know correct equations. Let's assume that I've got a 3D vector marking gravity force in each axis(e.g. Vector3f(0.0, -...
296 views

### Bouncy Ball stops without enough force

I am building a 3D Pong clone and want to implement a frictionless bouncing ball. These are the steps i took: Create a box in which the ball can bounce, consisting of standard cubic objects. Create ...
106 views

### Apply delta time to physics correctly

So I'm trying to create a simple physics engine for the game I'm creating. I'm trying to add jumping to the game. To do this I used (where jumpPower is 30000): impulses.emplace_back(0.0f, mass * ...
147 views

### Finding new position after collision with multiple colliders

What is the most accurate way to find the correct position to where a moving character should be re-positioned as a collision-resolution, after it has collided with multiple colliders? The figure ...
97 views

### How to detect if an object is upright?

I have a cartoon car and it has a skid sound with the car skids. But when the car flips over the skid sound plays endlessly and its really annoying. I have a basic script that is meant to detect when ...
129 views

### Character Movement and Collision with Ragdoll Rigidbodies/Colliders?

I have a player character that I'm moving with a character controller script and it is moved by applying velocity to a Ridigbody. This works when I have a rigidbody component on the player but my ...