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 Studio Chat / Can one object see another object?

Author
Message
ando
4
Years of Service
User Offline
Joined: 21st Feb 2020
Location: Australia
Posted: 31st Dec 2021 20:25 Edited at: 1st Jan 2022 06:31
EDIT: please ignore this one, I had a brain fade moment.

A couple of months ago I started work (or play) on an AI system.

Is there a command to tell if an object is in view of another object?

If not, I had an idea.
Firing a bunch of rays in front of the looking object might be a bit hit and miss.
So I was thinking I could transfer the camera to the object and match it's rotation. Then use GetObjectInScreen( objID ) and if the second object is in view then fire a ray at it to see if it's hidden behind something.

I can then transfer the cam back to the player so it would look like it never happened.

EDIT: I guess the normal way (which I only just thought of) is to fire a ray from an object to every other object then calculate some angles to work out if something is in view and in front of the first object.
See? Noobish every day.
BASIC appeared in May 1964. Lightning flashed, the wind roared and the Earth moved.
And nine months later I was born.
So here I am.
I am Basic.
Code is in my genes.

Login to post a reply

Server time is: 2024-03-28 15:19:54
Your offset time is: 2024-03-28 15:19:54