MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / writeNormalVector

Method writeNormalVector

Engine/source/core/stream/bitStream.cpp:411–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409}
410
411void BitStream::writeNormalVector(const Point3F& vec, S32 bitCount)
412{
413 F32 phi = mAtan2(vec.x, vec.y) / M_PI;
414 F32 theta = mAtan2(vec.z, mSqrt(vec.x*vec.x + vec.y*vec.y)) / (M_PI/2.0);
415
416 writeSignedFloat(phi, bitCount+1);
417 writeSignedFloat(theta, bitCount);
418}
419
420void BitStream::readNormalVector(Point3F *vec, S32 bitCount)
421{

Callers 6

packUpdateMethod · 0.80
dumbDownNormalMethod · 0.80
packUpdateMethod · 0.80
packUpdateMethod · 0.80
packUpdateMethod · 0.80
packUpdateMethod · 0.80

Calls 2

mAtan2Function · 0.85
mSqrtFunction · 0.85

Tested by

no test coverage detected