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...
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...
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...
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 ...
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.
...
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
...
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...
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...
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...
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...
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;
...
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...
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 ...
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-...
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...
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...
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...
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...
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...
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. ...