Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
common.qh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Rudolf Polzer
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 * IN THE SOFTWARE.
21 */
22#pragma once
23
25
26noref string csqcmodel_license = "\
27Copyright (c) 2011 Rudolf Polzer\
28\
29Permission is hereby granted, free of charge, to any person obtaining a copy\
30of this software and associated documentation files (the \"Software\"), to\
31deal in the Software without restriction, including without limitation the\
32rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\
33sell copies of the Software, and to permit persons to whom the Software is\
34furnished to do so, subject to the following conditions:\
35\
36The above copyright notice and this permission notice shall be included in\
37all copies or substantial portions of the Software.\
38\
39THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\
40IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\
41FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\
42AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\
43LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\
44FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\
45IN THE SOFTWARE.\
46"; // "
47
48.vector glowmod;
49.vector view_ofs;
50.int frame;
52.int frame2;
54.float lerpfrac;
55
56const int ISPLAYER_MODEL = BIT(0); // using a player model
57const int ISPLAYER_CLIENT = BIT(1); // is a client
58const int ISPLAYER_LOCAL = BIT(2); // is the local player
59const int ISPLAYER_PLAYER = BIT(3); // is a player in the match
60
62const int CSQCMODEL_PROPERTY_TELEPORTED = BIT(22); // the "teleport bit" cancelling interpolation
70
71#define ALLPROPERTIES_COMMON \
72 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, int, ReadByte, WriteByte, frame) \
73 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_MODELINDEX, int, ReadShort, WriteShort, modelindex) \
74 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, vector, ReadVector, WriteVector, origin) \
75 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, vector, ReadVector, WriteVector, mins) \
76 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_SIZE, vector, ReadVector, WriteVector, maxs) \
77 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_PITCHROLL, float, ReadAngle, WriteAngle, angles_x) \
78 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_YAW, float, ReadAngle, WriteAngle, angles_y) \
79 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_PITCHROLL, float, ReadAngle, WriteAngle, angles_z) \
80 CSQCMODEL_EXTRAPROPERTIES
81
82#ifdef CSQCMODEL_HAVE_TWO_FRAMES
83.float frame3;
84.float frame3time;
85.float lerpfrac3;
86.float frame4;
87.float frame4time;
88.float lerpfrac4;
89#define ALLPROPERTIES ALLPROPERTIES_COMMON \
90 CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME2, int, ReadByte, WriteByte, frame2) \
91 CSQCMODEL_PROPERTY_SCALED(CSQCMODEL_PROPERTY_LERPFRAC, float, ReadByte, WriteByte, lerpfrac, 255, 0, 255)
92#else
93#define ALLPROPERTIES ALLPROPERTIES_COMMON
94#endif
float frame3time
start time of framegroup animation
Definition anim.qh:26
float frame1time
start time of framegroup animation
Definition anim.qh:22
float frame2time
start time of framegroup animation
Definition anim.qh:24
float frame2
secondary framegroup animation (strength = lerpfrac)
Definition anim.qh:8
float lerpfrac
strength of framegroup blend
Definition anim.qh:15
float frame3
tertiary framegroup animation (strength = lerpfrac3)
Definition anim.qh:10
float lerpfrac4
strength of framegroup blend
Definition anim.qh:19
float frame4time
start time of framegroup animation
Definition anim.qh:28
float lerpfrac3
strength of framegroup blend
Definition anim.qh:17
float frame4
quaternary framegroup animation (strength = lerpfrac4)
Definition anim.qh:12
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition anim.qh:6
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
vector glowmod
const int CSQCMODEL_PROPERTY_MODELINDEX
Definition common.qh:63
const int CSQCMODEL_PROPERTY_PITCHROLL
Definition common.qh:66
const int ISPLAYER_PLAYER
Definition common.qh:59
const int CSQCMODEL_PROPERTY_FRAME2
Definition common.qh:67
noref string csqcmodel_license
Definition common.qh:26
const int CSQCMODEL_PROPERTY_YAW
Definition common.qh:65
const int ISPLAYER_LOCAL
Definition common.qh:58
const int CSQCMODEL_PROPERTY_FRAME
Definition common.qh:61
const int ISPLAYER_MODEL
Definition common.qh:56
const int ISPLAYER_CLIENT
Definition common.qh:57
const int CSQCMODEL_PROPERTY_LERPFRAC
Definition common.qh:68
const int CSQCMODEL_PROPERTY_ORIGIN
Definition common.qh:64
const int CSQCMODEL_PROPERTY_TELEPORTED
Definition common.qh:62
const int CSQCMODEL_PROPERTY_SIZE
Definition common.qh:69
vector view_ofs
Definition progsdefs.qc:151