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.

Author
Message
GALACTUS
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location:
Posted: 31st Jul 2007 09:05
I was just wondering regarding applying velocity to objects in DPhysics. I noticed there's a limit to how fast you can move an object into anything before it just moves through it. Is there a way to force it to collide with any object no matter what speed you give it?

Thanks...


?..?..?..?
Hoozer
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bremerhaven (Germany)
Posted: 31st Jul 2007 19:46 Edited at: 31st Jul 2007 19:46
@ GALACTUS: There is somekind of CCD (Continious-Collision-Detection) for objects, but only for boxes as far as I know!

In my game I solved it with somekind of "selfmade-fake-ccd":
I checked if the object passed though an other one (my arena), if so I put it back to the previous saved last position and added a value so it's just intersecting the other object (arena/walls), I also set the last known speed and its direction to the object then DP recognizes the collision. I must say for my simple game this was usefull, but for more complecated scenes it is not usefull, but maybe you have more practicable ideas or you can use my thoughts as an inspiration!
An other way might be to make objects bigger (use an other scale for objects), cause then the (fast trevelling) object is still within the other object and not completely through, so DP maybe recognizes the collision correctly! (Just a thought, no idea what the results may be!)

Good luck

Hoozer

AMD64X24800+(939);2GB;GF6800LE (@12PS, 6VS; 380 MHz, RAM: 434 MHz)
DP-Sw-Mode-Comp-Entry (updated to V. 1.4):
http://forum.thegamecreators.com/?m=forum_view&t=109846&b=5&p=0
GALACTUS
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location:
Posted: 31st Jul 2007 22:52
Hoozer, I would be interested in seeing that code you came up with in the self made CCD. Would you be able to post that? I would appreciate it.

Thanks...


?..?..?..?
Hoozer
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bremerhaven (Germany)
Posted: 1st Aug 2007 00:27 Edited at: 1st Aug 2007 00:40
@ GALACTUS: Well, my game is far too big to post it here and it's a big mess of comments etc. (I'm always happy when I understand what I did once upon a time), so I just took the "Selfmade-CCD-Code" for my "bar", cause it's the smallest piece (and maybe understandable):

Sorry, if this is messed up with german words, but I use them a lot when I program!
What the code does:
I have a hidden box called "balkenTunnelingSensor" (=barTunnelingSensor) and it's placed behind the bar (towards the user) in my game. Cause my bar is very tall and the ball gets very fast sometimes, this collision-sensor detects, if the ball is behind the bar (this normaly only happens when the ball was too fast and run through the bar without causeing a DP-collision). So when the ball is behind the bar it saves the old x-y-positions of the ball and rests the ball to a z-value calculated that lies before the bar and is just touching /intersecting it a bit, so DP knows that it's a collision and the ball bounces off (as if nothing happend)! (Note: In this example I deactivated the applying of the force that was saved before the ball was reset! It was causing problems (or what ever was the reason I deactivated it), but I used it with my arena-walls!)
I also added the "ball-reset-function", so you know what I mean with "reset"!
As you see, I also had the DP-CCD-commands within my code, but they did not work for me! If you look into the documentation/help that comes with DP, there is a nice pic that shows how the CCD should work and that was the place where I got my idea for my own "simple-fake-CCD"!

This method is usefull for very simple things, BUT not for complex objects!

If you don't know what I was talking about when I said "my game/ball/bar" then have a look at the link in my sig!


Maybe that helps you (I hope so), maybe not (if so, I'm sorry)!

Hoozer

AMD64X24800+(939);2GB;GF6800LE (@12PS, 6VS; 380 MHz, RAM: 434 MHz)
DP-Sw-Mode-Comp-Entry (updated to V. 1.4):
http://forum.thegamecreators.com/?m=forum_view&t=109846&b=5&p=0
GALACTUS
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location:
Posted: 1st Aug 2007 02:57
Thanks Hoozer, I'll check that out. I was wondering if that was going to get fixed in the 1.02 update perhaps?

?..?..?..?

Login to post a reply

Server time is: 2024-05-03 20:14:52
Your offset time is: 2024-05-03 20:14:52