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

Bouncing object using Vector3.Reflect as Quaternion

So I'm having this problem where I am trying to make bullets ricochet off obstacles in Unity. Currently I am using Vector3.Reflect to set Vector3.Forward of my object. Expected Result vs. Actual Result My expected result would be that the bullet…
1
vote
1 answer

Group consecutive rows in a pandas dataframe by conditioning on hitting max value in another column

I have a pandas dataframe indexed by a time series with columns of GPS latitude and acceleration for a satellite orbiting the Earth. This latitude oscillates between maximum and minimum values with a constant time period as expected. What I want to…
1
vote
0 answers

Error when trying to install gpaw

When I try to run sudo pip3 install -U gpaw I get the following error Command "/usr/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-n4w3sszk/gpaw/setup.py';f=getattr(tokenize, 'open',…
1
vote
2 answers

Drawing a Projectile Motion Path in Android

I asked this question before, but I think I worded it badly and thus did not get any response. I am trying to make an app for android that draws the path of an object in projectile motion. I have the equations to make this work, but for some reason,…
Tom C
  • 232
  • 1
  • 6
  • 17
1
vote
0 answers

Crash system Unity3d

I'm making car game in unity3d, I have city, cars, street lamps etc. I want to make it destroyable, like in GTA. For now its working like it should be, but problem is with resistance of some object, for example traffic lights or lamps, objects which…
LadIQe
  • 895
  • 1
  • 6
  • 8
1
vote
1 answer

How to implement trolley-like physics behaviour in Unity

I am stuck with two things while trying to simulate the physics setup for a trolley-like object (push powered vehicle with free rotating wheels on the front and fixed wheels on the back). I have the RigidBody with its mesh and four WheelColliders,…
momo
  • 3,404
  • 6
  • 37
  • 66
1
vote
0 answers

How to generate multiple convex hulls to cover a 3D concave trimesh

I am working on a 3D physics simulation environment and have run into the problem of concave shapes being hard to model physically. I'm currently using Bullet Physics to do the heavy lifting and it does not support dynamic concave shapes at all. My…
koreus737
  • 661
  • 3
  • 9
  • 18
1
vote
1 answer

Turning player direction without speeding up

I'm trying to make a small prototype of a tribes-like game, mainly inspired by Tribes:Ascend. The problem is that the movement is hard to make. Skiing, which is sliding frictionless on the ground to maintain speed, is no problem. Air/ski control on…
1
vote
0 answers

How to simplify dot product in physics-package in maple?

I am using physics-package in maple. I have used FRW metric for calculating Einstein and Ricci tensors. And I defined some four-vectors and I wanted to calculate their dot product. But maple doesn't simplify A[mu]B[~mu]. However when maple…
Toktam
  • 11
  • 2
1
vote
1 answer

My gravity simulation gets stuck

I am making a gravity simulator to get the feel for physics based coding and I have made an idea here. But I have a problem, after some point after bouncing, the particle (square) gets stuck bouncing to the same point. Does anyone know why? Heres a…
Bestlogo56
  • 75
  • 6
1
vote
1 answer

2D game - Missile shooting problem

I have to make a tank that sits still but moves his turret and shoots missiles. As this is my first Android application ever and I haven't done any game development either, I've come across a few problems... Now, I did the tank and the moving turret…
Nick
  • 11
  • 2
1
vote
2 answers

How to check the rate of increase of a variable in Java?

I am trying to obtain the rate of change (increase or decrease) of a variable in Java. For example, I have a Processing program that changes the velocity of an object depending on the gravity and the amount of time the mouse button is held down. I…
Glace
  • 127
  • 1
  • 3
  • 10
1
vote
1 answer

Gyroscope/Accelerometer in iPhone - reading speed of object

How would I implement something that can make use of the iPhone 4's gyroscope and accelerometer in order to find out the speed/velocity at which the object is moving? For example, if I took the iPhone into a car, it would tell me how fast the car…
joshim5
  • 2,292
  • 4
  • 28
  • 40
1
vote
0 answers

Ising Model 2D Python - Long Run Times and Data Fluctuations

There are two (possible) problems to this code I could use help with. I have written the following code to calculate the average energy, magnetisation and specific heat of a material with lattice sizes 10x10, 50x50 and 100x100. The graphs shown…
P.Blah
  • 31
  • 1
  • 4
1
vote
2 answers

Falling Sand simulation

I'm trying to re-create a 'falling sand' simulation, similar to those various web toys that are out there doing the same thing - and I'm failing pretty hard. I'm not really sure where to begin. I'm trying to use cellular automata to model the…
Erik Forbes
  • 35,357
  • 27
  • 98
  • 122