Skip to content

Commit

Permalink
Merge pull request #58 from HiVR/rotationFixed
Browse files Browse the repository at this point in the history
Rotation fixed and added tests
  • Loading branch information
keohnoel authored Jun 17, 2016
2 parents be364e3 + fcc50ec commit aa42b2f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions HiVRClient.Test/Model/DrawableModel/DrawableFactoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ public void TestGetPatient()
Assert.That(res.Position.Z, Is.EqualTo(Patient.DefaultPosition.Z + this.vector.Z));

Assert.That(res.Rotation.X, Is.EqualTo(Patient.DefaultRotation.X));
Assert.That(res.Rotation.Y, Is.EqualTo(Patient.DefaultRotation.Y + this.vector.Y));
Assert.That(res.Rotation.Z, Is.EqualTo(Patient.DefaultRotation.Z + this.vector.Z));
Assert.That(res.Rotation.Y, Is.EqualTo(-(Patient.DefaultRotation.Y + this.vector.Y)));
Assert.That(res.Rotation.Z, Is.EqualTo(-(Patient.DefaultRotation.Z + this.vector.Z)));

Assert.That(res.Scale.X, Is.EqualTo(0D));
Assert.That(res.Scale.Y, Is.EqualTo(Patient.DefaultScale.Y));
Expand Down
2 changes: 1 addition & 1 deletion HiVRClient/Model/DrawableModel/DrawableFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public Character GetCharacter(int id, Vector3D position, Vector3D rotation, Vect
public Patient GetPatient(int id, Vector3D position, Vector3D rotation, Vector3D scale)
{
var correctedPosition = this.AddIndividuals(position, Patient.DefaultPosition);
var correctedRotation = this.AddIndividuals(rotation, Patient.DefaultRotation);
var correctedRotation = this.AddIndividuals(-rotation, Patient.DefaultRotation);
var correctedScale = this.MultiplyIndividuals(scale, Patient.DefaultScale);

return new Patient(id, correctedPosition, correctedRotation, correctedScale);
Expand Down
11 changes: 4 additions & 7 deletions HiVRClient/View/DrawableTemplate.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,10 @@
<Path
RenderTransformOrigin="0.5, 0.5">
<Path.Data>
<PathGeometry Figures="m 0 0 c 0.0064 0 0.455156 -0.9104 0.99738605 -1.9933 0.5422309 -1.08279998 0.9907389 -1.97879988 0.9966789 -1.99119988
0.006 0 0.04856 0.052 0.09476 0.148 0.04616 0.092 0.495887 0.98849988 0.999354 1.98889988 0.503475 1.0009 0.911896 1.8224
0.907604 1.826 -0.0044 0 -0.08372 -0.04 -0.176437 -0.084 -0.333074 -0.1801 -0.792846 -0.3402 -1.161255 -0.4078 -0.199117
-0.04 -0.764611 -0.052 -0.983123 -0.04 -0.5270229 0.06 -1.09153295 0.2481 -1.63739095 0.5386 -0.04179999911 0.04 -0.0474
0.04 -0.0376 0 z"
FillRule="NonZero" />
</Path.Data>
<PathGeometry
Figures="m 0 0 c 0.0064 0 0.4551556 1.08135123 0.99738562 2.36759383 0.542231 1.2861238 0.990739 2.3503704 0.996679 2.3650989 0.006 0 0.04856 -0.061764 0.09476 -0.1757909 0.04616 -0.1092754 0.495887 -1.1741159 0.999354 -2.362367 0.503475 -1.1888449 0.911896 -2.16460293 0.907604 -2.16887883 -0.0044 0 -0.08372 0.047511 -0.176437 0.099773 -0.333074 0.2139185 -0.792846 0.4040814 -1.161255 0.4843751 -0.199117 0.047511 -0.764611 0.061764 -0.983123 0.047511 -0.527023 -0.071267 -1.09153302 -0.2946872 -1.63739062 -0.6397361 -0.0418 -0.047511 -0.0474 -0.047511 -0.0376 0 z"
FillRule="NonZero" />
</Path.Data>
<Path.Style>
<Style
TargetType="Path">
Expand Down

0 comments on commit aa42b2f

Please sign in to comment.