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 / Manual Gravity and RayCasting problems

Author
Message
cyangamer
15
Years of Service
User Offline
Joined: 2nd Jun 2008
Location: Houston, TX, USA
Posted: 25th Dec 2008 15:56 Edited at: 2nd Jan 2009 05:48
Hiya, I have a new problem trying to implement realistic gravity for my player. Can someone show me how one would make a character fall faster using Dark Physics? My player is falling too slowly right now and none of the commands have any effect on the speed that the character falls (even though I think they should).

I'm using a Character Controller, by the way.

Merry Christmas!

Currently working on - Enemy AI and Action Battle System

the sig limit needs to be raised...
cyangamer
15
Years of Service
User Offline
Joined: 2nd Jun 2008
Location: Houston, TX, USA
Posted: 31st Dec 2008 06:44
Hello? Is there anyone who wants to point me in the right direction in solving this problem. I worked with it some more but with no avail. I can't figure out why it's doing what it's doing!

Currently working on - Enemy AI and Action Battle System

the sig limit needs to be raised...
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 31st Dec 2008 08:56
It sounds like you have the right idea. You pick a point, usually where the object is, and you cast a ray from it to a new point. If the ray intersects a polygon of whatever object your casting against, the function will return a distance value. With that distance value, you use it to calculate where the collision occurs, and with a little math you can calculate where to put the object, or even how to reflect it.

It would be wise to use and know a little bit about polygon intersection, normals, and vectors.

I'll work on a quick implementation, but I only have DBPro.
cyangamer
15
Years of Service
User Offline
Joined: 2nd Jun 2008
Location: Houston, TX, USA
Posted: 1st Jan 2009 22:50 Edited at: 2nd Jan 2009 05:45
Yeah, but there doesn't seem to be such a command that does what I'm trying to do. Technically, I'm trying to cast a line segment instead of a ray.

Otherwise, the ray will just pass through the character and the ground, so it'll seem like the character is constantly on the ground whether he is or not.

Does that make sense?

EDIT: I think I figured it out, but I still don't know how to make my character fall at an acceptable speed. Right now it just floats to the ground and none of the gravity commands I use affects it.

Currently working on - Enemy AI and Action Battle System

the sig limit needs to be raised...
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Jan 2009 15:40
see if you can add a force to the character that might make it move quicker.

Dark Physics makes any hot drink go cold.
cyangamer
15
Years of Service
User Offline
Joined: 2nd Jun 2008
Location: Houston, TX, USA
Posted: 3rd Jan 2009 01:23
none of the forces seem to have any effect. I've tried PHY ADD RIGID BODY LOCAL TORQUE, PHY ADD RIGID BODY FORCE, PHY ADD RIGID BODY LOCAL FORCE, and PHY ADD RIGID BODY TORQUE, with the Y-force at -10000. Nothing affects the speed of the fall. =/

Currently working on - Enemy AI and Action Battle System

the sig limit needs to be raised...
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2009 01:28
Try making another "body" and making it fall the speed you want - and use that to force your character controller (by positioning char controller...) to where the body is when its falling... So if char controller not on ground - then apply forces on char controller to this "other body" and then let the other body run things until the char controller is on the gorund again.

I only recommend such a "odd" method becauzse I heard the char controller of darkphysics just behaves different than the rest of the physics.. kinda substantiated by what your issue stated here is

--Jason

cyangamer
15
Years of Service
User Offline
Joined: 2nd Jun 2008
Location: Houston, TX, USA
Posted: 3rd Jan 2009 02:18 Edited at: 3rd Jan 2009 02:32
Do I use POSITION OBJECT to reposition the char controller?

Currently working on - Enemy AI and Action Battle System

the sig limit needs to be raised...
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2009 02:26
I don't know the answer to that - but it wouldn't be a native GDK command, it'd be one of the ones in the DarkPhysics.h file.

(Of course help might be easier to find the command with accompianing text)

--Jason

cyangamer
15
Years of Service
User Offline
Joined: 2nd Jun 2008
Location: Houston, TX, USA
Posted: 3rd Jan 2009 02:33
Okay, I solved the gravity problem. When I repositioned the char controller, I took away this command:
believing it to be useless (I had added it before to fix the gravity problem). It turns out just taking out that line makes the gravity act as it should.

Well, thanks for the help!

Currently working on - Enemy AI and Action Battle System

the sig limit needs to be raised...
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2009 02:58
Glad you figured that out - as I thought my solution was kinda a hokey work around...

Now if I could get my DarkPhysics to LINK I'd be a happy camper!!!!!

Login to post a reply

Server time is: 2024-05-22 05:26:24
Your offset time is: 2024-05-22 05:26:24