| |||||||||
|
|
| |||||||
|
| ||||||||
| |||||||||
#include "vg.h" // Required for the standard Vega classes
void switchObvserverToNavigator( const int navIdx ){ // ########################################################## // # Local Function // # // # This functions show how to change from using a Motion // # model to attaching to a vgNavigator // # // # Note that this code assumes the observer is currently // # attached to a motion model // # // ##########################################################
// // We need a pointer to the observer assmume first observer // vgObserver *obs = vgGetObserv(0)
// // Get our Navigator and enable it // vgNavigator *nav = (vgNavigator*) vgGetSplineNavigator( navIdx ); vgProp( nav, VGCOMMON_ENABLED, VG_ON ); vgProp( nav, VGPLYR_SPLINE_NAVIGATOR, VG_ON );
// // Attach the observer to the player and navigator // vgProp( obs, VGCOMMON_ENABLED, VG_ON );
// // The Observer needs to be Fixed Tethered state // vgProp( obs, VGOBS_TETHERSTATE, VGOBS_FIXED );
// // The Observer needs to be relative to a players coords // vgProp( obs, VGOBS_TETHERCOORD, VGOBS_TPLAYER );
// // We need the player for the navigator assume first player // vgPlayer *plyr = vgGetPlyr(0);
// // Associate the navigator with the player // vgPlyrNav( plyr, nav );
// // Associate the Player with the Observer // vgObservPlyr( obs, plyr );
} // switchObvserverToNavigator
void switchObserverMotionModel( const int motIdx ){ // ########################################################## // # Local Function // # // # This functions show how to change from using a vgNavigator // # and attaching to a vgMotion Model // # // # Note that this code assumes the observer is currently // # attached to a vgNavigator // # // ##########################################################
// // We need a pointer to the observer assmume first observer // vgObserver *obs = vgGetObserv(0);
// // Remove the Navigator association with the Observer // vgObservNav( obs, NULL );
// // Remove the Player association with the Observer // vgObservPlyr( obs, NULL );
// // Turn the navigator off , assume we using the first navigator // vgNavigator *nav = (vgNavigator*) vgGetSplineNavigator(0); vgProp( nav, VGCOMMON_ENABLED, VG_OFF ); vgProp( nav, VGPLYR_SPLINE_NAVIGATOR, VG_OFF );
// // Retrieve the motion model and enable it // vgMotion *mot = vgGetMot(motIdx);
vgProp( mot, VGCOMMON_ENABLED, VG_ON );
vgUpdate( mot );
// // Associate the motion model with the observer // vgObservMot( obs, mot );
// // The Observer needs to be relative to the origin // vgProp( obs, VGOBS_TETHERCOORD, VGOBS_TABSOLUTE);
// // The Observer now needs to be Dynamic Tethered state // vgProp( obs, VGOBS_TETHERSTATE, VGOBS_DYNAMIC );
// // Finally enable the Observer // vgProp( obs, VGCOMMON_ENABLED, VG_ON );
} // switchObserverMotionModel
| ||
© Copyright 2004 Gordon Tomlinson All Rights Reserved. All logos, trademarks and copyrights in this site are property of their respective owner. |