Questions tagged [game-physics]

Game Physics is about implementation, creation, optimization and any other thing related to physics in games. Physics controls the interaction of every physical object in a game, where any 2d or 3d model interacts with any other 2d or 3d model of an object in a game. Physics is used to give realistic effects of this interaction.

Game Physics is about implementation, creation, optimization and any other thing related to physics in games. Physics controls the interaction of every physical object in a game, where any 2d or3d model interacts with any other 2d or 3d model of an object in a game. Physics is used to give realistic effects of this interaction.

3864 questions
12
votes
2 answers

How could I achieve the effect of "lava" leaving traces

After some time of "development" of the JavaScript game, I've came to a great idea, or so it seemed / sounded. I was thinking of creating an entity which would represent lava. That lava would move in a specific direction, using: function Lava(pos,…
random
  • 205
  • 1
  • 8
12
votes
1 answer

SpriteKit Physics Joints corrupt for moving scene

I've created a SpriteKit Scene with physics bodys. This is working quite well. I'm also scrolling the scene around, using the Apple best practice with a "camera node". My scenes node tree is like that: Scene |- World |- Camera node |- Game…
Nuker
  • 2,577
  • 5
  • 21
  • 32
12
votes
3 answers

The physics of turning in a boat

I am writing a small simulation of a boat (a sailboat under power rather than sail). It has a rudder and a keel and I have most of the physics working for the thrust and drag. I have modelled the drag across the boat to be higher than along the…
Magic Bullet Dave
  • 9,006
  • 10
  • 51
  • 81
11
votes
2 answers

3D collision detection : convex hull vs convex hull , need Position and Normal

I want to know an approximate 3D position and 3D normal of collision site between two 3D convex hulls (A vs B). The CPU in parenthesis shows relative CPU-time needed in my finished program. Part 1: Early-out (CPU 1%) In the first step, I use a…
javaLover
  • 6,347
  • 2
  • 22
  • 67
11
votes
3 answers

Fluid Simulation "Blows Up"

The following fluid simulation is a translation of a paper by Stam. Something truly terrible has happened. Each time the program is run with a low DIFF=0.01, the values start off small and then rapidly expand, or "blow up". I have checked the math…
qwr
  • 9,525
  • 5
  • 58
  • 102
11
votes
2 answers

A way to apply zRotation so that it affects the SKPhysicsBody accordingly?

Let's say I have a SKSpriteNode that represents a car wheel, with a circular SKPhysicsBody successfully attached to it. The genre would be sideways scrolling 2d car driving game/simulator, obviously. What I want is to calculate all the in-motor…
11
votes
2 answers

Is it possible to make realistic n-body solar system simulation in matter of size and mass?

Important note: this question has utterly no relation to "PhysX", which is a computer-game-physics system (useful for the physics in arcade games such as ball games, etc); PhysX is a system built-in to Unity3D and other game engines; PhysX is…
OldBerkay
  • 171
  • 1
  • 2
  • 13
11
votes
2 answers

4d and n-dimensional physics engine

Was somebody trying to implement 4d or n-dimension physics realtime (or not) engine? What difficulties in this implementation, compare to 3d and 2d physics engines? Of course, one of which is presentation problem. Is's an interesting to look at and…
Ivan Kochurkin
  • 4,413
  • 8
  • 45
  • 80
11
votes
3 answers

Bullet Physics Simplest Collision Example

I'm trying to use Bullet Physics for collision detection only. I don't need it to move any objects for me or handle rendering with callbacks. I just want to update object locations every frame and use it to tell me when I have collisions. To get the…
Aztal
  • 217
  • 1
  • 5
  • 12
10
votes
2 answers

How to simulate chain physics (game design)

I am trying to create a chain of moving objects for a game (AS3). So far, I can drag objects behind another object, but all I can do is make a link move closer to another link based on distance. It doesn't work realistically and it still follows…
Joseph Wagner
  • 303
  • 3
  • 16
10
votes
2 answers

Why are computer/game physics engines often non-deterministic?

Developing with various game physics engines over the years, I've noticed that on the same machine I observe widely different results in physics simulations between runs. Most recently, the Unity engine does this, even though physics are calculated…
10
votes
1 answer

how can I determine if a square can reach position without contact with other sprites?

From the image above, given an initial position of b0(x, y), an end position of b1(x, y) and positions a(x, y) and c(x, y). How can I predetermine if square B0 will move from b0(x, y) to b1(x, y) without getting into contact with rectangle A and C?…
ItsMeAgain
  • 595
  • 4
  • 18
10
votes
2 answers

Calculate moment of inertia given an arbitrary convex 2D polygon

I've been researching this question for hours and for some reason I haven't been able to find the solution. Given a convex polygon that is defined as an array of points in clockwise order around the polygon's centroid, how can I calculate the…
Parker Hoyes
  • 2,118
  • 1
  • 23
  • 38
10
votes
2 answers

Velocity units in SpriteKit

I am using SpriteKit to shoot a projectile. The projectile node is given an impulse using -(void)applyImpulse:(CGVector)impulse. I want to calculate the distance the projectile will fly before hitting the ground, which can be done easily knowing…
Bram De Geyter
  • 1,088
  • 8
  • 15
10
votes
3 answers

How to fix circle and rectangle overlap in collision response?

Since in the digital world a real collision almost never happens, we will always have a situation where the "colliding" circle overlaps the rectangle. How to put back the circle in the situation where it collides perfectly with the rectangle…
VanDir
  • 1,980
  • 3
  • 23
  • 41