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
4 answers

Mujoco_py missing path to LD_LIBRARY_PATH, Ubuntu 16.04

I am trying to get mujoco_py running. When I do import mujoco_py I get this error: Exception: Missing path to your environment variable. Current values LD_LIBRARY_PATH= Please add following line to .bashrc: export …
J. Siek
  • 43
  • 2
  • 10
1
vote
0 answers

Python: Getting a Vector Field from Gradient of Scalar Field

I am trying to plot potential values as a function of x and y and use this to plot the electric field as a vector field. I am not succeeding in plotting the vector field as it seems that in order to use numpy.gradient I need to either know function…
1
vote
1 answer

Can anyone help me understand how to simulate fluids?

I'm trying to make a program that simulates the physics of fluids in Processing. In the IDE there's an included example: /** * Fluid * by Glen Murphy. * * Click and drag the mouse to move the simulated fluid. * Adjust…
Mike
  • 963
  • 4
  • 16
  • 38
1
vote
1 answer

Unity - CheckSphere not working? spawn freezes only on device?

I am trying to spawn a set number of cubes within an ever changing area (a plane, ARKit) and NOT have them overlap. Pretty simple I'd think, and I have this working in Unity editor like so: My problem is deploy to device (iPhone) and everything is…
blue
  • 7,175
  • 16
  • 81
  • 179
1
vote
1 answer

Chipmunk objects fall through floor at high velocities. Help?

I'm using Chipmunk cocos2d for what will ultimately be a sound-generation game where colliding particles make noise. But right now, I'm running into a problem: my particles keep falling through the floor! In the example "bouncing ball" templates,…
buildsucceeded
  • 4,203
  • 4
  • 34
  • 72
1
vote
0 answers

bullet physics: to move rigid body to particular point

I am new to bullet physics and my usecase is like I Know start position (x1 ,y1)and end position (x2,y2) .now by applying some force at the center of rigid body,it should move to end position (x2,y2) and then because of gravity it should fall …
anil valmiki
  • 181
  • 1
  • 11
1
vote
1 answer

Real time physics with MPI

I am considering working on a rigid body parallel physics engine, with MPI, as my own project. Have some experience with serial engines. So far, I couldnt find any existing projects of that type, does enyone knows about such things? I know that MPI…
kirbo
  • 1,707
  • 5
  • 26
  • 32
1
vote
0 answers

Draw a truncated-cone-based vortex in matplotlib

I am trying to make a rudimentary model for the a coronal hole in my mathematics thesis. I am looking to create a plot where the radial direction of the cylinder increases with proportionally with the height and then I would like to add twists in…
K-Q
  • 133
  • 8
1
vote
1 answer

Create a SKNode attracted to larger node via an SKFieldNode without moving the larger node

In my game, I have a larger SKNode that uses an SKFieldNode radial gravity field to attract other, smaller nodes towards it. This results in the larger node being moved by the force of the smaller nodes, which isn't optimal for my game. (For…
1
vote
2 answers

How to use MDAnalysis to principal_axes and moment_of_inertia with a group of atoms?

I am trying to use MDAnalysis (MDAnalysis.__version__ == 0.17.0) API functions principal_axes() and moment_of_inertia() to calculate these matrices for a group of selected atoms as described in the doc: import MDAnalysis from…
0x90
  • 39,472
  • 36
  • 165
  • 245
1
vote
0 answers

Test whether an SCNNode contains a point

I need to check simply whether an existing spawned SCNNode contains a point - if any of my nodes that I store in an array contain this point, I can't spawn here. Problem is even though I continually spawn in the SAME POSITION (I make sure of this)…
blue
  • 7,175
  • 16
  • 81
  • 179
1
vote
0 answers

SceneKit: check if node is not in contact with any other node?

Ok, trying to understand how to do this - I have a character (SCNNode) and need to determine if where the player is about to move (walking forwards) if there is no platform to hold him up (player affected by gravity). If there isn't I am going to…
blue
  • 7,175
  • 16
  • 81
  • 179
1
vote
2 answers

AABB vs Circle collision in custom physics engine

I have followed this tutorial: https://gamedevelopment.tutsplus.com/tutorials/how-to-create-a-custom-2d-physics-engine-the-basics-and-impulse-resolution--gamedev-6331 to create a 2d physics engine in c# (he works in almost all the time wrong and…
schnavid
  • 167
  • 1
  • 3
  • 9
1
vote
3 answers

Java Bouncing Ball Game - Rolling Ball Scenario

I am writing a bouncing ball game in Java for Android phones. Everything seems to work fine apart from a small problem with collisions and the coefficient of restitution. When a ball collides with a surface, the vector normal of this surface is…
woodstock365
  • 1,780
  • 4
  • 19
  • 35
1
vote
1 answer

MPI and message passing in Julia

I never used MPI before and now for my project in Julia I need to learn how to write my code in MPI and have several codes with different parameters run in parallel and from time to time send some data from each calculation to the other ones. And I…
B B
  • 23
  • 4