mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-23 09:45:53 +02:00
94 lines
6.5 KiB
C++
94 lines
6.5 KiB
C++
#pragma once
|
|
#include "Engine/Game/Build/fingerprint.h"
|
|
#include <cstdint>
|
|
|
|
// Collision capsules for other players (Extension/Multiplayer/Remote/remote_collision.cpp).
|
|
// The engine's physics is EA FBPhysics: bodies and shapes are 16-byte handles
|
|
// {FBPhysicsWorld*, u32 index, u32 generation}; per-shape category masks live in the world
|
|
// state (world+0x28): InCategories at +0xfe8, CollidesWith at +0xff0. Full notes:
|
|
// analysis/party-collision.md.
|
|
namespace dingosdk::game::build::v20260929::remote_collision {
|
|
// The client physics world: world(*(game_context_global)); what skater physics creation
|
|
// (0xf8d730) uses. Null while no level physics exists.
|
|
inline constexpr std::uintptr_t game_context_global = 0x73c7cb0;
|
|
inline constexpr Fingerprint physics_world{0x3d2e920, {
|
|
0x48,0x83,0xec,0x28,0x48,0x85,0xc9,0x74,0x41,0x8b,0x05,0x61,0x3b,0x29,0x03,0x83,
|
|
0x3c,0x08,0x03,0x74,0x35,0x48,0x89,0x4c,0x24,0x30,0x48,0x8d,0x4c,0x24,0x30,0xe8}};
|
|
// FBPhysicsWorld::allocateBody(world, Handle* out).
|
|
inline constexpr Fingerprint allocate_body{0x266a6c0, {
|
|
0x40,0x53,0x55,0x56,0x57,0x41,0x54,0x41,0x56,0x41,0x57,0x48,0x83,0xec,0x40,0x48,
|
|
0x8b,0xf1,0x4c,0x8b,0xf2,0x48,0x81,0xc1,0x38,0x01,0x00,0x00,0xe8,0x6f,0xa9,0x03}};
|
|
// (body, motion type): 1 fixed, 2 keyframed, 3 dynamic.
|
|
inline constexpr Fingerprint set_motion_type{0x25daa90, {
|
|
0x40,0x53,0x55,0x56,0x57,0x41,0x56,0x41,0x57,0x48,0x83,0xec,0x28,0x4c,0x8b,0x09,
|
|
0x4c,0x8b,0xf9,0x8b,0x71,0x08,0x8b,0xda,0x44,0x8b,0xc6,0x40,0x0f,0xb6,0xce,0x49}};
|
|
// Two setters the retail skater proxy (0x1043390) calls on a new body: (body, 0.01f) writes
|
|
// the body's +0x980 value, (body) clears its +0xaa0 bit.
|
|
inline constexpr Fingerprint set_body_980{0x25dc4f0, {
|
|
0x48,0x8b,0x01,0x8b,0x51,0x08,0x48,0x8b,0x48,0x28,0x48,0x8b,0x81,0x80,0x09,0x00,
|
|
0x00,0xc5,0xfa,0x11,0x0c,0x90,0xc3,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc}};
|
|
inline constexpr Fingerprint clear_body_aa0{0x25d31d0, {
|
|
0x48,0x8b,0x01,0xba,0x01,0x00,0x00,0x00,0x44,0x8b,0x41,0x08,0x41,0x8b,0xc8,0xd3,
|
|
0xe2,0x48,0x8b,0x48,0x28,0xf7,0xd2,0x49,0xc1,0xe8,0x05,0x48,0x8b,0x81,0xa0,0x0a}};
|
|
// (world, Handle* shape out, const Handle* body, const vec4* a, const vec4* b, float radius):
|
|
// a capsule from a to b in the body's frame.
|
|
inline constexpr Fingerprint create_capsule{0x266ace0, {
|
|
0x48,0x8b,0xc4,0x53,0x48,0x81,0xec,0xa0,0x00,0x00,0x00,0xc4,0xc1,0x78,0x10,0x11,
|
|
0xc5,0xf8,0x29,0x70,0xe8,0xc5,0xf8,0x29,0x78,0xd8,0x48,0x8b,0x84,0x24,0xd0,0x00}};
|
|
// (shape, const u32* mask): the whole InCategories / CollidesWith mask.
|
|
inline constexpr Fingerprint set_categories{0x25d9ea0, {
|
|
0x48,0x8b,0x01,0x44,0x8b,0x41,0x08,0x44,0x8b,0x0a,0x48,0x8b,0x40,0x28,0x48,0x8b,
|
|
0x80,0xe8,0x0f,0x00,0x00,0x46,0x3b,0x0c,0x80,0x74,0x0f,0x46,0x89,0x0c,0x80,0x8b}};
|
|
inline constexpr Fingerprint set_collides_with{0x25d9410, {
|
|
0x48,0x8b,0x01,0x44,0x8b,0x41,0x08,0x44,0x8b,0x0a,0x48,0x8b,0x40,0x28,0x48,0x8b,
|
|
0x80,0xf0,0x0f,0x00,0x00,0x46,0x3b,0x0c,0x80,0x74,0x0f,0x46,0x89,0x0c,0x80,0x8b}};
|
|
// (shape, const Handle* owner): the shape's owner index (+0x1008), u32 at owner+8; -1 = none.
|
|
// The skater contact filter (0xf8cb80) resolves a contact's entity through it (0x25d6070).
|
|
inline constexpr Fingerprint set_shape_owner{0x25db410, {
|
|
0x48,0x83,0xec,0x38,0x48,0x8b,0x01,0x44,0x8b,0x51,0x08,0x4c,0x8b,0x40,0x28,0x8b,
|
|
0x42,0x08,0x48,0x8d,0x54,0x24,0x20,0x4d,0x8b,0x88,0x08,0x10,0x00,0x00,0x43,0x89}};
|
|
// (body, const vec4* local centre of mass).
|
|
inline constexpr Fingerprint set_center_of_mass{0x25d9180, {
|
|
0x48,0x8b,0xc4,0x48,0x89,0x58,0x08,0x57,0x48,0x81,0xec,0x80,0x00,0x00,0x00,0x8b,
|
|
0x79,0x08,0x45,0x33,0xc0,0xc5,0xf8,0x29,0x70,0xe8,0xc5,0xf8,0x29,0x78,0xd8,0xc5}};
|
|
// (body, const float[8] {quaternion x y z w, position x y z w}).
|
|
inline constexpr Fingerprint set_transform{0x25dc000, {
|
|
0x4c,0x8b,0xdc,0x53,0x48,0x83,0xec,0x70,0x8b,0x02,0x48,0x8b,0xd9,0x25,0x00,0x00,
|
|
0x80,0x7f,0x3d,0x00,0x00,0x80,0x7f,0x0f,0x84,0x18,0x03,0x00,0x00,0x8b,0x42,0x04}};
|
|
// (body, const vec4* velocity), for any motion type (clamped to the body's maximum speed).
|
|
// 0x25da0b0 / 0x25d7fe0 are different: they only apply to dynamic bodies.
|
|
inline constexpr Fingerprint set_linear_velocity{0x25da600, {
|
|
0x40,0x53,0x48,0x83,0xec,0x30,0x8b,0x02,0x4c,0x8b,0xca,0x25,0x00,0x00,0x80,0x7f,
|
|
0x48,0x8b,0xd9,0x3d,0x00,0x00,0x80,0x7f,0x0f,0x84,0x76,0x01,0x00,0x00,0x8b,0x42}};
|
|
inline constexpr Fingerprint set_angular_velocity{0x25d8530, {
|
|
0x40,0x53,0x48,0x83,0xec,0x30,0x8b,0x02,0x4c,0x8b,0xca,0x25,0x00,0x00,0x80,0x7f,
|
|
0x48,0x8b,0xd9,0x3d,0x00,0x00,0x80,0x7f,0x0f,0x84,0x76,0x01,0x00,0x00,0x8b,0x42}};
|
|
inline constexpr Fingerprint wake_body{0x25d3360, {
|
|
0x40,0x53,0x48,0x83,0xec,0x20,0x44,0x8b,0x49,0x08,0x48,0x8b,0xd9,0x41,0x8b,0xc9,
|
|
0x41,0xba,0x01,0x00,0x00,0x00,0x41,0xd3,0xe2,0x49,0xc1,0xe9,0x05,0x48,0x8b,0x03}};
|
|
// Handle checks (index allocated and generation current).
|
|
inline constexpr Fingerprint body_valid{0x25d7b10, {
|
|
0x8b,0x41,0x08,0x83,0xf8,0xff,0x74,0x19,0x44,0x8b,0xc0,0x48,0x8b,0x01,0x48,0x8b,
|
|
0x90,0x80,0x06,0x00,0x00,0x8b,0x41,0x0c,0x42,0x39,0x04,0x82,0x75,0x03,0xb0,0x01}};
|
|
inline constexpr Fingerprint shape_valid{0x25d7e00, {
|
|
0x4c,0x8b,0xc1,0x8b,0x49,0x08,0x83,0xf9,0xff,0x74,0x3a,0x49,0x8b,0x00,0x8b,0xd1,
|
|
0x48,0xc1,0xea,0x03,0x44,0x8b,0xd1,0x80,0xe1,0x07,0x4c,0x8b,0x48,0x28,0x49,0x8b}};
|
|
|
|
// Category bits (PhysicsCollisionCategory; configurations/delmarphysicscategorypresets).
|
|
inline constexpr unsigned category_remote_character_proxy = 21, category_local_skater = 26,
|
|
category_character_proxy = 28;
|
|
// Retail's remote-skater proxy (0x10451f0 remote branch): In RemoteCharacterProxy,
|
|
// CollidesWith CharacterProxy. LocalSkater is added so the local rig (CollidesWith bit 21
|
|
// while party collision is on) meets it under either pair rule.
|
|
inline constexpr std::uint32_t remote_proxy_categories = 1u << category_remote_character_proxy;
|
|
inline constexpr std::uint32_t remote_proxy_collides_with =
|
|
(1u << category_character_proxy) | (1u << category_local_skater);
|
|
// ProxySkater defaults (ctor 0x10371c0): height 1.8, radius 0.5, step 0.5; the capsule spans
|
|
// 0.15..1.45 m above the skater's root.
|
|
inline constexpr float proxy_radius = 0.5f, proxy_bottom = 0.15f, proxy_top = 1.45f;
|
|
// Local skater: the physics core (skater component +0x70, no_bail::bail_core_vtable) keeps
|
|
// the game's party-collision switch at +0x40e1 (0x102aad0; "Enable Party Collision" AND
|
|
// DingoAdvanceSettings.PlayerVsPlayerCollisionEnabled).
|
|
inline constexpr std::uintptr_t core_party_collision = 0x40e1;
|
|
} // namespace dingosdk::game::build::v20260929::remote_collision
|