Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


drwbns

Member Since 14 Apr 2011
Offline Last Active Oct 04 2012 08:39 PM

Topics I've Started

how to handle character to vehicle controls?

04 October 2012 - 08:32 PM

Hi guys, I was wondering how to structure classes that can handle player movement but also allow to switch to vehicle movements. I found a post here that looks correct, but it's left me baffled as a novice. Any further explanations to this system?

http://www.ogre3d.org/forums/viewtopic.php?f=10&t=70229#p458355

glext.h - unresolved symbols

03 August 2012 - 08:32 PM

Hey guys, I'm trying to use some functions from glext.h, but which lib should I link to fix the error -

error LNK2001: unresolved external symbol _glLoadProgramNV@16

Adding sprint ability - how?

02 May 2011 - 12:08 PM

How would I add a sprinting ability when Right Shift is held to the following code? Thanks for any help!

void InputController::injectKeyboardState(OIS::Keyboard* mKeyboard)
{
 //camera
 float walk = 0,strafe = 0, up = 0, sprint = 0;

 if (mKeyboard->isKeyDown(OIS::KC_A))
 {
  strafe = -1;
 }
 else if (mKeyboard->isKeyDown(OIS::KC_D))
 {
  strafe = 1;
 }
 if (mKeyboard->isKeyDown(OIS::KC_W))
 {
  walk = -1;
 }
 else if (mKeyboard->isKeyDown(OIS::KC_S))
 {
  walk = 1;
 }
 if (mKeyboard->isKeyDown(OIS::KC_PGUP))
 {
  up = 1;
 }
 else if (mKeyboard->isKeyDown(OIS::KC_PGDOWN))
 {
  up = -1;
 }

 GST->GetCurrentCam()->UpdateLocation(walk, strafe, up);

 //player
 walk = 0, strafe = 0, sprint = 0;

 if (mKeyboard->isKeyDown(OIS::KC_UP))
 {
  walk = 1;
 }
 else if (mKeyboard->isKeyDown(OIS::KC_DOWN))
 {
  walk = -1;
 }
 if (mKeyboard->isKeyDown(OIS::KC_LEFT))
 { 
  strafe = 1;
 }
 else if (mKeyboard->isKeyDown(OIS::KC_RIGHT))
 {
  strafe = -1;
 }

 if (walk != 0 || strafe != 0)
 {
  Quaternion q = TPCAM->GetRotation().Inverse();
  Ogre::Vector3 send(walk,0,strafe);
  send = q * send;
  PLAYER->orderMove(send.x,send.z);
 }
}

I tried this - but it didn't do anything. :( help please.

void InputController::injectKeyboardState(OIS::Keyboard* mKeyboard)
{
 //camera
 float walk = 0,strafe = 0, up = 0, sprint = 0;

 if (mKeyboard->isKeyDown(OIS::KC_A))
 {
  strafe = -1;
 }
 else if (mKeyboard->isKeyDown(OIS::KC_D))
 {
  strafe = 1;
 }
 if (mKeyboard->isKeyDown(OIS::KC_W))
 {
  walk = -1;
 }
 else if (mKeyboard->isKeyDown(OIS::KC_S))
 {
  walk = 1;
 }
 if (mKeyboard->isKeyDown(OIS::KC_PGUP))
 {
  up = 1;
 }
 else if (mKeyboard->isKeyDown(OIS::KC_PGDOWN))
 {
  up = -1;
 }

 GST->GetCurrentCam()->UpdateLocation(walk, strafe, up);

 //player
 walk = 0, strafe = 0, sprint = 0;

 if (mKeyboard->isKeyDown(OIS::KC_UP))
 {
  if (mKeyboard->isKeyDown(OIS::KC_RSHIFT)) {
   sprint = 1;
   walk = sprint + 1;
  }
  else {walk = 1;}
 }
 else if (mKeyboard->isKeyDown(OIS::KC_DOWN))
 {
  if (mKeyboard->isKeyDown(OIS::KC_RSHIFT)) 
  {
   sprint = -1;
   walk = sprint -1;
  }
  else {walk = -1;}
 }
 if (mKeyboard->isKeyDown(OIS::KC_LEFT))
 {
  if (mKeyboard->isKeyDown(OIS::KC_RSHIFT)) {
   sprint = 1;
  strafe = sprint + 1;
  }
  else { strafe = 1;}
 }
 else if (mKeyboard->isKeyDown(OIS::KC_RIGHT))
 {
  if (mKeyboard->isKeyDown(OIS::KC_RSHIFT)) {
   sprint = -1;
  strafe = sprint -1;
  }
  else { strafe = -1; }
 }

 if (walk != 0 || strafe != 0)
 {
  Quaternion q = TPCAM->GetRotation().Inverse();
  Ogre::Vector3 send(walk,0,strafe);
  send = q * send;
  PLAYER->orderMove(send.x,send.z);
 }
}

Unhandled exception - Basic AI demo

14 April 2011 - 12:16 PM

I have a thread already started at the link below.I'm getting a bad initialized variable and I don't know why. I didn't write the code, it's ogre code but a user written Game. Thanks for any help.

http://www.ogre3d.org/forums/viewtopic.php?f=2&t=64221

PARTNERS