source: java/main/src/main/java/com/framsticks/model/BaseJoint.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 851 bytes
Line 
1package com.framsticks.model;
2
3import com.framsticks.params.annotations.ParamAnnotation;
4import com.framsticks.util.math.Point3d;
5
6/**
7 * Author: Piotr Śniegowski
8 */
9public class BaseJoint {
10
11        @ParamAnnotation(id = "stif")
12        public double stiffness;
13
14        @ParamAnnotation(id = "rotstif")
15        public double rotationStiffness;
16
17        @ParamAnnotation
18        public double rx, ry, rz;
19
20        public Point3d getRotation() { return new Point3d(rx, ry, rz); }
21        public void setRotation(Point3d r) { rx = r.x; ry = r.y; rz = r.z; }
22
23        @ParamAnnotation
24        public double dx, dy, dz;
25
26        public Point3d getDelta() { return new Point3d(dx, dy, dz); }
27        public void setDelta(Point3d d) { dx = d.x; dy = d.y; dz = d.z; }
28
29        public void copyFrom(BaseJoint j) {
30                stiffness = j.stiffness;
31                rotationStiffness = j.rotationStiffness;
32                setRotation(j.getRotation());
33                setDelta(j.getDelta());
34        }
35}
Note: See TracBrowser for help on using the repository browser.