halflife-photomode/common/cl_entity.h

105 lines
2.8 KiB
C
Raw Normal View History

/***
2013-08-30 13:34:05 -07:00
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
// cl_entity.h
2013-08-30 13:34:05 -07:00
#pragma once
typedef struct efrag_s
{
struct mleaf_s* leaf;
struct efrag_s* leafnext;
struct cl_entity_s* entity;
struct efrag_s* entnext;
2013-08-30 13:34:05 -07:00
} efrag_t;
typedef struct
{
byte mouthopen; // 0 = mouth closed, 255 = mouth agape
byte sndcount; // counter for running average
int sndavg; // running average
2013-08-30 13:34:05 -07:00
} mouth_t;
typedef struct
{
float prevanimtime;
float sequencetime;
byte prevseqblending[2];
Vector prevorigin;
Vector prevangles;
2013-08-30 13:34:05 -07:00
int prevsequence;
float prevframe;
2013-08-30 13:34:05 -07:00
byte prevcontroller[4];
byte prevblending[2];
2013-08-30 13:34:05 -07:00
} latchedvars_t;
typedef struct
{
// Time stamp for this movement
float animtime;
2013-08-30 13:34:05 -07:00
Vector origin;
Vector angles;
2013-08-30 13:34:05 -07:00
} position_history_t;
typedef struct cl_entity_s cl_entity_t;
#define HISTORY_MAX 64 // Must be power of 2
#define HISTORY_MASK (HISTORY_MAX - 1)
2013-08-30 13:34:05 -07:00
#include "entity_state.h"
#include "progs.h"
struct cl_entity_s
{
int index; // Index into cl_entities ( should match actual slot, but not necessarily )
2013-08-30 13:34:05 -07:00
qboolean player; // True if this entity is a "player"
2013-08-30 13:34:05 -07:00
entity_state_t baseline; // The original state from which to delta during an uncompressed message
entity_state_t prevstate; // The state information from the penultimate message received from the server
entity_state_t curstate; // The state information from the last message received from server
2013-08-30 13:34:05 -07:00
int current_position; // Last received history update index
position_history_t ph[HISTORY_MAX]; // History of position and angle updates for this player
2013-08-30 13:34:05 -07:00
mouth_t mouth; // For synchronizing mouth movements.
latchedvars_t latched; // Variables used by studio model rendering routines
2013-08-30 13:34:05 -07:00
// Information based on interplocation, extrapolation, prediction, or just copied from last msg received.
//
float lastmove;
2013-08-30 13:34:05 -07:00
// Actual render position and angles
Vector origin;
Vector angles;
2013-08-30 13:34:05 -07:00
// Attachment points
Vector attachment[4];
2013-08-30 13:34:05 -07:00
// Other entity local information
int trivial_accept;
2013-08-30 13:34:05 -07:00
struct model_s* model; // cl.model_precache[ curstate.modelindes ]; all visible entities have a model
struct efrag_s* efrag; // linked list of efrags
struct mnode_s* topnode; // for bmodels, first world node that splits bmodel, or NULL if not split
2013-08-30 13:34:05 -07:00
float syncbase; // for client-side animations -- used by obsolete alias animation system, remove?
int visframe; // last frame this entity was found in an active leaf
colorVec cvFloorColor;
2013-08-30 13:34:05 -07:00
};