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
0answers
26 views

Accelerate top-down 2d ship based on heading and engine power

I'm trying to implement some sort of faux space physics in my 2D game. I have a top down view of my space ship. You can change direction and set a speed up to a maximum which then accelerates the ship ...
-1
votes
1answer
75 views

Using Physics.Raycast inside OnCollisionEnter2D function

void OnCollisionEnter2D(Collision2D collision) { foreach(ContactPoint2D contact in collision.contacts) { RaycastHit raycastInfo; ...
0
votes
0answers
11 views

Using Farseer Physics, how can I get objects to bounce at the correct angle

I am using the Farseer Physics engine in my MonoGame project. I have static walls which have "body" friction 0 and "body" restitution 1. I have dynamic objects, which are circles, with "body" friction ...
1
vote
1answer
34 views

How to detect collision position and that position's texture color in Unity?

I have a prefab and I use Circlecollider2D for physics operations. I want to detect the color of the contact position of the collided objects ? Is is possible by using Unity's collider classes ?
3
votes
0answers
43 views

Rotate a rigid body not around its centre of mass

I have a rigid body (a boat) whose centre of mass is towards the front of the object. However, this makes the rotation look strange as the rudder that is turning the object is at the back of the boat ...
3
votes
0answers
55 views

Circle Collision Resolution and Angular Momentum

I have a 2D engine working pretty well that involves rectangles and circles. I just reworked parts of the collision detection/response system for better handling of angular speed/momentum. The ...
1
vote
0answers
26 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
25 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
53 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
25 views

Implement car handling in Phaser [closed]

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
25 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
63 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
422 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
223 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
189 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
123 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
39 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
141 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
83 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
34 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
74 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
24 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
48 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
135 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
21 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
100 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
47 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
639 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
30 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
124 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 ...
3
votes
2answers
89 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
65 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
102 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
43 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
114 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
117 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
63 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
75 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
79 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
86 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
391 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 ...