- CMath: sqrt_, log2_, exp2_ (+ tables), solvequad_, normalizeangle0to2pi_, normalizeAngleNegPiToPi_; inline fint_ / ftol_round_0_255_ - CImVector::operator= rounds via fint_ (was truncating); Set via ftol_round_0_255_ - CRandom::uint32_ (guessed name) + table; CRndSeed moved to CRandom.h - NTempest: ray/box, ray/plane, ray/tri (u16/u32), point-in-polygon, 2d box/sphere, segment and polygon distances - CFrustum (0xE4) with culls, transforms, planes from corners; CWFrustum derives from it - C3Vector::EAxis; Major/MinorAxis return it Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
24 lines
870 B
C++
24 lines
870 B
C++
#include <cstdint>
|
|
#include "Engine/Source/Tempest/C3Vector.h"
|
|
#include "Engine/Source/Tempest/CMath.h"
|
|
#include "Engine/Source/Tempest/CImVector.h"
|
|
|
|
// VERIFY: 29546a0f manual
|
|
// OFFSET: 0x0048BD20
|
|
void CImVector::Set(float a, float r, float g, float b) {
|
|
this->a = static_cast<uint8_t>(CMath::ftol_round_0_255_(a));
|
|
this->r = static_cast<uint8_t>(CMath::ftol_round_0_255_(r));
|
|
this->g = static_cast<uint8_t>(CMath::ftol_round_0_255_(g));
|
|
this->b = static_cast<uint8_t>(CMath::ftol_round_0_255_(b));
|
|
}
|
|
|
|
// VERIFY: 5249a0a5 manual
|
|
// OFFSET: 0x009851A0
|
|
CImVector& CImVector::operator=(const C3Vector& color) {
|
|
this->a = 0xFF;
|
|
this->r = static_cast<uint8_t>(CMath::fint_(color.x * 255.0f));
|
|
this->g = static_cast<uint8_t>(CMath::fint_(color.y * 255.0f));
|
|
this->b = static_cast<uint8_t>(CMath::fint_(color.z * 255.0f));
|
|
return *this;
|
|
}
|