GEBlupiController

Invisible, collision-only movement placeholder — no sprite, no animation state machine yet.

Overview

Its own header comment describes it precisely: "invisible, collision-only movement placeholder … no sprite, no animation state machine yet." It is engine-agnostic — depends only on GalaxyEggbert::Worlds — which is why it can be scripted headlessly by the VerifyBlupiMovement tool without a live window.

Sources: src/GalaxyEggbertCNA/Game/GEBlupiController.hpp and .cpp.

Constants (match GalaxyEggbertSimple3D's equivalent controller)

static constexpr float kMoveSpeed = 5.5f;   // units/s
static constexpr float kJumpSpeed = 12.0f;  // units/s
static constexpr float kGravity   = 25.0f;  // units/s²
static constexpr float kFallLimit = -10.0f; // terminal fall velocity clamp
static constexpr float kStepLimit = 1.0f;   // max step-up height

API

class GEBlupiController {
public:
    void SetPosition(float x, float y, float z);
    Vector3 GetPosition() const;

    bool IsSolidAt(const Worlds::World& world, int gx, int gy, int gz) const;
    int  GroundHeightAt(const Worlds::World& world, int gx, int gz) const;

    void Step(const Worlds::World& world, float dx, float dz, bool jumpPressed, float dt);
    bool IsOnGround() const;
};

GroundHeightAt(gx, gz)

Scans Y from top down for the first solid block; returns its Y+1, or 0 if the column is empty.

TryMoveAxis (internal)

Per-axis horizontal move: allows the move if the target column's ground is at most kStepLimit above the current feet Y (i.e. a 1-block step-up), and auto-lifts Y onto the new ground when grounded.

Step(world, dx, dz, jumpPressed, dt)

  1. Moves X then Z independently via TryMoveAxis.
  2. Applies a jump impulse (kJumpSpeed) when grounded and jumpPressed.
  3. Applies gravity, clamped to kFallLimit.
  4. Resolves vertical collision against GroundHeightAt, setting m_onGround/m_velocityY = 0 on landing.

Grid coordinates are computed via std::lround(pos + kWorldCenter), clamped to [0, blocksPerAxis - 1].

What This Class Does Not Do

Verification Tool

tools/VerifyBlupiMovement.cpp is a standalone CMake target linking only GEBlupiController.cpp — no CNA dependency — used to script and verify movement behavior headlessly.