Visibility testing between players
by Lally Singh · in Technical Issues · 02/17/2008 (1:24 pm) · 2 replies
Hi, I'm having trouble getting a negative on a visibility test between players.
The idea is that I pass the coordinates of the other player here, and
function FS_mku_point_visible (%dest) {
%pos = FS_ku_get_eyept ();
%mask = $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType;
return getWordCount (containerRayCast(%pos, %dest, %mask)) == 0;
}
(where FS_ku_get_eyept() is:
function FS_ku_get_eyept () {
%connection = GameConnection::getServerConnection();
%player = %connection.getControlObject();
return %player.getEyePoint();
}
)
I seem to keep getting the same values back everytime, no matter how visible the destination point is. How can I do a proper visibility check?
Thanks in advance!
The idea is that I pass the coordinates of the other player here, and
function FS_mku_point_visible (%dest) {
%pos = FS_ku_get_eyept ();
%mask = $TypeMasks::InteriorObjectType | $TypeMasks::TerrainObjectType;
return getWordCount (containerRayCast(%pos, %dest, %mask)) == 0;
}
(where FS_ku_get_eyept() is:
function FS_ku_get_eyept () {
%connection = GameConnection::getServerConnection();
%player = %connection.getControlObject();
return %player.getEyePoint();
}
)
I seem to keep getting the same values back everytime, no matter how visible the destination point is. How can I do a proper visibility check?
Thanks in advance!
About the author
Associate Orion Elenzil
Real Life Plus
and it looks to me like you're doing the raycast on the client side.
i would recommend modifying containerRayCast to take an additional boolean specifying whether it should use gServerContainer or gClientContainer. if you like i can post a modified version of the consoleFunction which does that, but it's very easy to do yourself.
edit:wrong "you're".