MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / RandDirection

Method RandDirection

PanzerChasm/rand.cpp:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61m_Vec3 LongRand::RandDirection()
62{
63 m_Vec3 result;
64
65 while(1)
66 {
67 result= RandPointInSphere( 1.0f );
68 const float result_square_length= result.SquareLength();
69 if( result_square_length == 0.0f )
70 continue;
71
72 result/= std::sqrt( result_square_length );
73 break;
74 }
75
76 return result;
77}
78
79bool LongRand::RandBool()
80{

Callers 1

ProcessMessageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected