diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Bullet.java b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Bullet.java index a67e589..fde346a 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Bullet.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Bullet.java @@ -32,14 +32,16 @@ public Bullet(Object3D body, Animation3D animation) { super(body, animation); + initUuid(); } public Bullet(Solid3D body, Animation3D animation) { super(body, animation); + initUuid(); } public void initUuid() { - if (uuid.equals("")) { + if (uuid == null || uuid.equals("")) { uuid = UUID.randomUUID().toString(); } } diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/OwnBullets.java b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/OwnBullets.java index cb6c02a..f007dbb 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/OwnBullets.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/OwnBullets.java @@ -53,14 +53,14 @@ e.printStackTrace(); } Bullet b = new Bullet(pochaBody, null); -// b.setPosition(pos); -// -// Vector3d v = new Vector3d(1.f, 0, 0); -// v = v.rotate(angle); -// b.setVelocity(new Velocity3D(v)); -// bullets.add(b); -// universe.place(b); -// cactusModels.addModel(b); + b.setPosition(pos); + + Vector3d v = new Vector3d(1.f, 0, 0); + v = v.rotate(angle); + b.setVelocity(new Velocity3D(v)); + bullets.add(b); + universe.place(b); + cactusModels.addModel(b); } public void sendDeleteBulletForServer(Bullet bullet) {