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

0
votes
0answers
6 views

LOVE Physics - Joint Stretching

After asking a similar question yesterday I've come across another problem with using joints in box2D / LOVE and trying to create a weighted chain. Everything is set up as follows, I've tried to ...
0
votes
0answers
20 views

How to get plausible platformer physics with Farseer on MonoGame/XNA?

I am creating a 2D Vectorial (made of polygons, not tiles !) platformer using MonoGame and Farseer Physics Engine. Everything works perfectly, except the movement of the character which doesn't feels ...
1
vote
1answer
42 views

LOVE Physics - Breaking Joint Chains (LUA / Box2D)

Wasn't sure whether to post here or on SO so please move if needed. I've been having a look into the box2D physics API provided by LOVE to try and create a swinging flail or weighted rope but I'm ...
1
vote
0answers
23 views

Implement car handling in Phaser [on hold]

I'm experimenting on implementing a GTA 2 like game with Phaser. I started using Arcade physics but since the body boxes do not rotate the collision detection was very poor. In order to have better ...
0
votes
0answers
23 views

Which Box2D-like physics engine parameters need pixel conversion?

The official guide does not have any useful details on the matter: http://www.box2d.org/manual.html Position is an obvious one. What about velocity? Density? Anything else? Update: the context is ...
3
votes
1answer
61 views

Box2d Body to follow mouse movement

I am trying a box2d body to rotate following the mouse. Here's an image to clarify what I mean. The red and blue circles are current point of the mouse and the body (of corresponding color) ...
1
vote
2answers
416 views

Testing Unity 2D Physics

I am looking to push the 2D physics in Unity to the extent where when so much is going on that there becomes noticeable lag in a game. This is for testing purposes, so that when so much is going on ...
1
vote
2answers
220 views

How can I calculate the future position of my moving object?

I'm relatively new to games development and I have a 2D game where the playing area is an enclosed rectangle with width w and infinite height. In the playing area there is a ball. A gravity force of ...
4
votes
2answers
186 views

2D Collision response - rotating, moving polygon hitting a wall

I'm trying to bounce a polygon that has both velocity and angular velocity off a (immovable) wall when one of the vertices collides with it. I can detect the collision, and I've worked out how to ...
3
votes
1answer
121 views

Half top-down view collision and mechanics

I'd like to create a game with a half top-down (2d RPG) view (I don't know the exact name of it). It would be 2d, but I'd like to add 3d-like collisions. For example: If the grenade lands on the ...
-1
votes
0answers
38 views

Get the bounding box for an object, given its physical properties

I want to get the shape(Geometry/dimensions) of a body. However, I don't need its exact shape. I just need the bounds of that body. Is it possible to create bounding box for the body using its mass, ...
6
votes
2answers
134 views

Pathfinding with inertia

I'm currently working for pathfinding for a game where units are moving, but they have inertia. Most typical pathfinding algorithms (A*, Djikastra, etc.) are simply designed to minimize the length of ...
3
votes
2answers
80 views

How do I integrate drag over distance?

In my game I want to model kind-of-accurate bullet physics. I have the following drag equation (in C#): float drag = 0.235f * density * velocity*velocity * Mathf.PI * sizeMM*sizeMM/4000000; In ...
2
votes
1answer
33 views

Is it dramatically more efficient to have less BoxCollider2D's (for raycasting/custom physics)?

I have a temporary tile system for my platformer where I simply duplicate the same tiny box sprite with a BoxCollider2Don it over and over again. Like I said this is a temporary procedure for design ...
0
votes
3answers
86 views

How to change the gravity with a click

How to change the gravity of a ball upward with a click Then change it again downward with another click And so on In unity
2
votes
1answer
70 views

How to rotate an object along its trajectory path?

I have a missile launcher that uses initial velocity for the trajectory. I edit the launch angle from the editor, and then the script calculates the initial velocity required to land the missile to ...
1
vote
1answer
23 views

How to move sprite mimicking mouse/touch position on some part of the screen?

I am having a difficulty and I am been doing it wrong, I think. I want to move sprite relatively to touch. Just like when you are playing space shooter like 1943. I just learning some math and try to ...
0
votes
1answer
47 views

Controlling the movement of player by sprite using Mouse

I want to move the player by pressing down on the mouse and moving around by dragging. The player won't move to the position of the mouse. Instead it should be relative to the players current ...
0
votes
1answer
28 views

Bouncing projectile off of sprite, the sides work but top and bottom do not

I'm having a problem bouncing a projectile off a sprite, we've been asked to move the projectile using the equations of motions which makes things a little more difficult but as far as I can see what ...
1
vote
1answer
127 views

How do I make circles bounce off each other realistically?

I'm trying to create bouncing balls with realistic physics. At the moment, when the balls hit each other, they bounce back in the same direction they came from. How do I make them more realistic? I ...
1
vote
0answers
19 views

Sizing a Box2D ground object

I am developing a platformer game using SDL2 for graphics and Box2D for physics. I am currently designing my levels and would like to know if it is better to make the static part of each level (ie: ...
2
votes
2answers
99 views

Simulating beer pong physics in Unity

I'm trying to create a simple beer pong game in Unity. The basic idea is this - when it's your turn to shoot, you use your mouse to pick a point on the table that you want the ball to hit and bounce ...
1
vote
0answers
17 views

Need help in getting sequential impulse method working

i have made a very very simple physics system based on sequential impulse method - with single contacts only and no angular rotation at all. Contact points are calculated using separating axis ...
0
votes
0answers
61 views

Colliding of 2 moving objects

I am making 2d Game with my own Physics (without using of Rigidbody - some kind of challenge for me). I have two objects which are moving, and their velocity vectors. I have some unmoving objects. ...
2
votes
1answer
63 views

How to prevent bullets from passing right through entities?

(sorry for bad english) I'm making 2D arcade game. I write all of physics stuff myself. The problem involves bullet behaviour. Imagine bullet flying towards some entity. If the bullet's velocity is ...
0
votes
1answer
40 views

LibGDX make an object rotate around something

I need to rotate and object, which should be a circle made up with a ShaderRender, around a specified point. In LibGDX there is a method or something which allow me to do this? If it doesn't exist how ...
2
votes
2answers
638 views

How can I simulate the gravity of a sphere instead of a plane?

How can I simulate the gravity of a sphere instead of a plane? For a naval warfare game, I wish to implement a surface that simulates a curved plane with horizon. The plane is rendered with water ...
0
votes
1answer
27 views

Libgdx bouncy effect in a wall

I have an element inside the screen and I want to set my phone's bounds as a wall where elements are bouncing. I want it to be physically correct. How to do this?
4
votes
3answers
210 views

Sphere to plane collision never rearching resting contact

I have been trying to have a sphere to plane eventually lead to the sphere coming to a resting contact, but my sphere will end up always bouncing forever. It will bounce correctly for the first few ...
0
votes
1answer
115 views

Good collision resolving mechanism

In my game i have plenty of objects that can collide. Literally, most of them can collide with each other.The problem I'm facing is that i can't come up with some good collision resolving way. How can ...
2
votes
2answers
85 views

How do I calculate rotational impulses in rigid body collisions?

I'm writing a simple 2D physics engine to help me understand the inner workings of physics engines. I'm following Randy Gaul's tutorial which can be found here and It's been extremely useful and ...
0
votes
1answer
54 views

Calculating density of an object

I'm using Box2D for physics in my game, and one of the things it needs to know when creating a shape for a physics body is the shape's density. I had no idea what value I should specify, so I went to ...
0
votes
1answer
63 views

Unity - Joint tearing under larger force

I have a chain that is made of connected configurable joints. I used ultimate rope builder for the rope chain creating. The problem is that when i apply a larger force to the chain, it starts to tear ...
0
votes
1answer
90 views

Unity Rigidbody gets pushed through collider by another rigidbody?

I'm setting up the interior of a house in a 2D platformer. Inside the house is an NPC with a box collider and rigidbody attached, and the house is boxed in by four edge colliders. My character also ...
0
votes
0answers
41 views

How to calculate multiple collision of sphere and triangles?

I have a sphere and a mesh(triangles). When the sphere intersects the triangle, I reflects the vector of speed and everything works fine. But I can't write a good implementation for multiple ...
0
votes
1answer
112 views

Sprite Kit - keeping character level with the terrain 2d endless runner

I've been trying to figure this out exhaustively for the past few days and still haven't found an answer. I have an endless runner built using swift where the character is fixed and the terrain moves ...
3
votes
1answer
115 views

Determine if an object is inside a ship's turn radius, rotation via torque

I have a 3d space game where all ships move around using physics. I am trying to determine if a given object is reachable by a ship at a given velocity and turn radius. I believe the formula for turn ...
1
vote
2answers
62 views

unity3d - Object keeps falling down

I have an object that moves towards another object using this line : transform.position = Vector3.MoveTowards(transform.position, target.transform.position, speed * Time.deltaTime); this is it's ...
0
votes
0answers
15 views

how to trigger a ball from rotating cube in z axis

how to release ball from the cube which is rotating in z axis, ball should move in Y axis and ball should be reloaded after releasing the ball ?? Thanks in advance cheers Gokul
2
votes
0answers
64 views

Physics: calculating angular acceleration in world vs local space

I have a pretty simple rigid body simulation written in Python. In my code I calculate the angular acceleration using formula: angAcc = torque * inertiaTensor^-1 (note row-major matrix order) Now, ...
0
votes
1answer
74 views

Collision between a sphere and a mesh(height-map)

I am trying to implement a method that detects the collision between a sphere and a mesh and reflects the vector of speed. I have a method, that detects a collision between a sphere and a triangle and ...
0
votes
0answers
76 views

Implementing wall-sliding physics in THREE.js

Yo, Basically I want to make a 3D environment where the player can walk around a 3D world, and collides with objects / terrain like any other 3rd person / 1st person game. The world can contain any ...
1
vote
0answers
82 views

Calculate Orbit Path/Ellipse given mass, velocity, and distance (2body)

Calculate and draw the path of an orbit in a 2 body problem given the mass, current velocity, and distance of both bodies? We're working in Unity and will be using the default rigidbody.mass to start ...
10
votes
4answers
387 views

How is RTS Local Avoidance Done?

Currently, I'm simulating physics impact forces for local avoidance of units but this method sometimes pushes units out of formation and has very undesirable effects when units clump up. For RTS ...
1
vote
1answer
35 views

b2DistanceJoint with frequency equal to 0 vs b2WeldJoint

What is the difference of b2WeldJoint and b2DistanceJoint? They both have frequency and also when you put frequency of Distance Joint to 0 it acts like Weld Joint. It seams that you can create ...
1
vote
1answer
209 views

Why does my character stop a little before landing on the ground?

I made a little game with side-scrolling and a box (the player) jumping across the level. The simple physics are almost done, but I have two problem with the way things behave: On landing, the box ...
2
votes
1answer
78 views

In Box2D, how do I create an infinitely oscillating spring?

How do I create an ideal spring that can oscillate indefinitely using Box2D? A b2DistanceJoint works almost perfectly, but it eventually slows to a stop, even with damping set to 0. I think it is ...
2
votes
1answer
43 views

(Fat) ray cast with MPR OR GJK?

I know that it's possible to see if a line segment or a swept shape (to make a "fat" line segment) intersects objects using MPR and GJK. Is it possible in those situations to find out the distance ...
2
votes
1answer
48 views

Are GPU physics implementations branchless?

I've implemented MPR on the CPU and in pixel shaders (long story!) and there seems to be unavoidable conditional loops both to find the starting portal as well as to find the final solution. I know ...
0
votes
2answers
57 views

Ball oblique impact physic in Java?

I know Q3 + Q4 = 90 I searched internet and many physic topics, but not found how to calculate this values in Java? (I found V3 and V4 but not found Q3 and Q4) So how can i calculate V3, V4, ...