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
33 views

My orbit code produces the wrong results

I have a GameObject called "Sun" in the sky. A game object called "GameManager" keeps track of time in the game, it is responsible for updating the hours and days. For my sun I do something like this ...
1
vote
0answers
19 views

How would joints work in an impulse-based physics engine?

I want to learn about physics engines, especially impulse-based ones. So I've followed along this tutorial to create some simple rigid-body physics: http://gamedevelopment.tutsplus.com/tutorials/how-...
0
votes
0answers
34 views

How to apply physics on multiple sphere after collide like in Snooker game in unity?

I'm new in unity developement. I want to develop android game application Kanche(Marble). It's marble based game. Player need to take out other marbles from circle. What I've tried so far is, Rall a ...
1
vote
0answers
32 views

Triggers are not detecting colliders from other game objects in Unity version 5.2.2f1? [closed]

I was working on a basic slots game, and I came across a hiccup with the 2D Physics engine. Currently I'm letting the reels spin for three seconds. Once it has finished spinning, it will go to the ...
2
votes
2answers
40 views

How to model vehicle driving physics?

How to model the physics of a car in a racing game? In real life, vehicle movement is inherited from the wheels. But after reading a few articles on the subject (a lot of which are 10 years old), I ...
-4
votes
2answers
89 views

Trajectory Arcs

Ok so I have read this question Calculating trajectory. And it is sort of working in my program. I am trying to produce nice parabolic arcs with this. Like so .. The results I am getting look more ...
3
votes
1answer
104 views

Is it sensible to make all physics on GPU using transform feedback?

I'm learning OpenGL and today I read something new to me. It's called transform feedback, and if I understand right, it can help to get information about vertex shader variables. And I read an example ...
2
votes
1answer
52 views

How am I supposed to timestep this gravitational simulator

The following code is what I use to simulate a particles movement in a gravitational scenario. The problem is that this simulation needs to work well on devices with different aspect ratios, and ...
2
votes
1answer
105 views

Infinite ball bouncing problem (Unity)

I am trying to develop a basic Breakout game using this tutorial using Unity 5. But the ball starts to bouncing infinitely very easily. I cannot understand why this happenes. In my physics knowledge ...
0
votes
1answer
27 views

How do you convert angle with velocity to x velocity and y velocity?

This question can be simplified to: If you lean a pencil of a certain length at a certain angle what is the x and y position of the tip? So, basically, I am making a game that plots a balls path ...
0
votes
2answers
33 views

Pong paddle algoritm - How to know the direction of the ball when the paddle is at bottom

I hope you can understand my question! I'll try to be very clear. Watching a pong tutorial (it was originally written in Javascript but I made the game in Python) The developer used an algorithm to ...
0
votes
1answer
51 views

Space Based Physics

How would I go about about adding space-based physics like orbital mechanics into a game engine like Unreal Engine 4 or Unity 5? The goal is to generate celestial bodies procedurally: first black ...
1
vote
1answer
67 views

How do I convert gravity from pixels per frame² into Unity's Rigidbody2D gravity scale parameter?

I'm learning Unity2D by trying to make a Mega Man clone. The first thing I'm trying to do is to replicate the original series physics. It differs from game to game, but I'm leaning towards something ...
1
vote
0answers
11 views

Calculating a smooth velocity of interaction touches

I have a touch game and it would be beneficial to be able to know the "velocity" of each touch on the screen. Let me explain. Right now I am already subtracting current touch position from previous ...
1
vote
0answers
28 views

How to resolve multiple simultaneous ball collisions in a pool game?

I'm trying to simulate a break shot in billiards (1 ball hits a pyramid of 15 balls). The formula for 2D ball collision works correctly in my game. But when it is applied to the break-shot, the result ...
0
votes
0answers
13 views

Unity 2D Torque at position [duplicate]

I'm working on a 2D space game in Unity, and I wanted to include ships that might have reaction wheels centered around places other than the center of mass. If so, I'll need to be able to apply torque ...
0
votes
1answer
31 views

Simulation of a two-masses connected by a rod 2D system

I'm working on a multitouch-based interface and I want to add some physical behavior to gestures (pan, zoom and rotation). I thought model the system like that: When a touch starts, a point mass is ...
1
vote
1answer
61 views

Why does this whirlpool simulation not work?

I am trying to create a simple whirlpool simulation, where particles are constantly compelled to move towards a point in a whirlpool like fashion. To do this I do the following (in sudo code) ...
1
vote
4answers
103 views

Performing movement per game tick

Assume we have a player on a map, whereby the grid is represented as a floating point. When a player is moving, they have an x and y velocity. How to do you properly apply their movement each ...
3
votes
0answers
45 views

Rotation of a ball moving on a surface

I have a ball that moves along a platform. The ball is characterized as a sphere that has a radius and a position. The platform basically is a rectangle consisting of two vertex triangles. Its class ...
1
vote
1answer
29 views

Stuck on walls or sliding on top dilemma

I'm making a 2.5D platformer game. I earlier had problem with my character getting stuck on walls when holding the forward button. I solved this problem by adding a physics material with zero friction ...
1
vote
0answers
11 views

Serious issues with grid of connected springs

So i have a simulation I am trying to make where there is a grid. Each dot will be connected to the dot Above, below, left, or right (If such dot exists) via a logical grid. Theoretically when I ...
1
vote
1answer
26 views

In PhaserJS, how do I get a clicked Physics.P2 body's data?

I have a sprite with Phaser.Physics.P2 enabled, using a custom shape loaded with loadPolygon() from a .json file. I have also activated its debug and debugBody properties, so I can see the custom ...
1
vote
2answers
26 views

What is a good practice for deciding when to use transforms instead of applying force?

I was making several games. I don't understand when I should use addTorque instead of rotate. AddForce instead of position The latest game was a pinball game. I wasn't sure the best way to active ...
1
vote
1answer
51 views

Unity using Animation and Ragdoll

The question is simple, but I can't resolve it for a couple of days. I have an enemy model with ragdoll attached and also a couple of animations(e.g. idle, walk, run). It seems that ragdoll work only ...
1
vote
0answers
21 views

Solving constraints/joints in 1D

For n points moving in 1 dimension. Position and velocity are known for each point. Each frame a basic integration is done for each point: velocity += forces * timestep; forces = 0; position += ...
1
vote
0answers
45 views

When to Use Spatial Hashing vs Bounding Volume Hierarchy?

I've been slowly working on implementing a spatial hashing function into Bullet Physics to see how well it will work in my game engine as a general use. Though as I'm starting to design it, I do ...
1
vote
1answer
27 views

How to distinguish between full/partially intersecting Collider2D?

I'm using Unity 5 to make 2D game. I have a screen (gray), arena (green) and player-controlled object (yellow) that can be moved across the screen with mouse before placement: There is no ...
1
vote
1answer
69 views

Unity rope/cable physics / anchor points

I'm creating a cable in Unity, which should behave realistically. I found 2 different ways to approach the problem. First was to simply rigg a subdivided cylinder in Blender, Cinema4D or whatever ...
0
votes
0answers
29 views

p2 collision not working after state change

i have 2 objects GAME.ball Game.stick both have two bodies and i have two scene first scene GAME.ball = game.add.sprite(x,y,key) game.physics.p2.enable(GAME.ball, true); GAME.ball.body.dynamic = ...
0
votes
1answer
35 views

How to find starting velocity for a body thrown by an angle when known distance it must pass?

From course of mechanic, we know, that to find distance, passed by a body thrown by an angle, we need to use that formula: Sy(t) = V0 * sin(angle) * t - (gtt) / 2; Sx(t) = V0 * cos(angle) * t; My ...
1
vote
1answer
40 views

Handling movement on sloped surfaces - clamping character to sloped surface

I've noticed that a lot of people seem to have this issue but I've yet to find an actual working solution - when a rigidbody-based character controller (I'm not using Unity's character controller) ...
0
votes
0answers
11 views

Object freezes in the air when using Panda3d collisions

I'm trying to make a simple box fall to the ground in panda3d (1.10) This is the code I have so far: from direct.showbase.ShowBase import ShowBase from panda3d.core import * from panda3d.physics ...
36
votes
5answers
8k views

How can I give the illusion of height to a ball in 2D?

In 2D top down soccer games, sometimes a ball is given the illusion of being in the air, like below: How can I achieve this?
1
vote
1answer
18 views

Bullet Physics Applying Torques Effects not noticeable

I am applying torques to a rag doll in order to make it move/walk. For some reason, I am unable to view any effects when I use a call to rigidbody to apply torques even though these torques are ...
0
votes
0answers
21 views

How can I simulate a tilt switch with gravity?

I need to build a simple 3D simulation of a tilt switch, ie. a hollow cylinder with a sphere in it which can move from on end to the other according to the position of the cylinder (gravity). The only ...
0
votes
1answer
98 views

How to keep a rigidbody on the ground going up/down a slope? (Unity 2D)

I'm not sure if this is possible, but Im working a 2D project to has randomly generated loops (imagine a sin or cos graph). I have a 2D character (a quad for now). I want my character want to ski a ...
1
vote
1answer
28 views

Changing speed of an object

Is there a way of changing speed of an object at certain time? I want to change my speed to my initial speed after colliding with any object. I have already added bounce Physics to my colliding ...
0
votes
1answer
19 views

Maintain speed, in 3D game, after collision in Unity

I am making a simple breakout game. I have added bounce physics to the ball and to the bricks. When the ball collides with the bricks, the speed of ball slows down. I want ball to maintain its speed ...
0
votes
1answer
10 views

Altering Physics Property of a Shape in Unity

I want to create say 4 blocks, and each block will dictate how e.g. the bounciness of an object landing on it will behave. So if the block is made of sand, I don't want bounciness, if the block is ...
0
votes
1answer
100 views

How to achieve 2D ski movements similar to Alto Adventure?

I'm trying to achieve 2d movement similar to Alto's Adventure with Unity 2D. When grounded I want the character to slide alone the terrain parallel to the slope, but I want to be able to freely rotate ...
0
votes
1answer
47 views

How to calculate a simple swivel rotation? (no physics engine)

Assuming i know the geometry and the rotation angle of a cart, how can i calculate the rotation angle of a swiveling wheel? To get the rotation angle of the wheel, i tried by calculating the ...
0
votes
0answers
19 views

How to model muscle contraction force acting on two bones connected by joint in Unity/PhysX?

I'm trying to understand what is a correct way to model a muscle contraction in a physics engine like PhysX (Unity3D). Muscle that I'm modelling is connected to a bones in 2 points A and B. Having a ...
0
votes
1answer
45 views

Calculating required force for pushing a body to a desired position at once in Unity [duplicate]

In a 3D world I simulate that a coin is being pushed over a plane (applying a force in his rigidbody where y-axis = 0) using a top-down view. Some time ago but using Box2D, I was able to calculate ...
2
votes
0answers
56 views

Movement & arriving using forces

3D. Given a point mass m, inital position p0 initial velocity v0, and a desired location d, how do I apply forces (with magnitude no greater then fMax) to move m to d and stop. I know how to apply ...
0
votes
1answer
104 views

How to program destructibles?

I'm thinking about programming a 2d simulation of a spaceship that takes damage depending on where the projectile came from (e.g. from behind - engine, from the front - lasers, sides - hull, etc.). ...
0
votes
0answers
50 views

Game Physics with RK4 and VB.NET

http://gafferongames.com/game-physics/integration-basics/ I tried to have a go at porting this to VB.NET: Public Structure State Dim x As Single ' position Dim v As Single ' velocity End ...
1
vote
1answer
40 views

Gravity wells that go with finger [duplicate]

I have a simple particle game, where all the particles are arranged in a grid. This game is for touch devices so to take advantage of it I am trying to have a multitouch gravity field thing going on. ...
-1
votes
1answer
74 views

How to make an object fly disabling gravity through C# script in unity

I want to make an object fly which has ridged body physics by disabling its gravity after pressing a key. So I just want to know how to disable gravity through C# script. I already went through google ...
0
votes
1answer
59 views

Bouncing Balls in angular movement

I'm trying to bounce a ball off of a wall based on angular movement. The ball comes in at angle X ( lets say 30 ). Bouncing off with the equation 360-ballangle works for the left and right walls 180-...