2021-03-09 02:39:41 +00:00
|
|
|
/*
|
2021-07-24 05:19:52 +00:00
|
|
|
transform.h
|
2021-03-09 02:39:41 +00:00
|
|
|
|
2021-07-24 05:19:52 +00:00
|
|
|
Transform management
|
2021-03-09 02:39:41 +00:00
|
|
|
|
|
|
|
Copyright (C) 2021 Bill Currie <bill@taniwha.org>
|
|
|
|
|
|
|
|
Author: Bill Currie <bill@taniwha.org>
|
|
|
|
Date: 2021/02/26
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2021-07-24 05:19:52 +00:00
|
|
|
#ifndef __QF_scene_transform_h
|
|
|
|
#define __QF_scene_transform_h
|
2021-03-09 02:39:41 +00:00
|
|
|
|
|
|
|
#include "QF/darray.h"
|
2021-07-24 05:19:52 +00:00
|
|
|
#include "QF/qtypes.h"
|
2022-10-26 06:22:09 +00:00
|
|
|
#include "QF/ecs/component.h"
|
|
|
|
#include "QF/ecs/hierarchy.h"
|
|
|
|
#include "QF/ecs/hierarchy.h"
|
2021-03-09 02:39:41 +00:00
|
|
|
#include "QF/simd/vec4f.h"
|
|
|
|
#include "QF/simd/mat4f.h"
|
|
|
|
|
2021-07-24 05:19:52 +00:00
|
|
|
/** \defgroup transform Transform management
|
2021-03-09 02:39:41 +00:00
|
|
|
\ingroup utils
|
|
|
|
*/
|
|
|
|
///@{
|
|
|
|
|
2022-10-09 17:00:33 +00:00
|
|
|
enum {
|
|
|
|
transform_type_name,
|
|
|
|
transform_type_tag,
|
|
|
|
transform_type_modified,
|
|
|
|
transform_type_localMatrix,
|
|
|
|
transform_type_localInverse,
|
|
|
|
transform_type_worldMatrix,
|
|
|
|
transform_type_worldInverse,
|
|
|
|
transform_type_localRotation,
|
|
|
|
transform_type_localScale,
|
|
|
|
transform_type_worldRotation,
|
|
|
|
transform_type_worldScale,
|
|
|
|
|
|
|
|
transform_type_count
|
|
|
|
};
|
|
|
|
|
2021-03-09 02:39:41 +00:00
|
|
|
typedef struct transform_s {
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
ecs_registry_t *reg;
|
|
|
|
uint32_t id;
|
|
|
|
uint32_t comp;
|
2021-03-09 02:39:41 +00:00
|
|
|
} transform_t;
|
|
|
|
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
#define nulltransform ((transform_t) {})
|
|
|
|
|
2022-02-20 23:33:41 +00:00
|
|
|
#define XFORMINLINE GNU89INLINE inline __attribute__((pure))
|
|
|
|
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
XFORMINLINE int Transform_Valid (transform_t transform);
|
|
|
|
|
2022-10-26 06:22:09 +00:00
|
|
|
transform_t Transform_New (ecs_registry_t *reg, transform_t parent);
|
2022-02-14 07:41:38 +00:00
|
|
|
/* Deletes all child transforms, and transform names */
|
2022-10-26 06:22:09 +00:00
|
|
|
void Transform_Delete (transform_t transform);
|
|
|
|
transform_t Transform_NewNamed (ecs_registry_t *reg, transform_t parent,
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
const char *name);
|
|
|
|
XFORMINLINE hierref_t *Transform_GetRef (transform_t transform);
|
|
|
|
XFORMINLINE uint32_t Transform_ChildCount (transform_t transform);
|
|
|
|
XFORMINLINE transform_t Transform_GetChild (transform_t transform,
|
|
|
|
uint32_t childIndex);
|
2022-10-26 06:22:09 +00:00
|
|
|
void Transform_SetParent (transform_t transform, transform_t parent);
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
XFORMINLINE transform_t Transform_GetParent (transform_t transform);
|
|
|
|
void Transform_SetName (transform_t transform, const char *name);
|
|
|
|
XFORMINLINE const char *Transform_GetName (transform_t transform);
|
|
|
|
void Transform_SetTag (transform_t transform, uint32_t tag);
|
|
|
|
XFORMINLINE uint32_t Transform_GetTag (transform_t transform);
|
|
|
|
GNU89INLINE inline void Transform_GetLocalMatrix (transform_t transform,
|
|
|
|
mat4f_t mat);
|
|
|
|
GNU89INLINE inline void Transform_GetLocalInverse (transform_t transform,
|
|
|
|
mat4f_t mat);
|
|
|
|
GNU89INLINE inline void Transform_GetWorldMatrix (transform_t transform,
|
|
|
|
mat4f_t mat);
|
2021-12-17 07:42:31 +00:00
|
|
|
// XXX the pointer may be invalidated by hierarchy updates
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
XFORMINLINE const vec4f_t *Transform_GetWorldMatrixPtr (transform_t transform);
|
|
|
|
GNU89INLINE inline void Transform_GetWorldInverse (transform_t transform,
|
|
|
|
mat4f_t mat);
|
|
|
|
XFORMINLINE vec4f_t Transform_GetLocalPosition (transform_t transform);
|
|
|
|
void Transform_SetLocalPosition (transform_t transform, vec4f_t position);
|
|
|
|
XFORMINLINE vec4f_t Transform_GetLocalRotation (transform_t transform);
|
|
|
|
void Transform_SetLocalRotation (transform_t transform, vec4f_t rotation);
|
|
|
|
XFORMINLINE vec4f_t Transform_GetLocalScale (transform_t transform);
|
|
|
|
void Transform_SetLocalScale (transform_t transform, vec4f_t scale);
|
|
|
|
XFORMINLINE vec4f_t Transform_GetWorldPosition (transform_t transform);
|
|
|
|
void Transform_SetWorldPosition (transform_t transform, vec4f_t position);
|
|
|
|
XFORMINLINE vec4f_t Transform_GetWorldRotation (transform_t transform);
|
|
|
|
void Transform_SetWorldRotation (transform_t transform, vec4f_t rotation);
|
|
|
|
XFORMINLINE vec4f_t Transform_GetWorldScale (transform_t transform);
|
|
|
|
void Transform_SetLocalTransform (transform_t transform, vec4f_t scale,
|
2021-03-09 14:52:40 +00:00
|
|
|
vec4f_t rotation, vec4f_t position);
|
2022-02-14 21:46:01 +00:00
|
|
|
// NOTE: these use X: forward, -Y: right, Z:up
|
2021-03-09 02:39:41 +00:00
|
|
|
// aslo, not guaranteed to be normalized or even orthogonal
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
XFORMINLINE vec4f_t Transform_Forward (transform_t transform);
|
|
|
|
XFORMINLINE vec4f_t Transform_Right (transform_t transform);
|
|
|
|
XFORMINLINE vec4f_t Transform_Up (transform_t transform);
|
2021-03-09 02:39:41 +00:00
|
|
|
// no SetWorldScale because after rotations, non uniform scale becomes shear
|
|
|
|
|
2022-02-20 23:33:41 +00:00
|
|
|
#undef XFORMINLINE
|
|
|
|
#ifndef IMPLEMENT_TRANSFORM_Funcs
|
|
|
|
#define XFORMINLINE GNU89INLINE inline
|
|
|
|
#else
|
|
|
|
#define XFORMINLINE VISIBLE
|
|
|
|
#endif
|
|
|
|
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
XFORMINLINE
|
|
|
|
int
|
|
|
|
Transform_Valid (transform_t transform)
|
|
|
|
{
|
|
|
|
return transform.reg && ECS_EntValid (transform.id, transform.reg);
|
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
hierref_t *
|
|
|
|
Transform_GetRef (transform_t transform)
|
|
|
|
{
|
|
|
|
return Ent_GetComponent (transform.id, transform.comp, transform.reg);
|
|
|
|
}
|
|
|
|
|
2022-02-20 23:33:41 +00:00
|
|
|
XFORMINLINE
|
|
|
|
uint32_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_ChildCount (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
|
|
|
return h->childCount[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
transform_t
|
|
|
|
Transform_GetChild (transform_t transform, uint32_t childIndex)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
|
|
|
if (childIndex >= h->childCount[ref->index]) {
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
return nulltransform;
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
return (transform_t) {
|
|
|
|
.reg = transform.reg,
|
|
|
|
.id = h->ent[h->childIndex[ref->index] + childIndex],
|
|
|
|
.comp = transform.comp,
|
|
|
|
};
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
transform_t
|
|
|
|
Transform_GetParent (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
if (ref->index == 0) {
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
return nulltransform;
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
return (transform_t) {
|
|
|
|
.reg = transform.reg,
|
|
|
|
.id = h->ent[h->parentIndex[ref->index]],
|
|
|
|
.comp = transform.comp,
|
|
|
|
};
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
const char *
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetName (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
char **name = h->components[transform_type_name];
|
2022-10-22 04:04:07 +00:00
|
|
|
return name[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
uint32_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetTag (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
uint32_t *tag = h->components[transform_type_tag];
|
2022-10-22 04:04:07 +00:00
|
|
|
return tag[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
void
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetLocalMatrix (transform_t transform, mat4f_t mat)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *localMatrix = h->components[transform_type_localMatrix];
|
2022-10-22 04:04:07 +00:00
|
|
|
vec4f_t *src = localMatrix[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
mat[0] = src[0];
|
|
|
|
mat[1] = src[1];
|
|
|
|
mat[2] = src[2];
|
|
|
|
mat[3] = src[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
void
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetLocalInverse (transform_t transform, mat4f_t mat)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *localInverse = h->components[transform_type_localInverse];
|
2022-10-22 04:04:07 +00:00
|
|
|
vec4f_t *src = localInverse[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
mat[0] = src[0];
|
|
|
|
mat[1] = src[1];
|
|
|
|
mat[2] = src[2];
|
|
|
|
mat[3] = src[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
void
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetWorldMatrix (transform_t transform, mat4f_t mat)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *worldMatrix = h->components[transform_type_worldMatrix];
|
2022-10-22 04:04:07 +00:00
|
|
|
vec4f_t *src = worldMatrix[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
mat[0] = src[0];
|
|
|
|
mat[1] = src[1];
|
|
|
|
mat[2] = src[2];
|
|
|
|
mat[3] = src[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
const vec4f_t *
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetWorldMatrixPtr (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *worldMatrix = h->components[transform_type_worldMatrix];
|
2022-10-22 04:04:07 +00:00
|
|
|
return worldMatrix[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
void
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetWorldInverse (transform_t transform, mat4f_t mat)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *worldInverse = h->components[transform_type_worldInverse];
|
2022-10-22 04:04:07 +00:00
|
|
|
vec4f_t *src = worldInverse[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
mat[0] = src[0];
|
|
|
|
mat[1] = src[1];
|
|
|
|
mat[2] = src[2];
|
|
|
|
mat[3] = src[3];
|
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetLocalPosition (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *localMatrix = h->components[transform_type_localMatrix];
|
2022-10-22 04:04:07 +00:00
|
|
|
return localMatrix[ref->index][3];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetLocalRotation (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
vec4f_t *localRotation = h->components[transform_type_localRotation];
|
2022-10-22 04:04:07 +00:00
|
|
|
return localRotation[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetLocalScale (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
vec4f_t *localScale = h->components[transform_type_localScale];
|
2022-10-22 04:04:07 +00:00
|
|
|
return localScale[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetWorldPosition (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *worldMatrix = h->components[transform_type_worldMatrix];
|
2022-10-22 04:04:07 +00:00
|
|
|
return worldMatrix[ref->index][3];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetWorldRotation (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
vec4f_t *worldRotation = h->components[transform_type_worldRotation];
|
2022-10-22 04:04:07 +00:00
|
|
|
return worldRotation[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_GetWorldScale (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
vec4f_t *worldScale = h->components[transform_type_worldScale];
|
2022-10-22 04:04:07 +00:00
|
|
|
return worldScale[ref->index];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_Forward (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *worldMatrix = h->components[transform_type_worldMatrix];
|
2022-10-22 04:04:07 +00:00
|
|
|
return worldMatrix[ref->index][0];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_Right (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *worldMatrix = h->components[transform_type_worldMatrix];
|
2022-10-22 04:04:07 +00:00
|
|
|
return -worldMatrix[ref->index][1];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
XFORMINLINE
|
|
|
|
vec4f_t
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
Transform_Up (transform_t transform)
|
2022-02-20 23:33:41 +00:00
|
|
|
{
|
[scene] Make entity_t just an entity id for ECS
This puts the hierarchy (transform) reference, animation, visibility,
renderer, active, and old_origin data in separate components. There are
a few bugs (crashes on grenade explosions in gl/glsl/vulkan, immediately
in sw, reasons known, missing brush models in vulkan).
While quake doesn't really need an ECS, the direction I want to take QF
does, and it does seem to have improved memory bandwidth a little
(uncertain). However, there's a lot more work to go (especially fixing
the above bugs), but this seems to be a good start.
2022-10-23 01:32:09 +00:00
|
|
|
__auto_type ref = Transform_GetRef (transform);
|
2022-10-22 04:04:07 +00:00
|
|
|
hierarchy_t *h = ref->hierarchy;
|
2022-10-09 17:00:33 +00:00
|
|
|
mat4f_t *worldMatrix = h->components[transform_type_worldMatrix];
|
2022-10-22 04:04:07 +00:00
|
|
|
return worldMatrix[ref->index][2];
|
2022-02-20 23:33:41 +00:00
|
|
|
}
|
|
|
|
|
2021-03-09 02:39:41 +00:00
|
|
|
///@}
|
|
|
|
|
2021-07-24 05:19:52 +00:00
|
|
|
#endif//__QF_scene_transform_h
|