basic ball physics

Software: Away3D 4.x

random, Newbie
Posted: 21 July 2012 08:21 PM   Total Posts: 10

I’m on my way happily with AwayPhysics now but have a lot of questions.  I have done a lot of reading already and so find myself here again.

Apparently AwayPhysics is based on JigLib/Bullet?  Is there one in particular that I can choose to read the docs for to help me get on my way? 

In short I have the following problem:

I have a ball, it bounces, and I can throw it around in certain directions, but it behaves more like a balloon than e.g.: a pingpong ball, a basketball, etc.  What can I do?

I see restitution, gravity, and friction, but I don’t think these are getting me to where I would like to be.

   

John Brookes, Moderator
Posted: 24 July 2012 04:40 PM   Total Posts: 732   [ # 1 ]

Its based on Bullet.
Google the bullet forum docs etc, they will help with getting answers to some stuff although finding answers is a bit too much fun.

As for the ball, again google bullet and scaling the world, its in the Wiki
Basically
physicsWorld.scale = someNumber;
Defaullt for AWP is 100

Try the examples with different scale values for the world, you will also have to increase/decrease an forces that are applied.

And keep asking questions (helps us all smile)

   

random, Newbie
Posted: 26 July 2012 02:44 PM   Total Posts: 10   [ # 2 ]

Thanks for your response.

physicsWorld.scale = some number failed in compilation.  I looked into:

~/awayphysics/src/awayphysics/dynamics/AWPDynamicsWorld.as

And there doesn’t seem to be any “scale” variable, perhaps it has been removed.

However, I have better results now after toying around some more.  One of my previous problems was setting “timeStep” properly.  I was getting a balloon effect simply because it was too slow.

With a faster timeStep and toying around with restitution and friction a bit I managed to get a really nice lifelike ball effect.

The examples are very helpful, although it took me a while to figure out how to fix them.  It was noted previously in this forum that the physics-examples packages are broken.  Have they been fixed yet?  Anyway, I just figured out that you have to set the geometry and material before the mesh and pass them into Mesh().  Perhaps a previous release didn’t require these for Mesh() and someone forgot to update Git.

 

   

John Brookes, Moderator
Posted: 26 July 2012 03:39 PM   Total Posts: 732   [ # 3 ]

slight brain fart wink
physicsWorld.scaling

And the examples have been updated to work with the gold realease.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X