Ignore:
Timestamp:
01/09/13 00:09:10 (11 years ago)
Author:
psniegowski
Message:

Add f0 parsing and f0->Model transformation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/model/Creature.java

    r77 r78  
    11package com.framsticks.model;
    22
    3 import com.framsticks.model.MechPart;
    4 import com.framsticks.model.Joint;
     3import com.framsticks.params.FramsClass;
     4import com.framsticks.util.Orientation;
    55import com.framsticks.util.Point3d;
    66
     
    88import java.util.List;
    99
    10 public class Creature {
     10public class Creature extends F0Model {
    1111        public String name;
    1212
     
    9494        public void setVertpos(Double c_vertpos) { averageVerticalPosition = c_vertpos; }
    9595
    96         public Point3d position = new Point3d();
     96        /** pos_x, pos_y, pos_z*/
     97        public double pos_x, pos_y, pos_z;
    9798
    98         public Double getPos_x() { return position.x; }
    99         public void setPos_x(Double pos_x) { position.x = pos_x; }
     99        public Point3d getPosition() { return new Point3d(pos_x, pos_y, pos_z) ; }
     100        public void setPosition(Point3d pos) { pos_x = pos.x; pos_y = pos.y; pos_z = pos.z; }
    100101
    101         public Double getPos_y() { return position.y; }
    102         public void setPos_y(Double pos_y) { position.y = pos_y; }
     102        public double size_x, size_y, size_z;
    103103
    104         public Double getPos_z() { return position.z; }
    105         public void setPos_z(Double pos_z) { position.z = pos_z; }
     104        public Point3d getBoundingBox() { return new Point3d(size_x, size_y, size_z) ; }
     105        public void setBoundingBox(Point3d size) { size_x = size.x; size_y = size.y; size_z = size.z; }
    106106
    107         public Point3d boundingBox = new Point3d();
    108         public Double getSize_x() { return boundingBox.x; }
    109         public void setSize_x(Double size_x) { boundingBox.x = size_x; }
    110107
    111         public Double getSize_y() { return boundingBox.y; }
    112         public void setSize_y(Double size_y) { boundingBox.y = size_y; }
     108        /** center_x, center_y, center_z*/
     109        public double center_x, center_y, center_z;
    113110
    114         public Double getSize_z() { return boundingBox.z; }
    115         public void setSize_z(Double size_z) { boundingBox.z = size_z; }
    116 
    117         public Point3d center = new Point3d();
    118 
    119         public Double getCenter_x() { return center.x; }
    120         public void setCenter_x(Double center_x) { center.x = center_x; }
    121 
    122         public Double getCenter_y() { return center.y; }
    123         public void setCenter_y(Double center_y) { center.y = center_y; }
    124 
    125         public Double getCenter_z() { return center.z; }
    126         public void setCenter_z(Double center_z) { center.z = center_z; }
     111        public Point3d getCenter() { return new Point3d(center_x, center_y, center_z) ; }
     112        public void setCenter(Point3d center) { center_x = center.x; center_y = center.y; center_z = center.z; }
    127113
    128114        public Integer getNumparts() { return parts.size(); }
     
    161147        public final List<NeuroDef> neurodefs = new ArrayList<NeuroDef>();
    162148
    163         public final List<MechPart> mechparts = new ArrayList<MechPart>();
    164         public final List<MechJoint> mechjoints = new ArrayList<MechJoint>();
    165         public final List<Neuro> neurons = new ArrayList<Neuro>();
     149
     150
     151        public final List<Part> getParts() { return parts; }
     152        public final List<Joint> getJoints() { return joints; }
     153        public final List<NeuroDef> getNeuroDefs() { return neurodefs; }
    166154
    167155
    168156
     157        public static void constructFramsClass(FramsClass.Constructor constructor) {
     158                constructor.field("name");
     159                constructor.field("parts");
     160                constructor.field("joints");
     161                constructor.field("neurodefs");
     162        }
     163
    169164}
Note: See TracChangeset for help on using the changeset viewer.