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

4
votes
2answers
173 views

2D Enemy AI reacting to sound

I'm currently working on a 2D top-down survival game and I'm trying to figure out a good method for enemies to detect player sounds. For instance - if the player fires his gun it should play a sound ...
0
votes
0answers
120 views

How to find correct offset to adjust sprite to the position of box2D body after rotation

I am trying to implement phsyics with the as3 box2d port. I currently have a b2body for each of some certain sprites in my game and I am able to update the sprite's positions correctly from the ...
1
vote
1answer
148 views

2D Collision in JavaFX - Bad accuracy with .intersects()

I have several Shape objects - Circle, Rectangle and Polygon. I use the built-in .intersects(Bounds1, Bounds2) method to detect collision but it's quite inaccurate. Circle c1 = new Circle(20); ...
0
votes
1answer
89 views

How to make character gain acceleration?

I want to create more realistic physics for my 2D games. Currently, the character and the other game objects in my games start moving instantly (achieve maximum speed instantly) and stop instantly ...
0
votes
0answers
106 views

How to design basic physics and movement behavior for 2D platformer?

I want to make a simple 2D platformer. I know some basic 2D physics and how to implement them in a game. How to make a character jump, accelerate, decelerate, etc. But I have no idea how to actually ...
0
votes
0answers
50 views

Issue with implementing friction for player movement

I have been writing a 2.5D FPS engine in the same style of Doom and Duke Nukem 3D. The game is 3D rendered but the world is represented in 2D. This is my current position update code for an entity ...
1
vote
0answers
67 views

How do you calculate the rate of rotation using the accelerometer values in Android for a particular axis?

I am developing a simple game which involves a character moving up and down only along the Y axis. Currently I am using the accelerometer readings to change the Y velocity of the character. The game ...
1
vote
1answer
83 views

How to apply steering to a physics body correctly when using a physics engine?

I have a top down 2d game that uses a physics engine (Farseer). I'm using the standard steering behaviors to make the AI move around but I'm not sure the correct way to take the so called "steering ...
2
votes
1answer
317 views

Conceptual - What is the optimal way to combine steering behaviors with rigid body physics?

I am working on a simple 3D space simulator that makes use of the Bullet physics engine. The spaceships are rigid bodies that have a mass and hitbox so that they can be considered for collisions. At ...
0
votes
0answers
18 views

Handling gyroscope data

I'm working on a mobile game that allows user to rotate player around an axis using accelerometer. In addition to that, to allow fast, almost instant, rotation I thought of using gyro data. It seems ...
0
votes
3answers
88 views

How can I calculate force and acceleration?

I have problem of calculating the movement of the object. At the moment, I have a vectors calculated from the center of the screen minus the position of the object. direction vector = centerScreen ...
0
votes
2answers
94 views

Artillery Simulation [duplicate]

I need some help on a simulation of an Artillery like this one https://www.youtube.com/watch?v=YktWSKo_UbA. I cant figure out how to make the "tomato" to get to the selected spot. Where can I get ...
3
votes
1answer
114 views

How do you prevent AABBs from passing through each other?

I know what an AABB is, but I don't know how you would check for collision with an object that is going really fast. If an object goes fast enough, it can skip over other bounding boxes without it ...
0
votes
1answer
103 views

Relative Position/Rotation calculation

I have 2 objects each with a 3x3 Matrix (Orientation) and a Vector3 (Translation). Both are relative to world coordinates. How do I calculate the position and orientation of object B in relation to ...
21
votes
2answers
1k views

How do I make a character capable of walking on walls?

I am trying to get a character to move like a spider: Given a rising slope which a ball would normally not be able to roll up, the spider would slowly crawl up. Similarly, given a mid-air rectangular ...
4
votes
1answer
251 views

How do I make a cube move by rolling?

I am learning jMonkeyEngine by making some small games with it. I have a simple rectangular cube that I want the player to be able to roll around the game world. When he presses the arrow keys, the ...
2
votes
1answer
93 views

What are the parameters for btHingeConstraint::setLimit

What does each parameter in btHingeConstraint::setLimit do to the hinge constraint? void btHingeConstraint::setLimit ( btScalar low, btScalar high, btScalar _softness = ...
0
votes
1answer
314 views

How do I determine a good path for 2D artillery projectiles?

I'm building a little "tank wars" game (like this one). I understand the math, and I am able to define a parabola from the launcher to the objective I want to reach. The parabola depends on the ...
0
votes
1answer
342 views

Planet gravity? [duplicate]

I am trying to make a game with the Phaser game engine and would like to implement some sort of planetary gravity. Essentially I just want the player to be able to walk on a circle or orbit a point. I ...
0
votes
0answers
215 views

Spin wheel with gesture in Andengine

I want to implement Fortune wheel in Andengine. The wheel would start spinning based on the speed of a finger fling. Then it would stop slowly like real Fortune wheel. What I am able to do now is to ...
2
votes
1answer
176 views

Calculating/Predicting a way

I'm just starting with physics, so I'm not always sure about what I'm doing. It's a 2D project but I'm using 3D physical objects like SphereCollider etc.. What I have: Objects floating in space and ...
1
vote
3answers
910 views

Collider2D and Rigidbody2D, how do they work?

I have been learning JavaScript and Unity for a week now. I learned how to make Cube as a Ground and another Cube as a player and I used this code to make the Player Cube move forward and backward and ...
0
votes
0answers
128 views

Polygon Collision Response

I'm working on a game engine that has a built in custom physics engine (I know it's a waste of time, but I have years to make this, so why not make it good?). Currently, with any number of polygons, ...
2
votes
1answer
312 views

3D-Physics of a Rubber Ball (Squash)

I'm trying to simulate the environment on a Squash Court on Android with my own physics and using OpenGL for visualization. Basically, its about a rubber ball bouncing around in 3d, not just on the ...
1
vote
1answer
150 views

Ice sliding physics

I am trying to implement ice sliding physics on a plane for my game. There are a lot of N64 games that implemented them perfectly well, like Banjo-Kazooie, Super Mario 64, Zelda: OoT and MM, etc. ...
0
votes
1answer
352 views

How do I implement swipe-to-throw in Andengine?

I have a ball sprite and I apply physics to it when the user swipes on it. I'd like the ball to start moving in the direction of the swipe, similarly to how Paper Toss works. How can I do this?
0
votes
1answer
82 views

Bullet3: Issue with applying force once an object is at rest

I just started using bullet and I'm having an issue where once my rigid body is at reset at the floor it won't move when I apply a force to it. I have created a small demo to show this using the ...
0
votes
1answer
36 views

Ground hitting system [closed]

I want to know how to make character hit ground and lose health. For example: when character is falling of one meter he losing only a small part of his health, and when he's falling of 10 metters he ...
1
vote
0answers
100 views

Player glitches through floor? [closed]

I'm making a 2D platformer in Unity, and everything is going pretty smooth, accept I can't figure out why my player is glitching through the floor, the player will collide for a few seconds while ...
3
votes
1answer
171 views

Inertia Tensor and World Coordinate conversion

I understand that the inertia tensor is basically a 3x3 matrix. I'm modelling a cube, and the inertia tensor for this shape has values for moment of inertia on the main diagonal of the matrix. All the ...
0
votes
1answer
93 views

Is there a benefit to applying forces to my camera?

I have implemented a camera system and a rudimentary physics system. I now have a decision to make regarding steering the camera: Option 1 - Update the camera movement directly. eg. position (0, 0, ...
1
vote
4answers
730 views

Get GameObject to bounce of colliders [duplicate]

I am making a Atari Breakout game with unitys 2d tools and I need to get the ball to bounce of colliders in the scene. If you havent played the game before how it works is if the ball hits the wall at ...
0
votes
1answer
90 views

Trying to make sprite float up and down [closed]

Using LibGDX + Box2D and my understanding of the answer posted from this question: Here I apply the following impulse: // modify sprite's Box2d Body object int a = 8; // amplitude int f = 1; // ...
1
vote
1answer
2k views

Can someone explain Flappy Bird's physics to me? [closed]

I am having a difficult time trying to understand the Flappy Bird physics. I know it seems simple but I kind of suck at math. I am trying to see if I can make a simple game like this but it is just ...
0
votes
1answer
51 views

Proper Order to Process Each Frame

I'm writing a rudimentary 2D engine and am wondering what the proper or generally accepted order is for handling graphics, user input, sounds, and then other systems like physics. If you have written ...
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
335 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
152 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
387 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
163 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
128 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
632 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
586 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
449 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
404 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
463 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
340 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
290 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 ...