diff --git a/src/main/java/cactusServer/entities/Bullet.java b/src/main/java/cactusServer/entities/Bullet.java index 5c236cf..021c408 100644 --- a/src/main/java/cactusServer/entities/Bullet.java +++ b/src/main/java/cactusServer/entities/Bullet.java @@ -3,11 +3,8 @@ import org.ntlab.radishforandroidstudio.framework.model3D.Object3D; import org.ntlab.radishforandroidstudio.framework.model3D.Position3D; import org.ntlab.radishforandroidstudio.framework.model3D.Quaternion3D; -import org.ntlab.radishforandroidstudio.java3d.Box; -import org.ntlab.radishforandroidstudio.java3d.Primitive; import cactusServer.models.BulletModelManager; -import cactusServer.models.CharacterModelManager; public class Bullet extends Entity3D { private String playerID; @@ -19,11 +16,11 @@ } public Bullet(String playerID, Position3D position, Quaternion3D angle) { - this.playerID = playerID; - this.position = position; - this.angle = angle; Object3D body = BulletModelManager.getInstance().getBulletModel(0).createObject(); // ���f��ID�͉���0���w�� setPlaceable(body); + setPlayerID(playerID); + setPosition(position); + setAngle(angle); } public String getPlayerID() { @@ -42,12 +39,18 @@ this.playerID = playerID; } - public void setPosition(Position3D positon) { - this.position = positon; + public void setPosition(Position3D position) { + this.position = position; + if (this.placeable != null) { + ((Object3D)this.placeable.getBody()).setPosition(position); + } } public void setAngle(Quaternion3D angle) { this.angle = angle; + if (this.placeable != null) { + ((Object3D)this.placeable.getBody()).apply(angle, false); + } } public void update(Position3D position, Quaternion3D angle) {