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.

Dark Physics & Dark A.I. & Dark Dynamix / continues bouncing ball

Author
Message
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 28th Jan 2012 11:13 Edited at: 28th Jan 2012 12:32
Been trying to bounce a ball around with infinite energy, i want to do an arkenoid type game using physx but cant seem to do it, also for it to bounce off a bat that is a directx model shaped like a capsule, evertime i give the bat some rigid body it has odd results depending what rigid body i choose! anyone got a simple example?
here is the code I have so far:


I have included the files in zip format

Hail to the king, baby!

Attachments

Login to view attachments
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Jan 2012 15:43
makes it bounce now your off, but I expect you back very soon.




Dark Physics makes any hot drink go cold.
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 28th Jan 2012 17:44 Edited at: 28th Jan 2012 17:49
yeh thanks for the help.it just bounces once though doesnt it, and not quite on the surface! also where did the bat.b file come from?!!

Hail to the king, baby!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Jan 2012 18:02
the bat.b file is what is used to make the PHY RIGID BODY DYNAMIC MESH , it should have been PHY MAKE RIGID BODY DYNAMIC MESH player_bat,"bat.b",1, but this never got fixed in the early days and it was found to work back to front eg load it to make it.

try adding PHY ADD RIGID BODY FORCE to the y direction this will make sphere travel downwards faster so should bounce off then bat harder, plus remember this real world stuff so if you drop a ball on to a plank it would not always bounce off the same way.

Dark Physics makes any hot drink go cold.
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 28th Jan 2012 18:06 Edited at: 28th Jan 2012 18:06
but where does it get made! also i noticed when the ball hits the bat it obviously effects the z direction and the ball plops out of the screem..kinda..hehe! i was thinking of making anothe big 3d box to sandwich all the objects in,unless theres an easier way

Hail to the king, baby!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 28th Jan 2012 18:36
the file get made each time you run the code and you'll find a bat.b file in your project folder.

I would make two boxes to go in the front and back and then make them transparent.

Dark Physics makes any hot drink go cold.
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 28th Jan 2012 20:30
yeh,there is already a box at the back..lol.. but same idea as i had

Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 28th Jan 2012 23:25
ok sorry to bother again but i tried adding this command and it doesnt work,in the function:



tried changing the params to allsorts but doesnt effect it one little bit! or do i do this in a loop?

Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 28th Jan 2012 23:38
ah yes, i tried it in the main loop, it fell faster,but sure as hell didnt bounce more

Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 29th Jan 2012 00:13 Edited at: 29th Jan 2012 00:15
got this so far:



not quite,i have put a 'lid on it' also
p.s I just bothered to notice my bat doesnt move anymore

Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 29th Jan 2012 12:05 Edited at: 29th Jan 2012 12:11
i have it bouncing,i think I had to do manual collision checks, but it seems to have made the movements abit sluggish, like the fps drops! maybe i am doing something wrong ? here is the code so far, least it bounces!



Hail to the king, baby!
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 29th Jan 2012 12:43
I might have a plan, dunno if this will work, but what if i make the boxes material that hold all the other objects in, have less friction ?! is this possible? then i dont need to apply as much force
to the balls Y axis ?! just a thought... then it will be less jerky movement

Hail to the king, baby!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 29th Jan 2012 16:15 Edited at: 29th Jan 2012 16:15
here it is with a bit added to start the ball going down faster and when it hits a wall to randomly off in .a direction and a bit to make the bat move.




Dark Physics makes any hot drink go cold.
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 30th Jan 2012 11:48 Edited at: 30th Jan 2012 13:49
thanks for the help so far,yeh it kinda works, fails to bounce off the edges of the bat though,also i mean it isnt fast enough and if it is speeded up changing the y force it becomes jerky doesnt it ?! cant mess about with mass or materials much more neither to make things better, also i am getting lost with this code coz like a fool i didnt use vars all the time out of lazyness..i will take care of this first!

Hail to the king, baby!

Login to post a reply

Server time is: 2024-11-24 13:44:07
Your offset time is: 2024-11-24 13:44:07