diff --git a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Object.java b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Object.java index 334e414..f0f40f8 100644 --- a/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Object.java +++ b/app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Object.java @@ -32,17 +32,17 @@ // JSONDecode時の呼び出し用 } - public Object(Position3D position, Velocity3D velocity, AngularVelocity3D angularVelocity, Quaternion3D angle, - Attribute attribute, int modelID) { + public Object(Position3D position, Velocity3D velocity, AngularVelocity3D angularVelocity, + Quaternion3D angle, Attribute attribute, int modelID) { + setPrim(new Box()); + setObject(new Object3D("", prim)); + setPlaceable(object); setPosition(position); setVelocity(velocity); setAngularVelocity(angularVelocity); setAngle(angle); setAttribute(attribute); setModel(modelID); - setPrim(new Box()); - setObject(new Object3D("", prim)); - setPlaceable(object); } public Position3D getPosition() { @@ -71,6 +71,7 @@ public void setPosition(Position3D position) { this.position = position; + ((Object3D)(getPlaceable().getBody())).setPosition(position); } public void setVelocity(Velocity3D velocity) { @@ -83,6 +84,7 @@ public void setAngle(Quaternion3D angle) { this.angle = angle; + ((Object3D) getPlaceable().getBody()).apply(angle, false); } public void setAttribute(Attribute attribute) { @@ -135,12 +137,11 @@ @JSONHint(ignore = true) public Object3D getObject() { - return object; + return (Object3D) getPlaceable().getBody(); } public void setObject(Object3D object) { this.object = object; } - } \ No newline at end of file