diff options
author | /dev/humancontroller <devhc@example.com> | 2014-07-13 16:10:27 +0200 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-03-09 13:51:09 +0100 |
commit | 31a215ac503e8181d0ae2b95e0b70f912aa035dc (patch) | |
tree | 821c69168806e6a0617d647f8c63645a8db01915 /src/cgame/cg_local.h | |
parent | dc29d98dd840b2d00d0701562f4c1132e5dc5a04 (diff) |
allow particles of child particle systems to be launched with (dynamic) normals
new particle script constructs (in particle blocks):
{velocityType | accelerationType} {last_normal | opportunistic_normal}
the base vector in case of opportunistic_normal is (0,0,0) if the particle is flying, and is a surface normal vector if the particle is in/on a map surface. the base vector in case of last_normal is always a valid direction, though sometimes an arbitrary one (the up direction). in both cases, the initial value of the last/opportunistic normal vector is propagated from the parent particle.
the last/opportunistic vector is a new particle system variable, and the original normal vector is not touched, so this change retains backward-compatibility.
Diffstat (limited to 'src/cgame/cg_local.h')
-rw-r--r-- | src/cgame/cg_local.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 53841e45..54477662 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -203,7 +203,9 @@ typedef enum PMT_STATIC_TRANSFORM, PMT_TAG, PMT_CENT_ANGLES, - PMT_NORMAL + PMT_NORMAL, + PMT_LAST_NORMAL, + PMT_OPPORTUNISTIC_NORMAL } pMoveType_t; typedef enum @@ -357,6 +359,9 @@ typedef struct particleSystem_s //for PMT_NORMAL qboolean normalValid; vec3_t normal; + //for PMT_LAST_NORMAL and PMT_OPPORTUNISTIC_NORMAL + qboolean lastNormalIsCurrent; + vec3_t lastNormal; int charge; } particleSystem_t; @@ -384,6 +389,8 @@ typedef struct particle_s baseParticle_t *class; particleEjector_t *parent; + particleSystem_t *childParticleSystem; + int birthTime; int lifeTime; @@ -1814,6 +1821,7 @@ qboolean CG_IsParticleSystemInfinite( particleSystem_t *ps ); qboolean CG_IsParticleSystemValid( particleSystem_t **ps ); void CG_SetParticleSystemNormal( particleSystem_t *ps, vec3_t normal ); +void CG_SetParticleSystemLastNormal( particleSystem_t *ps, const float *normal ); void CG_AddParticles( void ); |