physics

Simple physics-based movement.

Hi. I'm working on a 2D game where I'm trying to accelerate an object to a top speed using some basic physics code. Here's the pseudocode for it: const float acceleration = 0.02f; const float friction = 0.8f; // value is always 0.0..1.0 float velocity = 0; float position = 0; move() { velocity += accelera...

Getting position of PhysX wheel

I'm using the NxWheelShape to simulate wheels on my car. When I render the wheel model, I use shape->getGlobalPose() to get a 4x4 matrix and render the wheel there. However this gives me the position of the shape, not where the casted ray hits other geomnetry, so even if the car behaves properly, the wheels are stationary (don't even rot...

Open source physics engines

I have been using the Open Dynamics Engine (ODE) for the last few weeks with great success. It has a very simple API and its simulations at least look realistic. (I sometimes wonder about my collision joint parameters, but whatever.) My only complaint is that it is sometimes a dog. If I naively simulate 1000s of interacting bodies, then...

Predicting drying time (similulating physical systems)?

ACM Question: Simulations involving service times and queues are fairly routine despite using statistical distributions to generate data of interest. Most physical systems are far more complex. Given Weight of a Towel Surface Area of Towel Dryer Volume Dryer Max Temperature Dryer Revolutions/Minute Boiling Point of Water Weight ...

How can I compute the mass and moment of inertia of a polyhedron?

For use in a rigid body simulation, I want to compute the mass and inertia tensor (moment of inertia), given a triangle mesh representing the boundary of the (not necessarily convex) object, and assuming constant density in the interior. ...

Game network physics collision

How to simulating two client-controlled vehicles colliding (sensibly) in a typical client/server setup for a network game? I did read this eminent blog post on how to do distributed network physics in general (without traditional client prediction), but this question is specifically on how to handle collisions of owned objects. Example ...

Bouncing ball not conforming to Conservation of Energy Rule!!!

Hi all, I am currently busy on writing a small ball physics engine for my programming course in Win32 API and c++. I have finished the GDI backbuffer renderer and the whole GUI (couple of more things to adjust) but i am very near to completion. The only big obstacles that last are ball to ball collision (but i can fix this on my own) but...

3D Camera Zoom and follow physics in java?

I'm trying to make it so that no matter how far apart two objects are they'll both remain on screen. I'm using JOGL, but that shouldn't matter as I just need help with the math. This is what I have so far: float distance = (float) ((Math.sqrt((p1.x - p2.x) + (p1.y - p2.y)))); float camx = (float)((p1.x + p2.x) * 0.5); float camy = (flo...

Ball to Ball Collision - Gains significant velocity upon collision

I implemented the code from the question "Ball to Ball Collision - Detection and Handling" in Objective-C. However, whenever the balls collide at an angle their velocity increases dramatically. All of the vector math is done using cocos2d-iphone, with the header CGPointExtension.h. What is the cause of this undesired acceleration? The f...

Database design for physics hardware

Hi everyone, I have to develop a database for a unique environment. I don't have experience with database design and could use everybody's wisdom. My group is designing a database for piece of physics hardware and a data acquisition system. We need a system that will store all the hardware configuration parameters, and track the change...

The Math of a Jump in a 2D game.

I have been all around with this question and I can't find the correct answer! So, behold, the description of my question: I'm working in J2ME, I have my gameloop that do the following: public void run() { Graphics g = this.getGraphics(); while (running) { long diff = System.currentTimeMillis() - lastLoop; ...

PhysX for massive performance via GPU ?

I recently compared some of the physics engine out there for simulation and game development. Some are free, some are opensource, some are commercial (1 is even very commercial $$$$). Havok, Ode, Newton (aka oxNewton), Bullet, PhysX and "raw" build-in physics in some 3D engines. At some stage I came to conclusion or question: Why should...

Changing the speed of a circular motion

I'm looking for a way to smoothly increase or decrease the speed of a circular movement. Using the parametric equation of a circle, I can move an object in a circle over time: x = center_x + radius * sin(time * speed) y = center_y + radius * cos(time * speed) The problem with this approach is that I can't simply do speed = speed + 1 ...

What is the name and most common implementation of this property of 3d graphics engines?

I want to say “unrestricted frame of reference” or “spatially-related independent sub-environments”, but I don't think those are right. Imagine two long, cylindrical spaceships floating next to each other on a level plane with the same orientation. Each ship has its own set of rooms and corridors in which players move freely in a first-...

Trajectory -math, c#

Hi, I am trying to map a trajectory path between two point. All I know is the two points in question and the distance between them. What I would like to be able to calculate is the velocity and angle necessary to hit the end point. I would also like to be able to factor in some gravity and wind so that the path/trajectory is a little...

Calculate forces on a box

Story: I am developing a construction tool for wooden boxes. A box consists of a set of boards, each board is represented as 3 3D-vectors, and one placement vector. Each box is visualized using OpenGL. Now, these boxes will be moved around with forklifts, which will apply some forces on them. I would like to calculate the forces on each...

Simple 2d physics tutorial for terrain collision detection

Hi, I am looking for a tutorial which will show me how to do simple 2d physics like the ones in this (http://www.teagames.com/games/tgmotocross/play.php). The part that I am most interested in is how the collision detection is done between the character / player and the terrain, as well as how to store / generate the terrain. The langua...

Are there any decent physics engines for Android?

I've looked around for a physics engine that will play nicely with Android, but I've only been disappointed. In terms of performance, I had heard that jbox2d was the best bet, but (from my understanding) ever since Android SDK V1.0, the Dalvik VM's verifier has become very strict and rejects some of the key classes and refuses to run. T...

How to use 16bit heightmaps with Ogre3d and PhysX

I'm using Ogre3D and PhysX. When I load a terrain from an 8bit height map, it looks normal on Visual Debugger. Look at first image: http://img44.imageshack.us/gal.php?g=44927650.jpg But when I save the height map as a 16bit image, I get what you see on second image. Here's the code, thats works normal with 8bit PNG: mSceneMgr->s...

Implementing a dired interface in emacs for something other than the filesystem?

The ROOT data analysis framework commonly used in high energy physics uses a binary file format that has internal structure like a real filesystem (i.e. folder & files). The ls() method output from the program look something like this: KEY: TH1D name1 KEY: TH1D name2 KEY: TH2D name3 .... Where "TH1D" and "TH2D" etc. ...