MCPcopy Create free account
hub / github.com/ProjectPhysX/FluidX3D / pipe

Function pipe

src/shapes.cpp:36–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 return dist<=sq(r) && sqnt<=sq(0.5f*l);
35}
36bool pipe(const uint x, const uint y, const uint z, const float3& p, const float3& n, const float r) {
37 const float3 t = float3(x, y, z)-p;
38 const float sqnt = sq(dot(normalize(n), t));
39 const float dist = sq(t.x)+sq(t.y)+sq(t.z)-sqnt;
40 return dist>=sq(r-d)&&dist<=sq(r+d) && sqnt<=sq(0.5f*length(n));
41}
42bool conepipe(const uint x, const uint y, const uint z, const float3& p, const float3& n, const float r1, const float r2) {
43 const float3 t = float3(x, y, z)-p;
44 const float nt = dot(normalize(n), t);

Callers

nothing calls this directly

Calls 5

float3Class · 0.85
sqFunction · 0.85
dotFunction · 0.85
normalizeFunction · 0.85
lengthFunction · 0.85

Tested by

no test coverage detected