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

What's the best book to give you the math and physics background to make your own game engine? [on hold]

I want to make my own game engine, but could use a refresher on math and physics. I already know some stuff (like how to multiply matrices, integrals, differential calculus etc.). I've narrowed my ...
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
0answers
12 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
24 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
41 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 ...
0
votes
0answers
18 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
37 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
25 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
35 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
23 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
34 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 ...
0
votes
1answer
21 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
8 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 ...
-4
votes
0answers
29 views

Is there any way to have a Character Controller be pushed by a rigidbody?

Noob question, any help appreciated. Thanks
35
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
16 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
74 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 ...
0
votes
1answer
17 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
18 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
9 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
78 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
38 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
16 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
40 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
53 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
97 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
44 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
38 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
51 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
53 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-...
1
vote
1answer
43 views

2D circle against a corner change in direction

I have a 2D Ball that might go against a wall. If the Ball goes against the wall perpendicularly, it will just invert its direction (assuming no air resistance and no bounces that should make its ...
0
votes
1answer
39 views

How to move 2D objects based on mouse movement with pointer locking?

I'm using pointer locking for a 2D game (where you perform calculations based on the delta in mouse positions from frame to frame). I'm having some basic math/logic issues with accomplishing what I ...
0
votes
1answer
39 views

Creating 3D gravity in zero-G tied to mass in unity with c#

As a total beginner, I've been working on a patch-job script for a gravity mechanic in an open space sim, I want to derive all my objects from this "Block ALPHA" object and its' set of variable ...
1
vote
1answer
54 views

Simulating elastic ball collisions quickly escalates to disaster

I'm trying to learn HTML canvas and was working on a basic physical simulation, where a number of balls are drawn and set in motion, and the program simulates them colliding and bouncing off the walls ...
1
vote
0answers
44 views

Game Physics: Calculating a collision response using the Separating Axis Theorem?

I am working on a project in which I have implemented the Separating Axis Theorem to detect collisions between objects. My current collision response is an object that contains whether it is ...
2
votes
0answers
27 views

In Unity3D (and PhysX), how do I calculate the products of inertia?

Since unity3d uses physx underneath the surface, obviously they share the same features. One of the features is the moment of inertia tensor - Unity3D one, PhysX one. Though, they use the diagonal ...
4
votes
0answers
103 views

Implementing proportional navigation in 3D

Good afternoon guys, a = N * λ' * V is the formula for the commanded acceleration required to hit the target, where N is the proportionality constant, λ' is the change in line of sight and V is ...
1
vote
2answers
54 views

Calculating the angular momentum of rigidbody in Unity3D

Knowing that angular momentum in 3D is L = Iω (moment of inertia times angular velocity), how do I calculate it in video game world? In unity3d I have the diagonal inertia tensor rigidbody....
3
votes
1answer
54 views

In Unity3D, what is the relation between inertiaTensor and inertiaTensorRotation?

In unity3d there are two properties on rigidbody that correspond to the moment of inertia tensor. One of them is: rigidbody.inertiaTensor, which I know is the diagonal of the inertia tensor, The ...
1
vote
0answers
37 views

Algorithm to propagate internal Physics force in a structure of building

Scenario: A floating structure composes of many nodes (or in more visual meaning - a cubic block). Every node is snapped to the same 3D grid. (similar to a minecraft castle) There are external ...
0
votes
1answer
41 views

How to program friction in an air hockey game in Cocos2d-x 3.11?

I'm developing a simple air hockey game, and I have a question about friction of puck and puddles with the game scene. How can I do that? I'm using cocos2d-x default physics engine, and the friction ...
2
votes
1answer
145 views

How i can make better jump to my game? - C++ SFML

So, I ask question about my 2D game, actually it is not game, but it is something like poor game. Well i made moving system and now is time to make jump. I made some kind of gravity with tutorial but ...
0
votes
0answers
33 views

Box2D + SDL - Weird body positions

I'm having a problem where either my sprite, or my body position is off. Here's a picture so you can see exactly what's going on : (The box has stopped on the picture, probably because it's colliding ...
0
votes
0answers
22 views

Centripetal Force

I'm using C++. So, I found this post on here that gave me a good start. I have managed to correctly add centripetal motion to my enemy objects. Since the objects are constantly changing direction, ...
1
vote
0answers
30 views

Hinge/Configurable Joint rotating even if constrained

I already posted the question over on Unity forums, though, I have to say, this place often seems more professional and knowledgable, so here goes mirror post. I have a Cylinder with a Hinge and a ...
0
votes
0answers
17 views

add physics to a group or container body in phaser

I'm developing a HTML5 Phaser game. In this game I do have a Group which I would like to behavior as a physics body (arcade-physics). It is a character with a lot of moving parts (sprites) inside ...
-1
votes
1answer
39 views

Obtain jump vector given time, distance and gravity

I tried for several days to solve my problem , but in the end I just gave up and I decided to ask , since the solution is beyond my knowledge I'm writing a 2d top-down game, in order to simulate the ...
0
votes
2answers
38 views

Turn Radii and speed calculations

Ok guys I'm an aspiring game designer and I'm trying to develop a racing board game using real life as a basis for my mechanics. The problem im having is I'm not very mathematically inclined I found ...
0
votes
0answers
8 views

Why is my 2D rigidbody behaving strangely with a negative scale?

I've been making a system that when you click on a monster's limb it destroys the limb you clicked and makes fall to the ground the children limbs. There is a rigidbody attached to the monster ...