-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathThing.java
More file actions
133 lines (106 loc) · 2.25 KB
/
Thing.java
File metadata and controls
133 lines (106 loc) · 2.25 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
import processing.core.PApplet;
import picking.*;
public abstract class Thing implements Renderable
{
public static final int IDLE = 0;
public static final int SELECTED = 1;
public static final int TEMPORARY = 2;
public static final int NON_CONNECTABLE = 3;
protected int mode;
protected boolean active;
protected boolean setPos;
protected PApplet context;
public PhysicalParameter position;
private String user;
private int alpha;
private long timestamp;
private int id;
public abstract void render(float x, float y, float z);
public abstract void render(float x, float y);
public abstract void render();
public abstract void renderHitArea(Buffer buffer);
public abstract void renderHitArea();
public abstract void resetPhysicsToDefault();
public void step(float fx, float fy, float fz)
{
this.position.step(fx, fy, fz);
}
public void setId(int id)
{
this.id = id;
}
public int getId()
{
return this.id;
}
public void setMode(int m)
{
this.mode = m;
}
public int getMode()
{
return this.mode;
}
public void step(Point a)
{
this.position.step(a.x, a.y, a.z);
}
public String getUser()
{
return this.user;
}
public void setUser(String user)
{
this.user = user;
}
public void setAlpha(int a)
{
this.alpha = a;
}
public int getAlpha()
{
return this.alpha;
}
public void setTimestamp(long time)
{
this.timestamp = time;
}
public long getTimestamp()
{
return this.timestamp;
}
public void deactivate()
{
this.active = false;
}
public void activate()
{
this.active = true;
}
public boolean isActive()
{
return active;
}
public void setContext(PApplet context)
{
this.context = context;
}
public void setPosition(float x, float y, float z)
{
if(this.position == null)
{
this.position = new PhysicalParameter(x, y, z, 50, 0, (float)3);
}
this.position.setPosition(x, y, z);
this.setPos = true;
}
public void setPosition(Point a)
{
if(this.position == null)
{
this.position = new PhysicalParameter(a.x, a.y, a.z, 50, 0, (float)3);
}
this.position.setPosition(a);
this.setPos = true;
}
}