|
3 registered members (Dico, AndrewAMD, TipmyPip),
16,874
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
point towards
#266201
05/16/09 16:22
05/16/09 16:22
|
Joined: Apr 2009
Posts: 141
dakilla
OP
Member
|
OP
Member
Joined: Apr 2009
Posts: 141
|
is there a way to make one entity pan towards another entity?
One day there will be an unfixable bug, That day is not today.
|
|
|
Re: point towards
[Re: dakilla]
#266204
05/16/09 16:53
05/16/09 16:53
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
yes,find direction vector from target entity to looking entity (vec_sub their positions)
then use vec_to_angle to convert that vector to angle. use the pan of resulting angle.
3333333333
|
|
|
Re: point towards
[Re: dakilla]
#266217
05/16/09 18:56
05/16/09 18:56
|
Joined: May 2008
Posts: 331 Lithuania, Vilnius
Jaxas
Senior Member
|
Senior Member
Joined: May 2008
Posts: 331
Lithuania, Vilnius
|
function turn_towards_target()
{
// get the direction from the entity MY to the entity YOU
vec_set(temp,your.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp); // now MY looks at YOU
}
from manual..again..
The smaller the bug, the harder it is to kill. _________________________________________ Forklift DEMO (3dgs)
|
|
|
Re: point towards
[Re: dakilla]
#266317
05/17/09 13:21
05/17/09 13:21
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
Senior Member
|
Senior Member
Joined: Mar 2006
Posts: 321
Norway
|
Go and download and read AUM 72, in the unanswered question the last one, is a great code that works as you whant.
A6 and A7 Commercial ------------------- Programmer always searching for more to learn and understand.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|
|
|