Initial Prey Game integration support.

This commit is contained in:
Justin Marshall
2026-05-05 15:01:01 -07:00
parent a6c6f1ed26
commit 8d5f678b25
552 changed files with 265551 additions and 209 deletions
+69
View File
@@ -0,0 +1,69 @@
// Copyright (C) 2004 Id Software, Inc.
//
#ifndef __FORCE_FIELD_H__
#define __FORCE_FIELD_H__
/*
===============================================================================
Force field
===============================================================================
*/
enum forceFieldType {
FORCEFIELD_UNIFORM,
FORCEFIELD_EXPLOSION,
FORCEFIELD_IMPLOSION
};
enum forceFieldApplyType {
FORCEFIELD_APPLY_FORCE,
FORCEFIELD_APPLY_VELOCITY,
FORCEFIELD_APPLY_IMPULSE
};
class idForce_Field : public idForce {
public:
CLASS_PROTOTYPE( idForce_Field );
void Save( idSaveGame *savefile ) const;
void Restore( idRestoreGame *savefile );
idForce_Field( void );
virtual ~idForce_Field( void );
// uniform constant force
void Uniform( const idVec3 &force );
// explosion from clip model origin
void Explosion( float force );
// implosion towards clip model origin
void Implosion( float force );
// add random torque
void RandomTorque( float force );
// should the force field apply a force, velocity or impulse
void SetApplyType( const forceFieldApplyType type ) { applyType = type; }
// make the force field only push players
void SetPlayerOnly( bool set ) { playerOnly = set; }
// make the force field only push monsters
void SetMonsterOnly( bool set ) { monsterOnly = set; }
// clip model describing the extents of the force field
void SetClipModel( idClipModel *clipModel );
public: // common force interface
virtual void Evaluate( int time );
private:
// force properties
forceFieldType type;
forceFieldApplyType applyType;
float magnitude;
idVec3 dir;
float randomTorque;
bool playerOnly;
bool monsterOnly;
idClipModel * clipModel;
};
#endif /* !__FORCE_FIELD_H__ */