Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Bumping Your Head Physics [Re: Valdsator] #384308
10/01/11 21:42
10/01/11 21:42
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
c_trace(my.x,vector(my.x,my.y,my.z-200),IGNORE_ME | IGNORE_PASSABLE);
if(trace_hit && target.z > my.z+my.min_z-10)
{
I'm on the ground, respectively floating 10 quants or less above the ground. Some kind of a height buffer is usually a good idea to avoid the computation of unnecessary collisions.
my.speed_z = 0;
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Bumping Your Head Physics [Re: Superku] #384317
10/01/11 22:31
10/01/11 22:31
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
Originally Posted By: Superku
c_trace(my.x,vector(my.x,my.y,my.z-200),IGNORE_ME | IGNORE_PASSABLE);
if(trace_hit && target.z > my.z+my.min_z-10)
{
I'm on the ground, respectively floating 10 quants or less above the ground. Some kind of a height buffer is usually a good idea to avoid the computation of unnecessary collisions.
my.speed_z = 0;
}

Ah, I was thinking I should use c_trace, but was once again scared away by the "slow" speed. Thank you, yet again!

Re: Bumping Your Head Physics [Re: Valdsator] #384325
10/01/11 23:22
10/01/11 23:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
c_move is based on c_trace with USE_BOX, thus c_trace without USE_BOX is faster than a c_move call.
c_trace is probably the most important Gamestudio function for all games, don't be afraid to use it. That means, use it whenever necessary and avoid it whenever possible. There are a lot of options to keep c_trace fast (use the IGNORE_... commands, keep the trace short, only use USE_BOX when necessary and so on).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Page 2 of 2 1 2

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1