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.

learn more… | top users | synonyms

1
vote
1answer
1k views

Moving rigidbody2d towards mouse click using AddForce

I cant get my rigidbody2d game object to move to where i click the mouse. The first click works. The object travels to the mouse click and stops. But the second time (or the third time) i click the ...
5
votes
3answers
341 views

How do you calculate the rotational velocity of a flying object?

When a arrow shaped object is fired it slowly adjusts it's rotation to match the direction it is moving. But what is the actual physics behind it? The question is: How many degrees does the ship ...
0
votes
1answer
160 views

Grid collision - finding the location of an entity in each box

I am trying to implement grid-based collision in a 2d game with moving circles. The canvas is 400x400 pixels. Below you can see the code for my Grid class. What I want it to do is check inside which ...
1
vote
3answers
470 views

Do two balls of different mass bounce different heights?

There are two balls and the only difference between them is the mass. Both are dropped from the same height on to the floor (static object with infinite mass), would both balls bounce up to the same ...
1
vote
1answer
178 views

Creating a vehicle using a physics engine [closed]

What is the theory behind creating a generic 3D vehicle in a physics engine? What I would like to know is what parts should I stick together to make the vehicle, how they parts should stick together, ...
-2
votes
2answers
147 views

How to calculate a bounding rectangle of a polygon?

Polygon poly = new Polygon(); poly.getPoints().setAll(5d, 15d, 15d, 25d, 5d, 30d); How do I calculate the Polygon's height and width? There is no poly.getWidth() or poly.getHeight() method in ...
0
votes
0answers
52 views

Lateral Friction Phisics

I am trying to create a physics engine for my game, and need to cancel out any lateral velocity for when entities turn. I have tried to mimic this page's example, but it is not working. I have objects ...
8
votes
3answers
656 views

Can I jump from A to B?

I'm making some rudimentary AI for my side-scroller and I need to know whether an AI unit can reach point B from point A simply by taking a jump. Flight trajectory of my characters is a bit unusal as ...
6
votes
1answer
595 views

How to do collision detection for fluids in 3D? [closed]

Is there an algorithm or a technique which can detect the collision between 3D fluids? I currently treat my fluids as dynamic meshes. Is it possible to find collisions with these, or will I need a ...
2
votes
1answer
521 views

Gerstner wave function simplified?

The gerstner wave function is a commonly used method to calculate waves and simulate water in video games and movies or most 3d simulations. It is however quite complex so it is very hard for young ...
2
votes
1answer
422 views

3d Water Simulation formula questions

I have created a Grid: At each point along the grid, is a vertex (Intersection Points): Each of these points has an x,y,z position. Vector3f(x,y,z). In an attempt to animate the grid into a group ...
2
votes
1answer
103 views

Where should the collision response/resolution code go?

I've got a collision response/resolution function that does the same for any pair of two entities. It's is in the World class right now. But right before that function is invoked, I have some ...
5
votes
2answers
484 views

How does this formula for generating water waves work?

I have been trying to implement the wave equation described in this paper ("Water Simulating in Computer Graphics," Kai Li and Liming Wu) in Java. Part of the paper discusses modeling waves as a sum ...
7
votes
1answer
369 views

RK4, Derivatives, Understanding Game Physics

Gafferon Games has a great article on RK4 Integration for building physics simulations which can be found here: Integration Basics Personally my mathematics and physics knowledge could use ...
7
votes
3answers
293 views

How to take into consideration gravity when moving AI

I'm making a 2D game. There is currently a helicopter flying around, controlled by the player. It's controlled using the arrow keys: UP, LEFT and RIGHT. It's speed along the y axis is dy, and speed ...
0
votes
3answers
81 views

How to apply logarithmic type formula for speed?

I want my character's speed to ramp up using somewhat of a logarithmic formula. I am confused about how specifically I would implement this. I want the character to move fast with a little movement as ...
2
votes
1answer
249 views

Does client side prediction sync with the server in the past?

I've spent some time now messing around and just trying to learn dead reckoning and client side prediction for the fun of it. Most of what I do doesn't need it, so i've never had a need to go down ...
0
votes
0answers
30 views

Steer a flock towards a target? Like in pikmin? [duplicate]

Can a flock be steered towards a target ? I've seen that flocking behavior has the alignement behavior, but can it be directed and steered toward a goal ? ...
0
votes
0answers
18 views

Making an object fly in an arc (a parbola) [duplicate]

I'm making a game where there should be a robot throwing ball-shaped objects at another robot. The balls thrown should fly in the shape of a symmetrical arc. Pretty sure the math-word for this is a ...
1
vote
1answer
152 views

How do I calculate the motion of 2 massive bodies in space?

I'm writing code simulating the 2-dimensional motion of two massive bodies with gravitational fields. The bodies' masses are known and I have a gravitational force equation. I know from that force I ...
0
votes
1answer
46 views

What does it mean to cross a scalar with a vector in a 2D plane?

At the moment, I'm following this page to create a physics engine. As per that page, I need to cross angular velocity by a distance vector to get relative torque and such, but I'm not sure how (in a ...
1
vote
0answers
66 views

velocity of a ball after sliding down a inclined plane? [closed]

I am making kind of a game that involves inclined plane and physics simulation. In the Game a M kg ball at the constant speed of V is sliding up an inclined plane(inclined angle is θ) and the COF of ...
2
votes
2answers
282 views

Physics engine deltaTime and force acceleration

I am working on a physics engine that uses basic Euler integration to compute forces. So, here is the thing: function applyForce (rigidbody, force) { rigidbody.forces.add(force); } function ...
1
vote
2answers
106 views

How can I compute the movement of an object along a parabola?

I am working on a simple 2D game. In the game, I have a 'robot' that throws a ball towards another robot, in the shape of a parabola. Both 'robots' have the same Y coordinate. The program knows the ...
0
votes
1answer
622 views

OBB Collision Resolution: Jittering with Long Rectangles

I have been working on a physics simulation module. Almost everything works properly, but I am having an issue, which I have demonstrated in the following video. http://youtu.be/2L17y9Lme0Q As you ...
4
votes
1answer
230 views

How can I test if an object will “fit” during pathfinding?

I'm tinkering around with a 2d game where obstacles are polygons of arbitrary shapes, sizes and locations, and movable entities (players/enemies) can also be of arbitrary sizes. What's a good general ...
0
votes
1answer
129 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 ...
0
votes
3answers
225 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 = ...
4
votes
2answers
407 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 ...
-1
votes
1answer
1k 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 ...
0
votes
2answers
4k 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. ...
2
votes
1answer
196 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 ...
1
vote
2answers
175 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?
0
votes
0answers
41 views

Collisions and objects going through each other [duplicate]

I am making a 2D game with physics based collisions implemented in it. So objects collide as they should, but if they're going too fast towards each other, when they collide they go through each ...
3
votes
1answer
367 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 ...
1
vote
2answers
66 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 ...
3
votes
2answers
93 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 ...
2
votes
3answers
231 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 ...
4
votes
1answer
273 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 ...
1
vote
2answers
157 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 ...
2
votes
1answer
458 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 ...
1
vote
1answer
121 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 ...
-1
votes
2answers
172 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 ...
1
vote
1answer
215 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 ...
-1
votes
1answer
97 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 ...
1
vote
1answer
96 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. ...
0
votes
1answer
115 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 ...
8
votes
3answers
388 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 ...
1
vote
1answer
1k 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, ...
0
votes
1answer
294 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 ...