Add rotation function
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
.vscode/
|
||||
.idea/
|
||||
|
||||
# ---
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ Cube::Cube( TextureRepository *t_texRepo )
|
||||
|
||||
void Cube::update(const Pad &t_pad, const Camera &t_camera)
|
||||
{
|
||||
rotate(t_pad);
|
||||
Vector3 *nextPos = getNextPosition(t_pad, t_camera);
|
||||
}
|
||||
|
||||
@@ -56,3 +57,11 @@ Vector3 *Cube::getNextPosition(const Pad &t_pad, const Camera &t_camera)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void Cube::rotate(const Pad &t_pad){
|
||||
//if (t_pad.rJoyH >= 200)
|
||||
//else if (t_pad.rJoyH <= 100)
|
||||
mesh.rotation.x += 0.01;
|
||||
mesh.rotation.y += 0.01;
|
||||
mesh.rotation.z += 0.01;
|
||||
}
|
||||
@@ -20,6 +20,7 @@ class Cube
|
||||
private:
|
||||
TextureRepository *texRepo;
|
||||
Vector3 *getNextPosition(const Pad &t_pad, const Camera &t_camera);
|
||||
void rotate(const Pad &t_pad);
|
||||
float speed;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user