|
|
Re: Gravity on Slopes
[Re: 82RJZAE]
#338715
08/20/10 20:47
08/20/10 20:47
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
Serious User
|
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
Use c_trace and then the normal extension. It gives you the angle of the traced block
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Gravity on Slopes
[Re: Liamissimo]
#338718
08/20/10 21:27
08/20/10 21:27
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
As BARE-BONES code
c_trace(from, to, USE_POLYGON);
if(trace_hit) { angle = acos(hit.nz); }
where 'angle = 0' is flat ground, and 'angle = 90' is vertical wall. Hope this helps.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Gravity on Slopes
[Re: 82RJZAE]
#338720
08/20/10 22:01
08/20/10 22:01
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
Serious User
|
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
Thanks 3run, I found some of your code useful; however, I did not find any code related to gravity on slopes. I want to be able to make the player slide on steep slopes but I am unsure how I can detect the slope angle in order to determine the z speed to move the player down with. Any suggestions please? with the code from 3run you can slide through slopes without any other change on vertical speed, test it and you'll see. Also in the projects forum I've in the sci-fi shooter posted a demo for movement including also jumping and a test level so you can see it yourself.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: Gravity on Slopes
[Re: 82RJZAE]
#339702
08/28/10 18:58
08/28/10 18:58
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
Serious User
|
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
we don't apply it because it isn't neccesary. but you can make a c_tace on front of the player to the ground and if the heught is bigger than the height of the gravity's c_trace, the you move up the enitity.
Last edited by painkiller; 08/28/10 18:58.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: Gravity on Slopes
[Re: painkiller]
#339706
08/28/10 19:13
08/28/10 19:13
|
Joined: Jul 2008
Posts: 168
82RJZAE
OP
Member
|
OP
Member
Joined: Jul 2008
Posts: 168
|
we don't apply it because it isn't neccesary. 3run's movement code allows the player to run even up the steepest slopes. Wouldn't it be necessary to prevent that? but you can make a c_tace on front of the player to the ground and if the heught is bigger than the height of the gravity's c_trace, the you move up the enitity. The player is not necessarily moving forward up slopes. He might be moving backwards or even strafing left or right.
|
|
|
|