summaryrefslogtreecommitdiffstats
path: root/src/game/shared/entity/transform.hh
blob: 55a00ac409142bf21dc6d764d498469c479beae0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: BSD-2-Clause
// Copyright (c) 2025 Kirill Dmitrievich
// File: transform.hh
// Description: Transform component

#ifndef SHARED_ENTITY_TRANSFORM_HH
#define SHARED_ENTITY_TRANSFORM_HH
#pragma once

#include "shared/types.hh"

class Dimension;

struct Transform {
    chunk_pos chunk;
    glm::fvec3 local;
    glm::fvec3 angles;

public:
    // Updates Transform values so that
    // the local translation field is always within
    // local coodrinates; [floating-point precision]
    static void fixed_update(Dimension* dimension);
};

namespace client
{
// Client-side only - interpolated and previous transform
struct TransformIntr final : public Transform {};
struct TransformPrev final : public Transform {};
} // namespace client

#endif