| |||||||||
|
|
| |||||||
|
| ||||||||
| |||||||||
#include "vg.h" // Required for the standard Vega classes
int setVegaObjectHPR( vgObject *object, const float h, const float p, const float r){
// ################################################################## // # Public function // # // # Function shows how to set the H P R of a vgObject // # // # returns VG_SUCCESS if the Object can be positioned // # // # otherwise returns VG_FAILURE // # // ################################################################## vgPosition *pos = NULL; int result = VG_FAILURE;
// // Sanity check we need a vgObject // if( object == NULL ) return VG_FAILURE;
// // Retrieve the coord type of the object // int cstype = vgGetProp ( object, VGOBJ_CS );
// // If the object is a Static we cannot position it // if( cstype == VGPOBJ_STATIC ) return VG_FAILURE;
// // Create a vgPos // pos = vgNewPos(); if( pos == NULL ) return VG_FAILURE;
double d = 0.0, x = 0.0, y = 0.0, z = 0.0;
// // Retrieve the current XYZ as we are only adjusting the HPR // vgGetPos( object, pos );
vgGetPosVec( pos, &x, &y, &z, &d, &d, &d );
// // Set the vgPos to the passed in HPR coordinates // vgPosVec( pos, x, y, z, h, p, r );
// // Set position of the object // vgPos( object, pos );
// // Release the vgPos as where done // vgDelPos( pos);
return VG_SUCCESS;
} // setVegaObjectsHPR
| ||
© Copyright 2004 Gordon Tomlinson All Rights Reserved. All logos, trademarks and copyrights in this site are property of their respective owner. |