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 / getting the radius of an object

Author
Message
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 16th Feb 2019 08:50
what maths do I need to do to get a radius of a given 3D objects size,so I can use that in the last param of objectspherecast?!
Hail to the king, baby!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Feb 2019 09:15
If you already know the axis you can use getobjectminx/y/z and getobjectmaxx/y/z to find the extremities of the object
shadey
14
Years of Service
User Offline
Joined: 25th Jan 2010
Location:
Posted: 16th Feb 2019 09:31 Edited at: 16th Feb 2019 09:45
yeh I use these to/ move the 3D cursor around so it can snap together,but how do i get the radius value with these?

I wanna place objects and have that value stored rather than just using a fixed value

the way i do now is:



calling the function like so:
casterplayer(player[playerpointer].id,oldx#,oldy#,oldz#,30,0)


the 30 value is the radius,the 0 value after that is the mode as the function has a couple,mode 0 for sphere cast, and mode 1 for raycast,mode 1 obviously doesnt need a radius!but in mode 0 of course this fixed value is no good as i want it to be worked out based on the objects size, which could be anything!
Hail to the king, baby!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Feb 2019 09:56 Edited at: 16th Feb 2019 09:57
If your object is a circular shape then getobjectmaxx() - getobjecminx() will give you the radius

Login to post a reply

Server time is: 2024-11-05 22:57:53
Your offset time is: 2024-11-05 22:57:53