void Camera3::Update(double dt, bool* myKeys) {/* Vector3 view = (target - position).Normalized(); Vector3 right = view.Cross(up); right.y = 0; Inertia: instant dir change * strafe */ if(myKeys[KEY_A] && !myKeys[KEY_D]) Strafe(-dt); else if(straftMovingLeft) DecelerateLeft(-dt); if(myKeys[KEY_D] && !myKeys[KEY_A]) Strafe(dt); else if(straftMovingRight) DecelerateRight(dt); /* walk */ if(myKeys[KEY_W] && !myKeys[KEY_S]) Walk(dt); else if(walkMovingForward) DecelerateForward(dt); if(myKeys[KEY_S] && !myKeys[KEY_W]) Walk(-dt); else if(walkMovingBackward) DecelerateBackward(-dt); if(myKeys[KEY_C] && !croutching) croutching = true; croutch(dt); /* fly */ if(myKeys[KEY_K]) Fly(dt); if(myKeys[KEY_L]) Fly(-dt); if(myKeys[KEY_SPACE] && !jump) //com runs too fast, spacebar 2 times setJump(dt); if(myKeys[KEY_T]) //reset { Reset(); } /** update jump **/ if(jump) Jump(dt); /** mouse **/ Yaw(dt); Pitch(dt); }
int main(int argc, char *argv[]) { setJump(); if (argc > 1) recur(2); doJump(); printf("Back at main\n"); exit(EXIT_SUCCESS); }
//================================================================================ // 幼女表情パターンセット処理 //================================================================================ void CharacterStatus::setPattern(CHARACTERSTATUS_PATTERN pattern) { if (pattern >= CHARACTERSTATUS_PATTERN_MAX || pattern < 0) { return; } if(m_bGiddy == true) { return; } m_pSprite->setTexture(IMAGE_LIST[pattern]); // 目眩時 if(pattern == CHARACTERSTATUS_PATTERN_GIDDY) { setGiddy(); return; } bool bJump = false; // 目眩をする前の表情と違う場合 if(m_oldPattern != m_pattern) { bJump = true; } m_oldPattern = m_pattern; m_pattern = pattern; if(bJump) { setJump(1.0f,Vec2(0,0),60,2); } }
void ViewpointNode::setJump(int value) { setJump(value ? true : false); }
PlayerInputAbs::PlayerInputAbs(bool l, bool r, bool j) : mFlags( F_RELATIVE ), mTarget(-1) { setLeft(l); setRight(r); setJump(j); }