-
Notifications
You must be signed in to change notification settings - Fork 1
Vanilla Camera System
Sandy edited this page Apr 30, 2023
·
3 revisions
Part of CameraEditor internally
struct LH3DWay {
uint32_t size;
int count;
float field_0x8;
float field_0xc;
uint32_t duration;
struct LHPoint *points; // size of count ?
struct LHPoint *list_extra; // size of count - 1 ?
float* field_0x1c; // size of count
float* field_0x20; // size of count
uint8_t storage[]; // size of size
};
struct LHPoint(*__fastcall GetListExtra__7LH3DWayFl(struct LH3DWay* this, const void* edx, int index))[2] {
return &this->list_extra[index * 2];
}
// win1.41 008439c0 mac 100d39e0 LH3DWay::GetPosAtSegment(long, float, LHPoint*)
void __fastcall GetPosAtSegment__7LH3DWayFlfP7LHPoint(struct LH3DWay* this, const void* edx, int segment_index, float t, struct LHPoint* out_point) {
// Obtain the control points and extra control points for the curve
struct LHPoint (*control_points)[2] = &this->points[segment_index];
struct LHPoint (*extra_points)[2] = GetListExtra__7LH3DWayFl(this, edx, segment_index);
// Calculate blending functions for the cubic Bézier curve
float blend_factor0 = (1.0f - t) * (1.0f - t) * (1.0f - t);
float blend_factor1 = (1.0f - t) * (1.0f - t) * t * 3.0f;
float blend_factor2 = (1.0f - t) * t * t * 3.0f;
float blend_factor3 = t * t * t;
// Calculate the x, y, and z coordinates of the output point on the curve
out_point->x = blend_factor0 * (*control_points)[0].x + blend_factor1 * (*extra_points)[0].x + blend_factor2 * (*extra_points)[1].x + blend_factor3 * (*control_points)[1].x;
out_point->y = blend_factor0 * (*control_points)[0].y + blend_factor1 * (*extra_points)[0].y + blend_factor2 * (*extra_points)[1].y + blend_factor3 * (*control_points)[1].y;
out_point->z = blend_factor0 * (*control_points)[0].z + blend_factor1 * (*extra_points)[0].z + blend_factor2 * (*extra_points)[1].z + blend_factor3 * (*control_points)[1].z;
}