MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / randomAxis

Function randomAxis

Extras/InverseDynamics/IDRandomUtil.cpp:61–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61vec3 randomAxis()
62{
63 vec3 axis;
64 idScalar length;
65 do
66 {
67 axis(0) = randomFloat(-1.0, 1.0);
68 axis(1) = randomFloat(-1.0, 1.0);
69 axis(2) = randomFloat(-1.0, 1.0);
70
71 length = BT_ID_SQRT(BT_ID_POW(axis(0), 2) + BT_ID_POW(axis(1), 2) + BT_ID_POW(axis(2), 2));
72 } while (length < 0.01);
73
74 return axis / length;
75}
76} // namespace btInverseDynamics

Callers 1

getBodyMethod · 0.85

Calls 1

randomFloatFunction · 0.85

Tested by

no test coverage detected