MCPcopy Create free account
hub / github.com/assaultcube/AC / raycubelos

Function raycubelos

source/src/physics.cpp:63–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63bool raycubelos(const vec &from, const vec &to, float margin)
64{
65 vec dir(to);
66 dir.sub(from);
67 float limit = dir.magnitude();
68 dir.mul(1.0f/limit);
69 vec surface;
70 float dist = raycube(from, dir, surface);
71 return dist > max(limit - margin, 0.0f);
72}
73
74physent *hitplayer = NULL;
75

Callers 1

rendermodelFunction · 0.85

Calls 4

raycubeFunction · 0.85
maxFunction · 0.85
magnitudeMethod · 0.80
mulMethod · 0.80

Tested by

no test coverage detected