Newer
Older
CactusServer / src / main / java / cactusServer / entities / Object.java
package cactusServer.entities;

import java.util.HashMap;

import framework.model3D.Position3D;
import framework.physics.AngularVelocity3D;
import framework.physics.Velocity3D;

public class Object extends Entity{
	private Position3D position;
	private Velocity3D velocity;
	private AngularVelocity3D angularVelocity;
	private Angle angle;
	private Attribute attribute;
	private ObjectModel model;

	private Object() {
		// JSONDecode時の呼び出し用
	}
	
	public Object(Position3D position, Velocity3D velocity, AngularVelocity3D angularVelocity, Angle angle, Attribute attribute, ObjectModel model) {
		setPosition(position);
		setVelocity(velocity);
		setAngularVelocity(angularVelocity);
		setAngle(angle);
		setAttribute(attribute);
		setModel(model);
	}
	
	public Position3D getPosition() {
		return position;
	}
	
	public Velocity3D getVelocity() {
		return velocity;
	}
	
	public AngularVelocity3D getAngularVelocity() {
		return angularVelocity;
	}
	
	public Angle getAngle() {
		return angle;
	}

	public Attribute getAttribute() {
		return attribute;
	}

	public ObjectModel getModel() {
		return model;
	}
	
	public void setPosition(Position3D position) {
		this.position = position;
	}
	
	public void setVelocity(Velocity3D velocity) {
		this.velocity = velocity;
	}
	
	public void setAngularVelocity(AngularVelocity3D angularVelocity) {
		this.angularVelocity = angularVelocity;
	}
	
	public void setAngle(Angle angle) {
		this.angle = angle;
	}

	public void setAttribute(Attribute attribute) {
		this.attribute = attribute;
	}

	public void setModel(ObjectModel model) {
		this.model = model;
	}
	
	public static class Attribute {
		private boolean moveable; // 可動
		private double cof; // 摩擦係数
		
		public Attribute(boolean moveable, double cof) {
			setMoveable(moveable);
			setCof(cof);
		}
		
		public boolean isMoveable() {
			return moveable;
		}
		
		public double getCof() {
			return cof;
		}
		
		public void setMoveable(boolean moveable) {
			this.moveable = moveable;
		}

		public void setCof(double cof) {
			this.cof = cof;
		}
	}
}