2023-05-31 16:19:06 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup DNA
|
2011-02-17 21:48:12 +01:00
|
|
|
*/
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2012-02-17 19:59:41 +01:00
|
|
|
#pragma once
|
2011-12-30 08:25:49 +01:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
/* types */
|
2011-02-17 21:48:12 +01:00
|
|
|
|
|
|
|
/** vector of two shorts. */
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct vec2s {
|
|
|
|
short x, y;
|
|
|
|
} vec2s;
|
|
|
|
|
2011-02-17 21:48:12 +01:00
|
|
|
/** vector of two floats. */
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct vec2f {
|
|
|
|
float x, y;
|
|
|
|
} vec2f;
|
|
|
|
|
2010-01-26 00:12:02 +01:00
|
|
|
typedef struct vec2i {
|
|
|
|
int x, y;
|
|
|
|
} vec2i;
|
|
|
|
|
2023-04-14 16:08:05 +02:00
|
|
|
/* not used at the moment */
|
|
|
|
/*
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct vec2d {
|
|
|
|
double x, y;
|
|
|
|
} vec2d;
|
2023-12-19 14:57:49 +01:00
|
|
|
*/
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct vec3i {
|
|
|
|
int x, y, z;
|
|
|
|
} vec3i;
|
2023-12-19 14:57:49 +01:00
|
|
|
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct vec3f {
|
|
|
|
float x, y, z;
|
|
|
|
} vec3f;
|
2011-05-09 07:55:41 +02:00
|
|
|
/*
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct vec3d {
|
|
|
|
double x, y, z;
|
|
|
|
} vec3d;
|
|
|
|
|
|
|
|
typedef struct vec4i {
|
|
|
|
int x, y, z, w;
|
|
|
|
} vec4i;
|
2023-06-12 15:49:50 +02:00
|
|
|
*/
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct vec4f {
|
|
|
|
float x, y, z, w;
|
|
|
|
} vec4f;
|
2024-02-13 18:59:36 +01:00
|
|
|
|
|
|
|
typedef struct mat4x4f {
|
|
|
|
float value[4][4];
|
|
|
|
} mat4x4f;
|
2023-06-12 15:49:50 +02:00
|
|
|
/*
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct vec4d {
|
|
|
|
double x, y, z, w;
|
|
|
|
} vec4d;
|
2010-10-01 17:59:34 +02:00
|
|
|
*/
|
2002-10-12 13:37:38 +02:00
|
|
|
|
2011-02-17 21:48:12 +01:00
|
|
|
/** integer rectangle. */
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct rcti {
|
2010-03-22 10:30:00 +01:00
|
|
|
int xmin, xmax;
|
|
|
|
int ymin, ymax;
|
2023-07-20 11:18:11 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
inline bool operator==(const rcti &other) const
|
|
|
|
{
|
|
|
|
return xmin == other.xmin && xmax == other.xmax && ymin == other.ymin && ymax == other.ymax;
|
|
|
|
}
|
|
|
|
inline bool operator!=(const rcti &other) const
|
|
|
|
{
|
|
|
|
return !(*this == other);
|
|
|
|
}
|
|
|
|
#endif
|
2002-10-12 13:37:38 +02:00
|
|
|
} rcti;
|
|
|
|
|
2011-02-17 21:48:12 +01:00
|
|
|
/** float rectangle. */
|
2002-10-12 13:37:38 +02:00
|
|
|
typedef struct rctf {
|
2010-03-22 10:30:00 +01:00
|
|
|
float xmin, xmax;
|
|
|
|
float ymin, ymax;
|
2002-10-12 13:37:38 +02:00
|
|
|
} rctf;
|
|
|
|
|
2019-04-18 22:17:04 +02:00
|
|
|
/** dual quaternion. */
|
|
|
|
typedef struct DualQuat {
|
|
|
|
float quat[4];
|
|
|
|
float trans[4];
|
|
|
|
|
|
|
|
float scale[4][4];
|
|
|
|
float scale_weight;
|
|
|
|
} DualQuat;
|