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 / [Dark Physics] Having too much fun here... player collisions!

Author
Message
imekon
18
Years of Service
User Offline
Joined: 3rd Jul 2006
Location:
Posted: 3rd Aug 2006 01:48
Here's a code snippet for player collision causing boxes to fly around...



It's not perfect (ahem), and I don't know what the correct commands are for getting the normal force... but it's amusing making the boxes fly around the room like balloons! I really ought to set their mass to something more suitable... the sound effects should only fire when the force is above a threshold, otherwise they fire all the time.

Still, it's a first step.

Pete Goodwin

Attachments

Login to view attachments
Xarshi
18
Years of Service
User Offline
Joined: 25th Dec 2005
Location: Ohio
Posted: 3rd Aug 2006 09:59
I didn't know you could get collisions from the player body to objects Whenever I tried something like phy set rigid body mass,it would say the body did not exist. Or is it just with collision stuff?

Woohoo. DP is finally released!
imekon
18
Years of Service
User Offline
Joined: 3rd Jul 2006
Location:
Posted: 3rd Aug 2006 10:01
The player object is ID 10, the crates are 1300, 1301, 1302. Collision works with anything in the physics world, it would seem.

Pete Goodwin
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 3rd Aug 2006 10:07
Upon contact, you have to apply your own force. That gives you a fair amount of control, so it's not a bad thing.

So many possibilities...


Come see the WIP!
Bmad6
19
Years of Service
User Offline
Joined: 25th Aug 2005
Location: Virginia, United States
Posted: 6th Aug 2006 04:42
Quote: "Upon contact, you have to apply your own force."


You mean, dark physics doesn't make objects bounce off each other automatically?

Programming is the art that fights back.
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 6th Aug 2006 08:42 Edited at: 6th Aug 2006 08:42
No, everything works correctly in that regard. It's just that the character controller doesn't apply a force upon contact with another physics body. TGC will correct that soon, I believe.


Come see the WIP!
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 6th Aug 2006 11:10 Edited at: 6th Aug 2006 11:11
Quote: "It's just that the character controller doesn't apply a force upon contact with another physics body"


Only if the body is stationary. If the rigid body is already in motion, the character controller appears to apply a velocity to the object equal to its own (or there abouts). So character controllers apply no force when an object is stationary, but when it's moving they can apply infinite force. Definitely needs some consideration.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Aug 2006 14:51 Edited at: 6th Aug 2006 14:53
Perhaps just detecting a collision manually then changing the collided object's properties - not sure how this would work in DP, but I think it would keep DP's workload down. That way most objects could start off stationary, and heavy objects might need an explosion to knock them loose. So rather than using the standard explosion route, you might do your own range check and change the properties of objects that should be moving with that force applied. Things like kitched cabinets mounted onto walls could become loose objects, as they would need to be static anyway, otherwise they'd just fall down.

A good use for this would be a door, like have it as a static then when you open it or unlock it change it to a movable hinge, then you could just run through. I think it'd be pretty cool to just open a door a little, peek inside, then spray the room and open the door at the same time with a machine gun . Also, barricaded doors could be blown open and whatever is blocking them blown back with the force of the door (enemies included hopefully).

Aegrescit medendo

Login to post a reply

Server time is: 2024-11-24 12:46:51
Your offset time is: 2024-11-24 12:46:51