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
10
votes
1 answer

Is there a JavaScript physics library that works with HTML elements such as divs rather than in canvas?

I am working on a simple stack for a game where players move numbered pieces around to keep track of how close they are to finishing collecting a winning hand of pieces. Currently I went with jQuery UI's draggable and droppable. It is good for…
Cetin Sert
  • 4,497
  • 5
  • 38
  • 76
10
votes
3 answers

Android, libgdx and box2d basics

I wrote couple of simple board games since i started on android learning, Please let me know is there any tutorial or links, where i can start with physics library with libgdx, looking for something like basics of physics with libgdx
Yogesh
  • 1,206
  • 4
  • 22
  • 50
9
votes
3 answers

Math/Calculations for infinite/repeating world with rotation

How do I make a infinite/repeating world that handles rotation, just like in this game: http://bloodfromastone.co.uk/retaliation.html I have coded my rotating moving world by having a hierarchy like this: Scene   - mainLayer (CCLayer)      -…
Neigaard
  • 3,726
  • 9
  • 49
  • 85
9
votes
5 answers

Problem with collision detection of a fast moving ball with a racket controlled by mouse

In unity, i have a racket which is supposed to hit a ball, and the racket is controlled directly by the mouse, i.e the bat is being moved by the mouse using mouse axes and the using transform.translate() function to move the racket. I expected that…
SpeedBirdNine
  • 4,610
  • 11
  • 49
  • 67
9
votes
4 answers

SAT Polygon Circle Collision - resolve the intersection in the direction of velocity & determine side of collision

Summary This question is in JavaScript, but an answer in any language, pseudo-code, or just the maths would be great! I have been trying to implement the Separating-Axis-Theorem to accomplish the following: Detecting an intersection between a…
9
votes
3 answers

Unity function to access the 2D box immediately from the 3D pipeline?

In Unity, say you have a 3D object, Of course, it's trivial to get the AABB, Unity has direct functions for that, (You might have to "add up all the bounding boxes of the renderers" in the usual way, no issue.) So Unity does indeed have a direct…
Fattie
  • 27,874
  • 70
  • 431
  • 719
9
votes
2 answers

SceneKit collision occasionally fails

I'm trying to simulate a soccer game. I have a SCNPlane that simulates the court. I have imported a Soccer goal 3d model (.dae file) and also a ball model (.dae). My ball has a dynamic physics body, the plane static and the goal is kinematic. I…
Fernanda Toledo
  • 165
  • 1
  • 6
9
votes
3 answers

2D platformers: why make the physics dependent on the framerate?

"Super Meat Boy" is a difficult platformer that recently came out for PC, requiring exceptional control and pixel-perfect jumping. The physics code in the game is dependent on the framerate, which is locked to 60fps; this means that if your computer…
Archagon
  • 2,470
  • 2
  • 25
  • 38
9
votes
2 answers

Circle to Circle Segment Collision

I'm struggling to find a rock solid solution to detecting collisions between a circle and a circle segment. Imagine a Field of View cone for a game enemy, with the circles representing objects of interest. The diagram at the bottom is something I…
9
votes
1 answer

How do you use 3D graphics in Android Studio?

I am wondering how app developers create games with 3D animations and graphics. Does anyone know how those games are made, and can it be done with android studio?
user4792835
  • 159
  • 1
  • 1
  • 7
9
votes
5 answers

SKPhysicsBody bodyWithPolygonFromPath memory leaks

I have a strange memory leaks when creating Sprite Kit physics bodies with custom shapes. This is how my implementation looks: CGFloat offsetX = self.frame.size.width * self.anchorPoint.x; CGFloat offsetY = self.frame.size.height *…
Darrarski
  • 3,882
  • 6
  • 37
  • 59
9
votes
2 answers

how to use the libgdx contactlistener

I've just began to work with the Libgdx's Box2d Engine but i simply do not understand when the methods of the Contactlistener should be called. There is on the one hand "begin contact" and on the other "end contact". Where should i call them, to get…
Xerusial
  • 525
  • 1
  • 5
  • 17
9
votes
3 answers

Prevent body from rotating in Box2D

I am currently using Box2d, more precisely the Java port jBox2d. I have a circle that is colliding with other circles when falling (all those circles form a kind of a crank, see picture below). Naturely, the circle begins to rotate when falling.…
Undo
  • 1,165
  • 2
  • 10
  • 15
9
votes
6 answers

Determining Resting contact between sphere and plane when using external forces

This question has one major question, and one minor question. I believe I am right in either question from my research, but not both. For my physics loop, the first thing I do is apply a gravitational force to my TotalForce for a rigid body object.…
mmurphy
  • 1,327
  • 4
  • 15
  • 30
8
votes
3 answers

TDD And Game Physics

I'm playing around with a small game project and as I'm not very experienced in TDD I'd love to get some expert opinions on a couple of things. First of all, I realized early on that TDD did not seem ideal for game development. It seems that…
Landon
  • 561
  • 1
  • 3
  • 10