Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] terrain problems with physics

Author
Message
shadey
9
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 26th Mar 2019 18:11 Edited at: 26th Mar 2019 19:14
I am having problems getting perfect physics for a golf game I am doing, I can set every aspect of physics on any object within the editor for it.

So in the video below I have a terrain done in blender, started out as plane which was then sbdivided and sculpted,then finally adding a solidify modifier...
loaded into the editor this terrain is set with a physics shape of a static polygon. the friction is set to 0.8, restitution to 1.0 and damping to 0.001


The ball is a sphere,atm it is oversized for golf ball! its physics shape is obviously set to sphere! friction is set to 0.9,restitution 0.6,damping 0.0, and i set a mass for it of 40 coz the sphere made was 40 in diameter(dunno if this is correct!!).
Finally the gravity in the video is set to -11.


It feels like the gravity should be higher,as in -15 ,but if i do then problems occur of the ball getting stuck with the bottom and top layers of the terrain!
Also I have to set so mch velocity for the ball that it looks like it teleports at the beginning,too fast!
And also the ball will not roll but rather slide along..



Perhaps I have a lot of values set wrong
I know I have been swapping values about forever,I have at least 4 to play with!!
Been fighting to keep the realtime shadows in with a good framerate as I only have this cheap linx windoze tablet to develop on!
Hail to the king, baby!

The author of this post has marked a post as an answer.

Go to answer

shadey
9
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 26th Mar 2019 21:41
Hmm,after messing values with Create3DphysicsWorld,it imrpoves the feel of it,but still at times the ball gets stuck within the terrain,perhaps instead of adding a solidify modifier to the sclpted plane I should extrude it down on the z axis in blender?? getting more faces for the physics to read into... this however will cost in speed!
Hail to the king, baby!
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 26th Mar 2019 21:53
Quote: "Hmm,after messing values with Create3DphysicsWorld,it improves the feel of it"

If you mean the scale factor yes that can make allot of difference to how the 3D behaves

how are you creating the terrain?
could that be an issue ?
perhaps some normal not right or the faces etc?

If your using AGK's heightmap creations then that may not be an issue depending on what texture
your using to create it perhaps the height settings could be lessened not sure I ?Think would need
some code etc

but looks good might be the only golf I can play lol never could get hang of golf in real life and the fact
I played hockey sure never helped
fubar
shadey
9
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 26th Mar 2019 22:16 Edited at: 26th Mar 2019 22:21
perhaps it is the model.will test with less complicated planes! Using a subdivided plane created in blender for the terrain...

I could use blenders landscape generator addon but that creates waaaay too many polys and i end up decimating it anyhow!

This is a damn struggle keeping the speed also, I wanna keep the realtime shadows for sure,adds needed depth
Hoping this new AppGameKit studio will make life easier in that sense! Especially in the shaders department as water wold be awesome!!
Hail to the king, baby!
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 26th Mar 2019 22:42
There was some issue with using plane objects turned into height objects with blender
Not sure what the fix was. Did you convert plane to mesh in blender ?

fubar
shadey
9
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 27th Mar 2019 01:50 Edited at: 27th Mar 2019 02:00
This post has been marked by the post author as the answer.
ok I decided to start the terrain off in blender as a cube!, then i subdivided just the top face of the cube several times for the top terrain to be sculpted out of it, this left me a nice clean single faced bottom to pull down slightly away from the top terrain, like so...

so far it works well and can now have greater gravity without the ball falling through!!
Hail to the king, baby!

Login to post a reply

Server time is: 2019-04-25 13:50:30
Your offset time is: 2019-04-25 13:50:30