mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 06:45:53 +02:00
Hall of Meat (contrib/plugins/hall-of-meat) and grind exit triggers (contrib/plugins/grind-exits) are Lua plugins: the bail model, its Meat card, each map's best, the trigger rules, settings, console commands and menu panels are theirs, with their own checks that dingosdk_plugin_tests runs. What has to run in the game stays in core as plugin services: - every physics step of the skater (skater_physics, the physics_step event, permission events.physics); - the skater's x-ray (xray, xray_render, xray_skeleton; reskate.skater.xray and the draw handler's d:skeleton); - skate.'s bottom left HUD corner (hud_corner; reskate.hud.corner); - the game's slow motion, never in a session (game_speed; reskate.time.slow and speed, permission game.speed); - the side of the next pop out of a grind and pad controls kept from the game (grind_exit; reskate.skater.grind_exit, the grind_exit event, reskate.input.hide); - skate.'s own pictures by name (game_images; d:game_image), d:gradient and a font for drawn text. Removed: Extension/HallOfMeat, grind_exit_control and its commands, the HALL OF MEAT and GRIND EXITS add-on pages, home tile, hub and native menu rows, their menu models, and the hallofmeat and grindexit built-in commands.
32 lines
1.5 KiB
C++
32 lines
1.5 KiB
C++
#pragma once
|
|
#include "Engine/Game/Abi/linear_transform.h"
|
|
#include <array>
|
|
#include <cmath>
|
|
#include <cstddef>
|
|
|
|
// A skinned mesh's draw packet as the renderer hands it out (Engine/Game/Build/20260929/
|
|
// skater_render.h): its bones' skinning matrices, packed, and how to place them in the world.
|
|
// Plain data and math; Extension/Skater/xray_render.h reads it.
|
|
namespace dingosdk::draw_packet {
|
|
using game::LinearTransform;
|
|
|
|
// A packed bone: the skinning matrix's three columns of four floats, transposed for the shader.
|
|
using PackedBone = std::array<float, 12>;
|
|
constexpr LinearTransform unpack(const PackedBone& p) noexcept {
|
|
return {{{p[0], p[4], p[8], 0}, {p[1], p[5], p[9], 0}, {p[2], p[6], p[10], 0}, {p[3], p[7], p[11], 1}}};
|
|
}
|
|
// Where the packed bones go: the packet's root (the world position's whole metres the packing left
|
|
// out) and, for a relative packet, its actor's transform after it.
|
|
constexpr LinearTransform placement(const std::array<float, 4>& root, bool relative, const LinearTransform& actor) noexcept {
|
|
const LinearTransform at_root{{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {root[0], root[1], root[2], 1}}};
|
|
return relative ? game::compose(at_root, actor) : at_root;
|
|
}
|
|
// The bone's skinning matrix in the world. False for one that is not finite.
|
|
inline bool skin(const PackedBone& packed, const LinearTransform& placed, LinearTransform& out) noexcept {
|
|
for (const float value : packed)
|
|
if (!std::isfinite(value) || std::abs(value) > 1e7f) return false;
|
|
out = game::compose(unpack(packed), placed);
|
|
return true;
|
|
}
|
|
}
|