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.

50 views

Lunar Lander calculating gravity, acceleration and collision in GameMaker

I've already asked this on the GameMaker forums but had no response so far. I'm making a little Lunar Lander game as my first foray in to GameMaker, I'm wanting to have the ship land and take off ...
49 views

How often should I calculate the position of a bullet?

In game's like Battlefield or Arma, how many times per second is the position of a bullet calculated?
26 views

Should a transform class store a matrix or seperate position/rotation/scale values?

I'm creating a transform class to make storing the transform of individual objects in a scene easier, but I'm unsure on how to do it. I could create one like this: class Transform { public: ...
321 views

Should the bullet trajectory calculated by server or by client? [duplicate]

In a FPS game like Battlefield or Arma, when playing online, should the bullet trajectory be calculated by the server or by the client?
29 views

AS3/Flash Develop - Radial Gravity (character on planet simulation)

I am trying to create a program where a character shape will be constantly drawn towards the centre of a planet shape. I have taken on previous advice into using physics equations to generate the ...
60 views

Implementing time step in main game loop

So ive read both http://gameprogrammingpatterns.com/game-loop.html and http://gafferongames.com/game-physics/fix-your-timestep/ and I kind of understand how I'm supposed to do it, but some parts are ...
372 views

Simulation of supersonic, hypersonic flight with user defined surfaces

I want to create a small rocket-launching game, inspired by Kerbal Space Program. Since there's nothing in orbital mechanics, that I still don't know. I decided to make this as close to reality as ...
57 views

Unity3D - Using AddRelativeForce to push an object forever in zero gravity environment

Ok, I use AddRelativeForce to basically push an object. But it suppose to keep flying and keep accelerating as I hold down the key because I didn't set gravity. I just started Unity3D last month, so ...
65 views

Multiple Colliders in Collision

I have an object that has a front collider, left collider and right collider. When a collision occurs, I notice that there are situations where the front collider and left collider/right collider has ...
127 views

Can I make this physics simulation any faster?

I've made a little real time physics simulation that solves some bodies. CirclevCircle && CirclevOrientedRect I would like someone to tell me if I'm doing something drastically wrong. I know ...
38 views

Rigidbody stuck on the edge of two colliders

could You please help me with that weird bug? I've seen other people's posts about that bug, but I couldn't really understand how to fix it. As You can see, the boxes are standing right next to each ...
41 views

How to apply force to rigid bodys at a specific point?

I am trying to write a physics engine from scratch to get a better understanding of them. It worked pretty good so far, but there is one thing, i can't get my head around: If i have a rigid body ( ...
153 views

How to implement jump in a 2d game?

I am trying to implement jump in a game I have written for android using canvas. I have referred this tutorial for implementing jump. My code is like if(jumpKeyPressed){ jumpVel = ...
43 views

How to get dynamic RigidBody rotation/tilt on uneven platform?

I have a rigid body with PolygonCollider2D which has some complex circular shape and I'm using uneven platform. Im using Following code to move the object forward CharacterRigidBody.velocity = new ...
94 views

How to make rigid body move smoothly on uneven platform?

Right now I'm using Rigidbody2d for the game character along with polygon collider 2D(2d platform game). I'm beginner hope I'm using correct components. And transform to move character from left ...
80 views

How to disable Camera from tilting when following a game object?

I have a game character object which is followed by camera. Camera is child object of Character. Using rigid body makes the character tilt in slopes and camera tilts too. how do i stop camera ...
65 views

Restricting Maximum Velocity in Space

I'm making a top-down 2D space ship game in which you rotate and thrust. I'd like to impose a maximum velocity for different engine types, meaning that a certain engine can only get you going up to a ...
45 views

Bullet Physics: Difference between Motion State and World Transform

In Bullet Physics, when I create a new btRigidBody, one of the parameters passed to the constructor is the btMotionState, which defines the initial pose of the body. However, if I then later want to ...
50 views

Synchronizing players and game objects in a server/client multiplyer game

OK guys, I have some experience with 2D game development (single player only), so that's fine no questions here. The problem is with multiplayer games. I already read lots of other questions and ...
115 views

How to apply friction vector to acceleration in top-down 2D game?

I'm making a top-down view 2D RPG game, meaning the player can move in any direction on a 2D plane, and I'm trying to implement a somewhat realistic non-orthogonal acceleration/friction physics model ...
88 views

Dealing with collisions across adjacent static bodies

The Problem: I have the following setup: A, B and C are rectangular static bodies in box2d. p is a circular dynamic body in box2d. The movement of 'p' is solely controlled by the current gravity ...
106 views

In a 2D physics engine, how do I avoid useless collision resolutions when objects come to a rest?

In a physics engine I'm developing (for learning) using love-2d, I implemented collision resolutions in this way: FixedUpdate(dt) // I use fixed timestep foreach collide c1 in allNotStaticColliders ...
57 views

why doesn't work this example [closed]

I am new to game development. I was trying to use this http://blog.gemserk.com/2012/07/03/drawing-a-projectile-trajectory-like-angry-birds-using-libgdx/ projectile example in eclipse android using ...
84 views

How do I set angular velocity/torque so that it's pointing to velocity/direction?

Right now, when I spawn a shootable object, it goes like this: Because I just set it's angle to this: float aimAngle = (float) Math.atan2(velocity.y, velocity.x); bullet.setBodyAngle(aimAngle); ...
62 views

Ball Speed is not increasing as per code

I am working on small project , but now I have a problem . The problem is The Player speed (Ball speed) is not increasing as per the code . In the beginning ball speed increases , but as the time ...
101 views

How to stop sinking bodies in physics engine C++

I'm writing a rigid body simulation in C++, and have come across a problem when an object should come to rest on the ground. Because gravity is being applied to it's velocity, the object starts ...
68 views

Calculating initial velocities given trajectory parabola

I'm working on a volleyball game but my maths/physics knowledge isn't quite up to par. I need some help with the following problem: The player can hit the ball from anywhere on the left of the court ...
35 views

How to find or compute or look for overall/max RPM by simply checking for rotation?

I find it hard to determine the wheel RPM since I'm only making a simple 2D game of rotating object via Z-axis. I wanna try this solution but I got no change since I'm trying to find the RPM from a ...
39 views

physics: formula for gradually changing force

I have two physics objects (lets call them a and b) pushing against each other and I need to determine the cumulative energy pushing them apart across a given time. Then I will divide it by each ...
45 views

2D Platform physics system with deltaTime

I'm implementing my physics handler in my own 2D "Platform" game. My main problem is that when the timestep ( deltaTime ) changes, maybe to some tiny lag spike or something like that, the running ...
39 views

Use constant force to hold something in position

This may actually be more of a Physics.SE question but since im doing this in Unity I figured I'd ask here. I am playing around with the Constant Force component and have a sphere constrained with a ...
38 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 ...
74 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 ...
38 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 ...
965 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 ...
65 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 ...
62 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 ...
41 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 ...
31 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 ...
61 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: ...
40 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 ...
39 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, ...
124 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 = ...
31 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 ...
158 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 ...
82 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 ...
58 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 ...
100 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 ...