forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdirect.dc
More file actions
91 lines (79 loc) · 3.5 KB
/
direct.dc
File metadata and controls
91 lines (79 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// This is a sample dc file for some of the classes defined within the
// direct source tree. It is suggested that you copy this file into
// your own project (or load it from the direct source tree) and build
// on it with your own dc file for your own classes.
keyword broadcast;
keyword ram;
keyword p2p;
from direct.distributed import DistributedObject/AI
from direct.distributed import TimeManager/AI
from direct.distributed import DistributedNode/AI
from direct.distributed import DistributedSmoothNode/AI
struct BarrierData {
uint16 context;
string name;
uint32 avIds[];
};
// The most fundamental class
dclass DistributedObject {
// These are used to support DistributedObjectAI.beginBarrier() and
// the matching DistributedObject.doneBarrier(). If you don't call
// these functions, you don't care about these distributed methods.
// (Actually, you probably don't care anyway.)
setBarrierData(BarrierData data[]) broadcast ram;
setBarrierReady(uint16 context);
setLocation(uint32 parentId, uint32 zoneId) broadcast ram;
};
dclass TimeManager: DistributedObject {
requestServerTime(uint8 context) p2p;
serverTime(uint8 context, int32 timestamp);
};
dclass DistributedNode: DistributedObject {
setX(int16 / 10) broadcast ram;
setY(int16 / 10) broadcast ram;
setZ(int16 / 10) broadcast ram;
setH(int16 % 360 / 10) broadcast ram;
setP(int16 % 360 / 10) broadcast ram;
setR(int16 % 360 / 10) broadcast ram;
setPos: setX, setY, setZ;
setHpr: setH, setP, setR;
setPosHpr: setX, setY, setZ, setH, setP, setR;
setXY: setX, setY;
setXZ: setX, setZ;
setXYH: setX, setY, setH;
setXYZH: setX, setY, setZ, setH;
};
dclass DistributedSmoothNode: DistributedNode {
// Component set pos and hpr functions.
setComponentL(uint64) broadcast ram;
setComponentX(int16 / 10) broadcast ram;
setComponentY(int16 / 10) broadcast ram;
setComponentZ(int16 / 10) broadcast ram;
setComponentH(int16 % 360 / 10) broadcast ram;
setComponentP(int16 % 360 / 10) broadcast ram;
setComponentR(int16 % 360 / 10) broadcast ram;
setComponentT(int16 timestamp) broadcast ram;
// Composite set pos and hpr functions. These map to combinations
// of one or more of the above components. They all include
// setComponentT(), which must be called last.
setSmStop: setComponentT;
setSmH: setComponentH, setComponentT;
setSmZ: setComponentZ, setComponentT;
setSmXY: setComponentX, setComponentY, setComponentT;
setSmXZ: setComponentX, setComponentZ, setComponentT;
setSmPos: setComponentX, setComponentY, setComponentZ, setComponentT;
setSmHpr: setComponentH, setComponentP, setComponentR, setComponentT;
setSmXYH: setComponentX, setComponentY, setComponentH, setComponentT;
setSmXYZH: setComponentX, setComponentY, setComponentZ, setComponentH, setComponentT;
setSmPosHpr: setComponentX, setComponentY, setComponentZ, setComponentH, setComponentP, setComponentR, setComponentT;
// special update if L (being location, such as zoneId) changes, send everything, intended to
// keep position and 'location' in sync
setSmPosHprL: setComponentL, setComponentX, setComponentY, setComponentZ, setComponentH, setComponentP, setComponentR, setComponentT;
clearSmoothing(int8 bogus) broadcast;
suggestResync(uint32 avId, int16 timestampA, int16 timestampB,
int32 serverTimeSec, uint16 serverTimeUSec,
uint16 / 100 uncertainty);
returnResync(uint32 avId, int16 timestampB,
int32 serverTimeSec, uint16 serverTimeUSec,
uint16 / 100 uncertainty);
};