MCPcopy Create free account
hub / github.com/demoth/jake2 / visible

Method visible

game/src/main/java/jake2/game/GameUtil.java:245–263  ·  view source on GitHub ↗

Returns 1 if the entity is visible to self, even if not infront().

(SubgameEntity self, SubgameEntity other, GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

243 * Returns 1 if the entity is visible to self, even if not infront().
244 */
245 public static boolean visible(SubgameEntity self, SubgameEntity other, GameExportsImpl gameExports) {
246 if (other == null)
247 return false;
248
249 float[] spot1 = { 0, 0, 0 };
250 float[] spot2 = { 0, 0, 0 };
251 trace_t trace;
252
253 Math3D.VectorCopy(self.s.origin, spot1);
254 spot1[2] += self.viewheight;
255 Math3D.VectorCopy(other.s.origin, spot2);
256 spot2[2] += other.viewheight;
257 trace = gameExports.gameImports.trace(spot1, Globals.vec3_origin,
258 Globals.vec3_origin, spot2, self, Defines.MASK_OPAQUE);
259
260 if (trace.fraction == 1.0)
261 return true;
262 return false;
263 }
264
265 /**
266 * Finds a target.

Callers 14

ai_checkattackMethod · 0.95
PickFirstMethod · 0.95
thinkMethod · 0.95
M_ReactToDamageMethod · 0.95
FindTargetMethod · 0.95
thinkMethod · 0.95
thinkMethod · 0.95
medic_FindDeadMonsterMethod · 0.95
thinkMethod · 0.95
thinkMethod · 0.95
thinkMethod · 0.95

Calls 2

VectorCopyMethod · 0.95
traceMethod · 0.65

Tested by

no test coverage detected