man,i wanna this work without Physics engine

Posted By: Omicron_NEGA

man,i wanna this work without Physics engine - 08/21/08 14:46

hi,guys!
im new here,and here is my question:
when im Climbing a slope,it will be like this:

and i cant use phy engine,or i'll write another script.
thx
Posted By: Anonymous

Re: man,i wanna this work without Physics engine - 08/21/08 14:47

look up "normal" under the manual
Posted By: Omicron_NEGA

Re: man,i wanna this work without Physics engine - 08/21/08 14:49


copy that...
thx
Posted By: Omicron_NEGA

Re: man,i wanna this work without Physics engine - 08/21/08 15:03

...
more detail please?
still not working..
thx!
Posted By: Dark_samurai

Re: man,i wanna this work without Physics engine - 08/21/08 15:55

I guess you are tracing to the ground, so that the entity is placed on the ground (gravity)?
Than you can also change the tilt of the model so that it has the same tilt like the normal of the ground it is standing on.

Dark_Samurai
Posted By: Omicron_NEGA

Re: man,i wanna this work without Physics engine - 08/21/08 16:24

i know i am a hopeless fool..
more help plz~
btw,im using c_trace to judge if it is contacting the floor,
that used for jumping function.

I use c_move 4 gravity.


**and give me a sample code if it possible,thx!!!*
Posted By: TigerTao

Re: man,i wanna this work without Physics engine - 08/21/08 17:36

Some old code I picked up somewhere, works a treat though.

Place this after when tracing to the ground so you get the returned normal of the surface. No need to use temp you can use another defined vector.

Code:

c_trace(tracing to ground...);

temp.tilt = 0;
temp.roll = 0;
temp.pan = -my.pan;
vec_rotate(normal, temp);
temp.tilt = -asin(normal.x);
my.tilt += 0.1 * ang(temp.tilt - my.tilt); 
// play with 0.1 for speed of tilting
my.roll = 0;



Hope this helped.
Posted By: Omicron_NEGA

Re: man,i wanna this work without Physics engine - 08/21/08 17:45

THAT WORKS!!
I LOVE U MAN!

thaaaaaaaaaaaaaaaaaanksss!
Posted By: TigerTao

Re: man,i wanna this work without Physics engine - 08/21/08 17:56

Awesomeness!
© 2024 lite-C Forums