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

Last change on this file since 86 was 86, checked in by psniegowski, 11 years ago

HIGHLIGHTS:

  • use java annotations to mark classes and fields to be used when:
    • using java classes with ReflectionAccess? to represent remote objects with FramsClass? description found by "info ..." requests
    • to build up FramsClass? representation of objects not present at remote server
  • allow using primitive types (instead of wraping counterparts) in reflected classes
  • rework FramsClass? creation process (add FramsClassBuilder?)
  • add more tests

CHANGELOG:
Prepare model.World class.

Minor change.

Use primitive types for Genotype and Creature classes.

Use primitive types in model.Neuro* classes.

Use primitive types in model.Joint* classes.

Use primitive types in model.Part* classes.

Fix primitive values.

Extract FramsClassBuilder?.

Add tests of Model classes.

More fixes.

Refactorize out ParamCandidate?.

Several fixes.

Fix all regressions after introducing annotations.

Use annotations throughout the project.

Add exception classes.

Improve creation of FramsClass?.

More changes.

Many changes regarding annotations.

Annotate classes in com.framsticks.model package.

Remove manual FramsClass? constructor.

Construct FramsClass? for Creature. Add test.

Add default values to the ParamAnnotation?.

Add ParamBuilderTest? and ParamAnnotation?.

Add FramsClassAnnotation?.

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.