Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_trace question #252971
02/21/09 21:21
02/21/09 21:21
Joined: May 2008
Posts: 10
UK
C
cjm Offline OP
Newbie
cjm  Offline OP
Newbie
C

Joined: May 2008
Posts: 10
UK
I was using c_trace to enable walking on a floor and stair climbing, the code needed is around in a number of tutorials. Code of the form:

Quote:
vec_set (temp.x, my.x);
temp.z -= 10000;
temp.z -= 10000;temp.z = -c_trace (my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX);

However this made 'cbabe' walk with her feet and ankles in the floor!

The fix was an offset to allow for this, thanks George:

Quote:
temp.z = -c_trace (my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX) + 20; // play with 20

My question is why is this offset "now" necessary when old(ish)code doen't appear to need it/show it?

Why doesn't c_trace return the correct distance?

(My code is running on A7.70 Commercial)

Re: c_trace question [Re: cjm] #254157
03/01/09 13:54
03/01/09 13:54
Joined: Sep 2008
Posts: 76
Max_Prower Offline
Junior Member
Max_Prower  Offline
Junior Member

Joined: Sep 2008
Posts: 76
For moving up stairs and slopes, I would reccomend using move_min_z. I have a question. What exactly does temp mean?

Last edited by Max_Prower; 03/01/09 13:59.
Re: c_trace question [Re: Max_Prower] #254318
03/02/09 15:25
03/02/09 15:25
Joined: May 2008
Posts: 10
UK
C
cjm Offline OP
Newbie
cjm  Offline OP
Newbie
C

Joined: May 2008
Posts: 10
UK
'temp' is a temperary holding vector, it is just used to to hold the vector coordinates of 'my's' vector position 10000 quants down the z axis. Its used as the 'target' position for c_trace as it traces from 'my's' reference center downwards.

Re: c_trace question [Re: cjm] #254319
03/02/09 15:31
03/02/09 15:31
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
c_trace scans from objects origin and in your case origin is probably in center of model(torso) and not feet. i think that's why



Ubi bene, ibi Patria.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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