Newer
Older
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
public class QShape {
float x, y, z;
PShape shape;
QShape(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
shape = null;
}
void rotateX(float angle) {
if(shape == null) return;
shape.rotateX(angle);
}
void rotateY(float angle) {
if(shape == null) return;
shape.rotateY(angle);
}
void rotateZ(float angle) {
if(shape == null) return;
shape.rotateZ(angle);
}
void translate(float x, float y, float z) {
shape.translate(x, y, z);
}
void drawShape() {
if (shape == null) return; // Vérification de nullité
shape(shape);
}
public PShape getShape() {
return shape;
}
}