How can I make an NPC “see” using a 2nd (or non-default) camera.
I don’t want this camera to render to the screen. I only want to use the Spatial.checkCulling method to see if the NPCs camera can see my avatars spatial.
The following is semi-pseudo code hopefully explains what I’m trying to do.
[java]if((Spatial)myAvatar.checkCulling(npcCamera)) {
// true so I know that the NPC is facing me since the npcCamera is facing the same direction
Do a ray from NPC to me
if I’m the closest spatial to the NPC that the ray collides with {
NPC can react to me 'cause it can see me.
me -> RUN AWAY!
}
}[/java]