Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
This commit is contained in:
parent
35d2a8cb36
commit
a47d20f8be
890 changed files with 11796 additions and 16664 deletions
25
Source/Contents/Models/ModelTextureUV.cpp
Normal file
25
Source/Contents/Models/ModelTextureUV.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include "Contents/Models/ModelNode.h"
|
||||
|
||||
namespace {
|
||||
float Rotated(float sine, float delta, float cosineProduct, bool subtract) {
|
||||
const double product = static_cast<double>(sine) * delta;
|
||||
return static_cast<float>(subtract ? cosineProduct - product : product + cosineProduct);
|
||||
}
|
||||
}
|
||||
|
||||
// ORIGINAL_SITE: 0x00AB8856 in fn_17500 (fragment)
|
||||
void TransformModelUV(float& u, float& v, const ModelTextureTransform& transform) {
|
||||
const float cosineU = ClientCos(transform.values[4]);
|
||||
const float productU = cosineU * (u - 0.5f);
|
||||
const float sineU = ClientSin(transform.values[4]);
|
||||
const float rotatedU = Rotated(sineU, v - 0.5f, productU, true);
|
||||
const float resultU = (rotatedU * transform.values[2] + 0.5f) + transform.values[0];
|
||||
const float cosineV = ClientCos(transform.values[4]);
|
||||
const float productV = cosineV * (v - 0.5f);
|
||||
const float sineV = ClientSin(transform.values[4]);
|
||||
const float rotatedV = Rotated(sineV, u - 0.5f, productV, false);
|
||||
const float resultV = (rotatedV * transform.values[3] + 0.5f) + transform.values[1];
|
||||
|
||||
u = resultU;
|
||||
v = resultV;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue