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.

DarkBASIC Professional Discussion / Normal's w/ Sparky's Collision

Author
Message
Benjames8
16
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 5th Aug 2010 00:01 Edited at: 2nd Oct 2010 22:44
There are slopes in my map that my character can't climb. I spherecast the ground below the players feet and check the normal's returned to see if he is standing on one of these slopes.
If the player is in fact standing on a slope then he is positioned in the last place where he was not.
The problem is when he is at the top of the slope he can't slide down. I need to tell the player when he is at the bottom of a slope or above one. I'm thinking an angle of the ground where there was last no slope VS. the angle of the slope.
Any idea's?

[edit] Im bring up this old topic see my latest reply for the question.
Kira Vakaan
17
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 5th Aug 2010 09:39
You're using Sparky's DLL, so there's no need to simply place the player at the last safe place. That's not very natural.

Try this:
If the player is not on a slope, stick him to the floor, right below him. If the player is on a slope, cause him to slide down the slope, changing all three coordinates of his position. That way, if he's at the top of a slope, he'll slide down it, and when he's at the bottom, he'll always slide back when he tries to climb it.

Madscientist
16
Years of Service
User Offline
Joined: 23rd Aug 2009
Location: Between a rock and a hard place
Posted: 5th Aug 2010 19:10
To check if he's on a slope position an invisible cube on the slope and check collision with that.

My computer can render anything no matter the complexity of it in real time. The memory it has is enormous. My computer is unique to everyone else’s. What computer do I have?

Benjames8
16
Years of Service
User Offline
Joined: 6th Jan 2010
Location: Your Nightmares
Posted: 2nd Oct 2010 22:55
Someone told me of this tecnique of pointing an object to match the suface's angle.

First you get the surfaces normals then us point object like this..
dbPointObject(Obj,normalX+dbObjectPositionX(CHAR),normalY+dbObjectPositionY(CHAR),normalZ+dbObjectPositionZ(CHAR));

After doing this I use dbTurnObjectLeft(4,???); to point the object in the correct direction. The problem is I don't know the correct value to turn it.

Ive tryed stuff like:

1)???=Direction to move

2)???=DirectionToMove-ObjectAngleY(CHAR)

3)???= A variable that I got from taking two sets of position's finding the angle from the players position, then subtracting them. lol

The end result I want is the player moving on the ground object's planes with the correct angles ( for smoothness )

Login to post a reply

Server time is: 2026-07-23 14:22:16
Your offset time is: 2026-07-23 14:22:16