# 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.

293 views

### How to obtain “gravity” and “initial impulse” given “desired time to reach max height” and “desired max height”?

I'm developing a 2d fighting game, using time steps based on frames ie, each call to Update() of the game represents a frame so, no variable time at all. My jump physics code doesn't need to consider ...
247 views

### Box2D + Citrus Engine - Proper Pong Paddles

I am creating a pong clone for my first Citrus Engine project using Box2D. I've tried two types of paddles, both do not fully work. 1) Paddle is a dynamic body with a restitution of 1.0 and friction ...
534 views

### How do I prevent other dynamic bodies from affecting the player's velocity with Box2D?

I'm working on my player object for my game. PhysicsBodyDef def; def.fixedRotation = true; def.density = 1.0f; def.position = Vec2(200.0f, 200.0f); def.isDynamic = true; def.size = Vec2(50.0f,200.0f)...
853 views

### Why are we not using integers in game physics?

We can use integer for game physics (or without physics, simply object representation): mass, position and rotation, where the integers represent, for example, the number of milligrams, millimeters or ...
3k views

### No collision detected with 2D rigidbody

No collision detected with 2D rigidbody 0 I have a ZombieBoy with a circle collider2D and a box collider2D and a RigidBody2D . The player shots energy balls which has a Circle Collider2D and a ...
12k views

### Why would Rigidbody.AddForce not resulting in movement of my objects?

I'm trying to get my card objects to spread out randomly but nothing happens. I know the method is called cause I get the prints in the console for each card. But they don't move. No errors reported. ...
418 views

### Using Box2D / Physics with Tiles?

Here is my issue. I currently have Box2D setup and working. But, it works with my Entity system. So I can create static objects and dynamic moving ones, and they simulate fine. However, my world is ...
624 views

### How can I get the force of a collision in Love2D?

Is it possible to get the force of a collision between two objects in Love2D/Box2D? If so, how?
888 views

### Calculating 2D Physics Prediction of Shot Angle with Moving Velocity of both targets

I currently have the math right to hit a moving target with 99% accuracy as long as I don't move. When I start moving the aim is nearly 80%, it should also be 99% accuracy because the target is moving ...
688 views

### Car physics - velocity and latheral force

Im developing simple car racing game. To turn a car, I need to calculate slip angles for each tire and then use those angles to find lateral force (using Hans B. Pacejka magic formula). One thing I ...
77 views

### Controls: Rolling on a ceiling

Currently I'm writing an iOS game where the basic movement is rolling. Technically you make the player turn clockwise or counterclockwise. When you tilt the device to the right, you will rotate ...
262 views

### AABB vs Rectangle

I'm trying to wrap my head around 2D physics and stumbled upon Axis Aligned Bounding Boxes, and I have a couple of questions regarding them. In all AABB structs I could find out there, people prefer ...
103 views

### Radiometric quantities and time in rendering

Often in papers people use various radiometric quantities, mostly radiant flux, radiant intensity, radiance and irradiance. It seems to me that all of these quantities are dependent on time. For ...
177 views

### very simple math destination and speed calculation

My player goes to (destinationX, destinationY) His position is: (x,y) and the player has an update event function update() { this.x = this.x + dx; this.y = this.y + dy; } what is the formula ...
942 views

### How can I determine trajectory from distance and time, without initial velocity?

I'm attempting to develop a Mortar that needs to lead it's shot to the target enemy. The shot will have a pre-determined constant flight time of (2.5 seconds) and it will have where the enemy should ...
347 views

### Why do my velocity estimates have such a large margin of error

I am writing a script in unity that applies a force to the object to advance it a set distance in an environment without friction or drag, producing a cosine force curve. However, as the target ...
211 views

### Collision Scenario, Detection and Response

I have AABB, BSphere, a Polygon Soup, a Triangle, a Plane, a Point and a Ray objects with a collision test that returns 'bool' if two objects collide or not. How can I use the above objects to ...
952 views

### bullet character controller sliding down any slope gradient

I've been experimenting with the btKinematicCharacterController. I've seen very old complaints that it has issues but I can't find anything recent stating that these issues remain (and nobody ever ...
259 views

### Tracing a 2d path through multiple gravity fields

For a projectile starting at origin O, an initial velocity V, and several stationary planets P[n], how would I pre-calculate and store the path it would take without actually stepping through each ...
165 views

### Lunar lander: why is my descent module crashing

I've been reading this awesome simulation of the actual Apollo 17 descent: http://www.braeunig.us/apollo/LM-descent.htm I've been trying to make my own simulation using Euler integration, with a time ...
308 views

### Using Geometric Slerp to move Camera

I'm writing a program in C++ using OpenGL and GLM; I'm trying to get my camera to follow my car. So far it successfully follows it around the screen, but I'm having trouble adjusting the Camera's ...
299 views

### How can I implement jumping in a 2D game using bounding box collision?

Problem: I'm trying to implement basic jumping to my 2D game engine, but have failed several times. Basically what I've done so far is disabling gravity and using a separate function moving the player ...
211 views

### Unit conversion for physics

I'm doing the physics for a 2D game which visuals are represented in openGl. Gravity is 9,8 m/s^2, how do i convert that to my screen size? OpenGl sets width to -1 to 1, and does aspect ratio of the ...
92 views

### How can I smoothly rotate a joint to an angle? [duplicate]

I would like to set the speed of my Box2D revolute joint on every update such that it rotates to a desired angle and stops. It should ramp down as its angle approaches the desired angle. My first ...
160 views

### Can not seem to adjust the speed of my Car

I'm programming in C++, rendering in OpenGL and using GLM for matrix/vector manipulation and I have implemented very (very) basic car controls; ignoring many forces that are present in reality. Since ...
228 views

### Farseer - Difference between Position, GetLocalVector, and GetWorldVector

I have used Box2D extensively, and am used to just calling body.GetPosition(). But Farseer does not have this. Instead it has a property Position, as well as methods GetLocalVector and GetWorldVector. ...
335 views

### Lunar lander: How to calc acceleration in each step

I'm trying to make a lunar lander simulator. I'm going to use a simple Euler integration. AFAIK all I've to calculate is the acceleration in each step, and then I should be able to update velocity and ...
653 views

### Make fast thing look slow (Box2D)

I'm working on a game that you control a trebuchet to throw balls to the opponent. It's like a game called 'Medieval Siege'. When the trebuchet is swinging its arm, player need to seize the best ...
3k views

### Basic Car Movement, Converting 2D Vectors to 3D problems

I'm trying to follow this guys method for steering a basic car. Link. It's the first example I can sort of get my head around and I'm trying to convert it to a working 3D version. To get some scope, ...
323 views

### Circle vs. Rect Collision accuracy problem

The blue ball is dynamic and is supposed to bounce off the walls, as well as the rectangle. Currently, the green rectangle is adding an invisible line to the scene, which doesn't let my ball go where ...
352 views

### Best collision shape for rooms

I'm wondering what is the most efficient collision shape to use with APIs like Bullet or Havok for rooms/interiors. Rooms tend to be boxes but are concave since the normals point inward which means no ...
128 views

### How to show the bow string stretching animation (?)

I was wondering how the animation in the angry birds of pulling the slingshot is done. One similar animation is available in this game but with a bow and arrow. I think both of them use the almost ...
711 views

### Making player movement direction follow players facing direction

if (controller.isGrounded) { moveDirection = new Vector3 (Input.GetAxis ("Horizontal"), 0, Input.GetAxis ("Vertical")); moveDirection = transform....
333 views

### Block player movement

What do i need to keep my player model from going through environment objects like walls, trees etc? Im trying to figure out if should use rigid bodies and the built in physics but i feel that its ...
455 views

### Using forces to reach a specific velocity

In my game, I currently move the player by directly setting its velocity on key press events. This makes the game feel very responsive and allows the user to quickly change direction. However, I ...
2k views

### What is the point of “delta” in this code? Does it reflect a standard thing in game dev?

I know very little about game programming but would like to learn more. I am trying to understand the code for this game. I am trying to understand why the code is passing a "delta" to Shipcontrols.js,...
140 views

### How to aim with a spaceship in 3D considering its angular momentum?

So I have a spaceship and I have 6 degrees of freedom. At a given moment the following vectors are known of the spaceship: Local forward. Local up. Local sideways (may be implied from the previous ...
157 views

### How to make “they need to be fed” movement style [closed]

This is the game for people who don't already know it: youtube video I am looking for theory about making an object move around another object and stay stuck to it. How would I implement something ...
64 views

### how to stop enemies from moving to one point when lots of them are chasing one object [duplicate]

i am making a top down game which lots of enemies are chasing one guy. then,enemies would move to one point without any collision,they just overlay each other. so ,is there any simple way to make ...
485 views

### Rope Colliding with a Rectangle

I have my rope, and I have my rectangles. The rope is similar to the implementation found here: http://nehe.gamedev.net/tutorial/rope_physics/17006/ Now, I want to make the rope properly collide ...
738 views

### Increasing efficiency of N-Body gravity simulation

I'm making a space exploration type game, it will have many planets and other objects that will all have realistic gravity. I currently have a system in place that works, but if the number of planets ...
2k views

I'm building a space exploration game and I've currently started working on gravity ( In C# with XNA). The gravity still needs tweaking, but before I can do that, I need to address some performance ...
107 views

### Box2D relations

As far as I know, the unit in Box2D is meters. When I use Box2D in Processing with JBox2D, I set the "world size" as the window size specified in the setup(). Now I'm wondering if there is any ...
152 views

### Correct order of tasks in each frame for a Physics simulation

I'm playing a bit around with 2D physics. I created now some physic blocks which should collide with each other. This works fine "mostly" but sometimes one of the blocks does not react to a collision ...
894 views

### How to handle jumping up a slope in a runner game?

In an 2D endless runner, what should happen when the player is running "too fast" up a slope and jumps? For example, in a "normal" case: .O. . __..O_____ . / . / O/ _/ If he is moving ...
534 views

### 2D game with 3D collision?

How do they do this bounce? Looks awfully complicated in 2D.
309 views

### How to manage sleep/awake state of physics body

I have a loop, which updates all the physics, inside the loop I'm updating the position of the objects, first thing is the gravity, which pulls all the objects to the bottom. Now my question is, how ...
1k views

### Do I need path finding to make AI avoid obstacles?

How do you know when a path-finding algorithm is really needed? There are contexts, where you just want to improve AI navigation to avoid an object, like a space -ship that won't crash on a planet ...