OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
SkelVec4.h
1/*
2===========================================================================
3Copyright (C) 2023 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23// SkelVec4.h : Skeletor Vec4
24
25#pragma once
26
27#ifdef __cplusplus
28
29class SkelVec4
30{
31public:
32 union {
33 float val[4];
34
35 struct {
36 float x;
37 float y;
38 float z;
39 float w;
40 } xyzw;
41 };
42
43protected:
44 void copy(const SkelVec4&);
45
46public:
47 SkelVec4(float x, float y, float z, float w);
48 SkelVec4(const SkelVec3& vec3, float w);
49 SkelVec4(const float *vec4);
50
51 operator float *();
52 operator float *() const;
53
54 void set(float x, float y, float z, float w);
55};
56
57#else
58
59typedef struct {
60 union {
61 float val[4];
62
63 struct {
64 float x;
65 float y;
66 float z;
67 float w;
68 };
69 };
70} SkelVec4;
71
72#endif
Definition SkelVec4.h:59