Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / the equivalent of setobjectlookat for dynamic objects

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 25th Apr 2021 12:55 Edited at: 25th Apr 2021 14:27
how would i get a dynamic object to set its angular velocity toward a direction vector (equivale of lookat)

I have code that kinda works but i think the actualy velocity the last parameter of setobjectphysicsangularvelocity needs to be a dot product or something im not sure ?
hence why i ask cos it doesnt behave correctly


Its part of the new ai development that will be used for the ai of cars using a path to follow

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Apr 2021 14:51
I don't know if I understand correctly what you want to do....the path to follow is a serie of way points?
I'm not a grumpy grandpa
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 25th Apr 2021 14:54
yes the lpath is an array of way points the ai cars i want to follow them

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Apr 2021 14:58
Ok...so I suppose you want to position you car every waypoint and make it point smoothly to next one right?
I'm not a grumpy grandpa
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 25th Apr 2021 15:06 Edited at: 25th Apr 2021 15:08
yes thats right
It may be a problem with the checkpoints yet but that doesnt seem to be the problem to me

lines 1338 to 1355 in game.agc displayes them as boxes if uncommented

I just think there needs to be nother calculation there in the code snippet above just not sure

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Apr 2021 15:12
Ok ...I will have a look at it....bear with me !
I'm not a grumpy grandpa
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Apr 2021 18:37
@fubarpk I've been looking at your code and comparing it to your old program Crazy Grand Prix . This is like looking for a needle in a haystack. . I've seen your moveVehicle funtion in old CrazyGP it works ok ....I can't find where could be the difference . What method did you use in old Ctrazy Grand Prix to make cars follow correctly the path ? did you use arraypath aswell ?
I'm not a grumpy grandpa
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 25th Apr 2021 22:13 Edited at: 26th Apr 2021 09:04
The method was just raycasting ahead if the cars too far to left turn right etc (in movevehicle.agc aimove function)

i think it work best for tracks that started turning left


i think it has to gradually point that way but im not sure if i need to calculate the dot product

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk

Login to post a reply

Server time is: 2024-11-24 04:14:51
Your offset time is: 2024-11-24 04:14:51