Questions tagged [physics]

Refers to real-world physics. For simulation of physics in games use the [game-physics] tag instead, for questions using an existing physics engine use [physics-engine]. Physics is a science that studies the interactions of energy and matter. Questions with this tag concern the simulation or implementation of real-world physics concepts in programming.

The physics tag should be used for questions about how physics can be simulated or implemented in programming. Please ask questions about physics in a non-programming context on the Physics site. Also consider that questions specific to a simplified or approximate physics engine for use in games might receive better answers if asked on Game Development.

3476 questions
1
vote
1 answer

2d Physics enegine for xna 4

What is the best 2d physics engine for xna 4.0 in your opinion ? Farseer don't work at all on my vs2010 :/
1
vote
2 answers

Why is my dynamic physics body able to push my static physics body? In Swift

I have a player and a wall, whenever the player walks into the wall it pushes it away. The wall is static and the player is dynamic anyone know how to fix this? Player code: player.texture = SKTexture(imageNamed: "player") player.position =…
Jason
  • 93
  • 9
1
vote
1 answer

How to create realistic ball drop from cliff using swift and UIkit

I try to make the ball with realistic physics when it fall from cliff, as you can see in in image 2. that's what I what to achieve, for now I have what is drawn in image 1. for image 1. I use this code: ball.center.x += 5 ball.center.y -= 4 By the…
artG
  • 235
  • 3
  • 12
1
vote
0 answers

I need to generate random physics base vectors in c#

I am working on a mono game using c# (Visual Studio 2015)that needs to incorporate random velocities. I am working with: const float BaseSpeed = 0.15f; Vector2 upLeft = new Vector2(-BaseSpeed, -BaseSpeed); Vector2 upRight = new…
eldron
  • 11
  • 1
1
vote
0 answers

Drag rigid body based on touch in Unity 2D

I want to drag object based on Player touch and drag in device. So for reference I have used following script: nucleartide/DragPiece2D.cs At present object was not reacting based on touch. But definitely joint between two objects get…
Siddharth
  • 4,142
  • 9
  • 44
  • 90
1
vote
1 answer

SceneKit: slow loading of UIView after contact between two nodes

I just found a really odd behavior with Scene Kit. I created a clean project to see if this would happen, and it did. Consider the following GameViewController class: import UIKit import QuartzCore import SceneKit class GameViewController:…
zantuja
  • 211
  • 1
  • 4
  • 14
1
vote
1 answer

SpriteKit joint: follow the body

I've been asked to simplify this question, so that's what I'm doing. I'm struggling in SpriteKit's physic joints (and possibly physic body properties). I tried every single subclass and many configurations but seams like nothing works or I'm doing…
Chris Rutkowski
  • 1,774
  • 1
  • 26
  • 36
1
vote
0 answers

Sk Physics Joint not working properly

I am creating a game and for my character his legs and torso have separate animations so they are separate nodes with separate physics bodies. I am having a lot of trouble linking the torso and the legs together however, linking them is not the…
gkolman
  • 189
  • 10
1
vote
1 answer

Smooth fall in Unity - C#

I am working on a Character Controller Script and everything is working fine but the problem is that once my player starts to fall it is so sudden and jerks down. I would like the player to gradually fall down, this is my character controller script…
AJ Tech
  • 75
  • 9
1
vote
1 answer

libgdx box2d body - How to move body by the given force or speed, distance and time

Example: A cannon fired with the speed of ball 60 kpH/ Given: (60 kpH) Distance = 60 kilometers, Time = 1 hour Libgdx: GameWorld // Given that I am using 1/45.0f step time, the rest iteration velocity 6 and position 2 // Given that 60.00012…
ronscript
  • 397
  • 1
  • 8
  • 33
1
vote
2 answers

Finding the force of acceleration on an attractive body

I have a simulation with a planet orbiting a star. The equation for force on the planet is: G⋅M1⋅M2⋅(q1−q2)/||q1−q2||3 Where G is the gravitational constant, M1 and M2 are the masses of the star and planet, and q1−q2 is the difference between the…
Display name
  • 721
  • 2
  • 11
  • 29
1
vote
2 answers

How to make a moving sprite fall with physics in SpriteKit

I have a moving object that spawns object2 thats attached by a sliding joint When i press the button , the joint is removed and the object2 falls down with gravity this works, but only falls down on the x axis without retaining its y axis speed.…
Jackster
  • 41
  • 7
1
vote
1 answer

Adding physics to a UWP app

Currently I am drawing all of my elements using Win2d. I have read this in regards to Win2d here: Win2D is a graphics API rather than a complete all-in-one game engine, but you could certainly use it to implement the graphics portion of a 2D game,…
Riley Bracken
  • 5,959
  • 2
  • 16
  • 17
1
vote
1 answer

How to add friction/damping to circle to circle prediction formula?

I've been working on determining the time at which two objects would collide, if they would at all. I had referenced this thread which was very helpful: Circle-Circle Collision Prediction (Oax + t*Dax - Obx - t*Dbx)^2 + (Oay + t*Day - Oby - t*Dby)^2…
Matt Kenefick
  • 1,173
  • 1
  • 13
  • 22
1
vote
0 answers

SCNPhysicsBody is not matching in SceneKit

I have am trying to stop the moving man when it hit with a plane but it is not stopping as it pass away from plane.According to apple documentation i apply simple shape as capsule to moving man and also setup collisions category but it is not…
Sipa
  • 383
  • 1
  • 13
1 2 3
99
100