See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: Continuous Rotation of Animation in Dialogue box  (Read 3148 times)

0 Members and 1 Guest are viewing this topic.

Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
21 November 2014, 15:04:14
Hoping someone can help me here.  For my SkylabII and flexcraft , Pod2001,.... there are joints in the RMS that can rotate 360 degrees.  I know normal animation goes from 0-1.  Outside of a dialogue box I can have code like if animation proc >1 then it is 0 and <0 then 1.  So the joint can go around with out stopping.

BUT Not sure how to add that in the dialogue box.  This is what i have:

Code: [Select]
if (SendDlgItemMessage(hWnd, IDC_JOINT2UP, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->JOINT2_proc = max(0.0, sts->JOINT2_proc - (t1 - t0)*ARM_OPERATING_SPEED);
sts->SetAnimationArm(sts->anim_JOINT2, sts->JOINT2_proc);

if (SendDlgItemMessage(hWnd, IDC_JOINT2DOWN, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->JOINT2_proc = min(1.0, sts->JOINT2_proc + (t1 - t0)*ARM_OPERATING_SPEED);

sts->SetAnimationArm(sts->anim_JOINT2, sts->JOINT2_proc);


Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
Reply #1 - 24 November 2014, 12:49:38
This is what I have tried with no success:
Code: [Select]
if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWRIGHT, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->ARM1_proc = min(1.1, sts->ARM1_proc + (t1 - t0)*ARM_OPERATING_SPEED);
sts->SetAnimationArm(sts->anim_ARM1, sts->ARM1_proc);
}
else if (SendDlgItemMessage(hWnd, IDC_SHOULDER_YAWLEFT, BM_GETSTATE, 0, 0) & BST_PUSHED) {
sts->ARM1_proc = max(-.1, sts->ARM1_proc - (t1 - t0)*ARM_OPERATING_SPEED);
sts->SetAnimationArm(sts->anim_ARM1, sts->ARM1_proc);
}
if (ARM1_proc > 1) ARM1_proc = 0;
if (ARM1_proc < 0) ARM1_proc = 1;
and I get this:
Error   6   error C2065: 'ARM1_proc' : undeclared identifier   E:\orbiter2010p1A\Orbitersdk\samples\SKYLAB2SCAFFOLD\SKYLAB2SCAFFOLD.CPP   771   1   SKYLAB2SCAFFOLD


With out this on a rms arm you have limits.  But some joints like a ball joint have no limits


Offline David413

  • Full Member
  • ***
  • Posts: 129
  • Karma: 8
Reply #2 - 24 November 2014, 18:44:07
In your two lines at the end that are checking the values of ARM1_proc,

   
Code: [Select]
                 if (ARM1_proc > 1) ARM1_proc = 0;
         if (ARM1_proc < 0) ARM1_proc = 1;

try preceding ARM1_proc with the "sts->" like they are earlier in the code:

   
Code: [Select]
                 if (sts->ARM1_proc > 1)sts-> ARM1_proc = 0;
         if (sts->ARM1_proc < 0)sts->ARM1_proc = 1;


Offline gattico

  • Sr. Member
  • ****
  • Posts: 337
  • Country: United States us
  • Karma: 15
Reply #3 - 25 November 2014, 00:52:32
THANKS.  THAT worked


Offline David413

  • Full Member
  • ***
  • Posts: 129
  • Karma: 8
Reply #4 - 25 November 2014, 02:09:36
 :beer: