持ってきただけ
1 parent 72b1f39 commit 6206521267492f72e8004ec980405c36daa3e4cb
n-konishi authored on 23 Oct 2018
Showing 3 changed files
View
.idea/caches/build_file_checksums.ser
Not supported
View
62
app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/Object.java
package org.ntlab.radishforandroidstudio.cactusClient.models;
 
import org.ntlab.radishforandroidstudio.framework.model3D.Model3D;
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.framework.physics.AngularVelocity3D;
import org.ntlab.radishforandroidstudio.framework.physics.Velocity3D;
import org.ntlab.radishforandroidstudio.java3d.Box;
import org.ntlab.radishforandroidstudio.java3d.Primitive;
 
//import framework.model3D.Position3D;
//import framework.physics.AngularVelocity3D;
//import framework.physics.Velocity3D;
private Velocity3D velocity;
private AngularVelocity3D angularVelocity;
private Quaternion3D angle;
private Attribute attribute;
private String model;
private Model3D model;
private Primitive prim;
private Object3D object;
 
@JSONHint(ignore = true)
public static final int UNIQUE_ID_LENGTH = 12;
 
// JSONDecode時の呼び出し用
}
 
public Object(Position3D position, Velocity3D velocity, AngularVelocity3D angularVelocity, Quaternion3D angle,
Attribute attribute, String model) {
Attribute attribute, int modelID) {
setPosition(position);
setVelocity(velocity);
setAngularVelocity(angularVelocity);
setAngle(angle);
setAttribute(attribute);
setModel(model);
setModel(modelID);
setPrim(new Box());
setObject(new Object3D("", prim));
setPlaceable(object);
}
 
public Position3D getPosition() {
return position;
public Attribute getAttribute() {
return attribute;
}
 
public String getModel() {
public Model3D getModel() {
return model;
}
 
public void setPosition(Position3D position) {
public void setAttribute(Attribute attribute) {
this.attribute = attribute;
}
 
public void setModel(String model) {
this.model = model;
public void setModel(int modelID) {
// this.model = ObjectModelManager.getInstance().getObject(modelID);
}
 
public static class Attribute {
private boolean moveable; // 可動
private boolean movable; // 可動
private double cof; // 摩擦係数
 
@SuppressWarnings("unused")
private Attribute() {
 
}
 
public Attribute(boolean moveable, double cof) {
setMoveable(moveable);
setMovable(moveable);
setCof(cof);
}
 
public boolean isMoveable() {
return moveable;
public boolean isMovable() {
return movable;
}
 
public double getCof() {
return cof;
}
 
public void setMoveable(boolean moveable) {
this.moveable = moveable;
public void setMovable(boolean moveable) {
this.movable = moveable;
}
 
public void setCof(double cof) {
this.cof = cof;
}
}
 
@JSONHint(ignore = true)
public Primitive getPrim() {
return prim;
}
 
public void setPrim(Primitive prim) {
this.prim = prim;
}
 
@JSONHint(ignore = true)
public Object3D getObject() {
return object;
}
 
public void setObject(Object3D object) {
this.object = object;
}
 
 
}
View
43
app/src/main/java/org/ntlab/radishforandroidstudio/cactusClient/models/ObjectModelManager.java 0 → 100644
package org.ntlab.radishforandroidstudio.cactusClient.models;
 
import org.ntlab.radishforandroidstudio.framework.model3D.Model3D;
import org.ntlab.radishforandroidstudio.framework.model3D.ModelFactory;
import org.ntlab.radishforandroidstudio.framework.model3D.ModelFileFormatException;
 
import java.io.IOException;
import java.util.HashMap;
 
class ObjectModelManager {
//
// private static ObjectModelManager theInstance = null;
// private HashMap<Integer, Model3D> model = new HashMap<>();
//
// private ObjectModelManager() {
// try {
// setObject(0, ModelFactory.loadModel(getClass().getResource("../../pocha.stl").getPath()));
// setObject(1, ModelFactory.loadModel(getClass().getResource("../../pocha.stl").getPath()));
// } catch (IOException | ModelFileFormatException e) {
// e.printStackTrace();
// }
// }
//
// public static ObjectModelManager getInstance() {
// if (theInstance == null) {
// theInstance = new ObjectModelManager();
// }
// return theInstance;
// }
//
// public void setObject(int key, Model3D loadModel) {
// model.put(key, loadModel);
// }
//
// public Model3D getObject(int objectID) {
// return model.get(objectID);
// }
//
// public int getObjectModelCount() {
// return model.size();
// }
}