home *** CD-ROM | disk | FTP | other *** search
Wrap
Attribute VB_Name = "TsxApi" '------------------------------------------------------------------------------ ' VbTsxApi ' v1.5 - 01/11/98 ' ' VB5 Declarations for TsxAPI 3.1 ' '------------------------------------------------------------------------------ '------------------------------------------------------------------------------ '// File: tsxTypes.h '// Descr: Basic data types used in most places '// Return type for functions that test a condition. Enum tsxBool e_tsxFALSE = 0 e_tsxTRUE End Enum '// Return type for functions that simply report success or failure. Enum tsxRET e_tsxFAILURE = 0 e_tsxSUCCESS End Enum '// Return type for functions that return an error code when they fail. '// These are documented in "tsxErr.h". 'typedef int tsxERR; '// Geometry '// Reference Frames: World or Model Enum tsxFRAMEID e_tsxWorldFrame e_tsxModelFrame End Enum '// Specifying Vectors and Points Type CtsxVector2f x As Single y As Single End Type Type CtsxVector3f x As Single y As Single z As Single End Type '// Specifying axes. Type CtsxAxes3f xAxis As CtsxVector3f '//Unit vector specifying orientation of Model's X axis. yaxis As CtsxVector3f '// ... Y ... zAxis As CtsxVector3f '// ... Z ... End Type '// Transformation Matrix. Type CtsxTxmx3f matrix(0 To 3, 0 To 2) As Single End Type '// Bounding Box. Type CtsxBBox3f minbounds As CtsxVector3f maxbounds As CtsxVector3f End Type '// For specifying color, e.g. in a material or for a vertex. Type CtsxColor red As Byte green As Byte blue As Byte alpha As Byte End Type '// For specifying UV-space coordinates of a vertex. Type CtsxUV u As Single v As Single End Type '// Object types in a scene. Enum tsxSOBJTYPE e_tsxUNDEFINED = 0 '//Not a TSX-supported SOBJ type '// SOBJ types e_tsxMATERIAL = 1 e_tsxSCENE e_tsxPLUGIN_FILTER e_tsxPHYS_WIND e_tsxMATRECT '// Selectable objects e_tsxSELECTABLE = 50 '//(Not a legal SOBJ type) e_tsxAXES '// GNODE types e_tsxGNODETYPES = 100 '//(Not a legal SOBJ type) e_tsxCAMERA e_tsxLIGHT e_tsxJOINT e_tsxNAIL e_tsxLATTICE e_tsxPATH '// MNODE types e_tsxMNODETYPES = 200 '//(Not a legal SOBJ type) e_tsxPOLYHEDRON e_tsxGROUP e_tsxLODGROUP '//Levels of Detail e_tsxMBALLOBJ '//Object with meta-balls '// e_tsxOPARTICLE e_tsxSADEF '// Free-standing deformation e_tsxIKGROUP '//Object with joints (Inverse Kinematics) e_tsxSOBJEND '//(Not a legal SOBJ type) End Enum '------------------------------------------------------------------------------ '// File: tsxErr.h '// Descr: TSX Error Codes #Const tsxERR_SUCCESS = 0 '// Defined Error Codes #Const tsxERR_NOGOOD = -1 '// something generally went wrong #Const tsxERR_NO_MEMORY = -2 '// no memory available #Const tsxERR_NULL_REF = -3 '// null pointer reference #Const tsxERR_BAD_INPUT = -4 '// bad input data #Const tsxERR_FORMAT = -5 '// general bad data format #Const tsxERR_ABORT = -8 '// user abort request #Const tsxERR_REPORTED = -10 '// still an error but was reported below #Const tsxERR_UNIMPL = -11 '// feature unimplemented #Const tsxERR_IDENTIFIER = -12 '// bad identifier on data or record #Const tsxERR_VERSION = -13 '// Correct file type but wrong version #Const tsxERR_NOT_FOUND = -14 '// object not found #Const tsxERR_OVERFLOW = -15 '// data overflow for size of result #Const tsxERR_RANGE = -16 '// value out of range #Const tsxERR_INIT = -18 '// subsystem improperly initialized '// system errors #Const tsxERR_SYSERR_BASE = -50 #Const tsxERR_STDIO = (tsxERR_SYSERR_BASE - 0) '// error occurred in io #Const tsxERR_MSWIN = (tsxERR_SYSERR_BASE - 1) '// error occurred in windows '------------------------------------------------------------------------------ '// File: tsxGeom.h '// Descr: Basic geometric manipulation in 2D and 3D. #Const M_PI = 3.14159265359 '// 180/pi #Const tsxRAD2DEG_FAC = 57.29577951308 '// pi/180 #Const tsxDEG2RAD_FAC = 0.01745329251994 '// |vect| Declare Function tsxMagnitude3f Lib "tsxapi.dll" (ByRef vec As CtsxVector3f) As Single Declare Function tsxMagnitude2f Lib "tsxapi.dll" (ByRef vec As CtsxVector2f) As Single '// Normalizing ... returns the length of the original vector `vec'. Declare Function tsxNormalize3f Lib "tsxapi.dll" (ByRef vec As CtsxVector3f) As Single Declare Function tsxNormalize2f Lib "tsxapi.dll" (ByRef vec As CtsxVector2f) As Single '// norm = vec/|vec| Declare Function tsxGetNormalized3f Lib "tsxapi.dll" (ByRef norm As CtsxVector3f, ByRef vec As CtsxVector3f) As Single Declare Function tsxGetNormalized2f Lib "tsxapi.dll" (ByRef norm As CtsxVector2f, ByRef vec As CtsxVector2f) As Single '// Scalar-Vector arithmetic ... `vec' is modified and returned '// vec = vec + s Declare Function tsxAddScalar3f Lib "tsxapi.dll" (ByRef vec As CtsxVector2f, s As Single) As Variant '// vec = vec * s Declare Function tsxMulScalar3f Lib "tsxapi.dll" (ByRef vec As CtsxVector2f, s As Single) As Variant '// Vector-Vector arithmetic ... Vector `u' is modified and returned '// u = u + v Declare Function tsxAddVec3f Lib "tsxapi.dll" (ByRef u As CtsxVector3f, ByRef v As CtsxVector3f) As Variant '// u = u - v Declare Function tsxSubVec3f Lib "tsxapi.dll" (ByRef u As CtsxVector3f, ByRef v As CtsxVector3f) As Variant '// Vector Multiplication '// u . v ... Dot Product Declare Function tsxDProdVec3f Lib "tsxapi.dll" (ByRef u As CtsxVector3f, ByRef v As CtsxVector3f) As Single '// uxv = u x v ... Cross Product Declare Function tsxXProdVec3f Lib "tsxapi.dll" (ByRef uxv As CtsxVector3f, ByRef u As CtsxVector3f, ByRef v As CtsxVector3f) As Variant '// Returns Signed angle from vector `u' to `v' about the axis `axis'. '// `axis' gets the (unnormalized) cross-product (axis = u x v). Angle in radians. Declare Function tsxAngleBtwVecs3f Lib "tsxapi.dll" (ByRef u As CtsxVector3f, ByRef v As CtsxVector3f, ByRef axis As CtsxVector3f) As Single '// Distance between 2 points `p', `q'. Declare Function tsxDistanceToPoint3f Lib "tsxapi.dll" (ByRef p As CtsxVector3f, ByRef q As CtsxVector3f) As Single '// Distance from a point `p' to a line containing point `line_point' and '// with unit direction vector `line_unitvec'. Declare Function tsxDistanceToLine3f Lib "tsxapi.dll" (ByRef p As CtsxVector3f, ByRef line_point As CtsxVector3f, ByRef line_unitvec As CtsxVector3f) As Single '// Distance from a Point `p' to a Plane with normal `plane_norm' and '// containing Point `plane_point'. This distance is positive only if '// `plane_norm' points towards `p'. Declare Function tsxDistanceToPlane3f Lib "tsxapi.dll" (ByRef p As CtsxVector3f, ByRef plane_norm As CtsxVector3f, ByRef plane_point As CtsxVector3f) As Single '// A = B x C ... Matrix Multiplication. '// A may be the same as B or C. Declare Function tsxXProdMx3f Lib "tsxapi.dll" (ByRef A As CtsxTxmx3f, ByRef B As CtsxTxmx3f, ByRef C As CtsxTxmx3f) As Variant '// Minv = Inverse(M) ... Matrix Inverse '// Returns e_tsxFAILURE if result is not reliable. Declare Function tsxInvertMx3f Lib "tsxapi.dll" (ByRef Minv As CtsxTxmx3f, ByRef M As CtsxTxmx3f) As Long '// Makes Transformation Matrix from specified X and Z axes and Origin. '// pTxmx points to matrix where result Transformation Matrix is stored. '// If pInvTxmx is specified, the inverted Transform is stored there. '// Returns reference to Txmx. Declare Function tsxMakeMxFromXZO3f Lib "tsxapi.dll" (ByRef xAxis As CtsxVector3f, _ ByRef zAxis As CtsxVector3f, _ ByRef origin As CtsxVector3f, _ ByRef pTxmx As CtsxTxmx3f, _ pInvTxmx As Any) As Variant '// Makes a transformation matrix for rotation by `angle' about a line '// defined by the center point `cent' and the normalized axis vector `axis'. '// Returns reference to Txmx. Declare Function tsxMakeRotMx3f Lib "tsxapi.dll" (ByRef cent As CtsxVector3f, _ ByRef axis As CtsxVector3f, _ ByVal angle As Single, _ ByRef pTxmx As CtsxTxmx3f, _ pInvTxmx As Any) As Long '// This version builds a pure rotation matrix, leaving other cells untouched. '// The rotation is about a (unit) vector `axis'. Declare Function tsxMakePureRotMx3f Lib "tsxapi.dll" (ByRef axis As CtsxVector3f, _ ByVal angle As Single, _ ByRef pTxmx As CtsxTxmx3f, _ pInvTxmx As Any) As Long '// Translation in the Txmx '// Get the translation components {x, y, z} into `trvec'. Declare Function tsxGetMxTranslation3f Lib "tsxapi.dll" (ByRef trvec As CtsxVector3f, ByRef txmx As CtsxTxmx3f) As Long '// Set the translation components of a Txmx Declare Function tsxSetMxTranslation3f Lib "tsxapi.dll" (ByRef txmx As CtsxTxmx3f, ByRef trvec As CtsxVector3f) As Long '// Add translation vector `trvec' to Txmx Declare Function tsxAddMxTranslation3f Lib "tsxapi.dll" (ByRef txmx As CtsxTxmx3f, ByRef trvec As CtsxVector3f) As Long '// Subtract translation vector `trvec' from Txmx Declare Function tsxSubMxTranslation3f Lib "tsxapi.dll" (ByRef txmx As CtsxTxmx3f, ByRef trvec As CtsxVector3f) As Long '// Extract the pure rotation matrix (Rot) and scaling/shearing factors '// from a Transformation Matrix (Txmx). '// If specified, pScaleShear must be float[6], and is assigned as follows: '// { Sx, Sy, Sz, Sxy, Sxz, Syz } Declare Sub tsxUnMatrix3f Lib "tsxapi.dll" (ByRef txmx As CtsxTxmx3f, ByRef Rot As CtsxTxmx3f, pScaleShear As Long) '// Transform an array of vectors `pInVecs', placing result in `pOutVecs'. Declare Sub tsxTransformVecs3f Lib "tsxapi.dll" (ByVal numVecs As Long, _ ByRef pOutVecs As CtsxVector3f, _ ByRef pInVecs As CtsxVector3f, _ ByRef txmx As CtsxTxmx3f) '// Apply only the rotational part of the Txmx to an array of vectors. Declare Sub tsxRotateVecs3f Lib "tsxapi.dll" (ByVal numVecs As Long, _ ByRef pOutVecs As CtsxVector3f, _ ByRef pInVecs As CtsxVector3f, _ ByRef txmx As CtsxTxmx3f) '// OutAxes = Rotate InAxes using Txmx. Ignore non-rotational part of Txmx. '// IF InAxes are orthogonal and unit, then OutAxes are also valid axes. Declare Sub tsxRotateAxes3f Lib "tsxapi.dll" (ByRef pOutAxes As CtsxAxes3f, ByRef pInAxes As CtsxAxes3f, ByRef txmx As CtsxTxmx3f) '// Initialize BBox to negative volume. Declare Sub tsxBBoxInit Lib "tsxapi.dll" (ByRef pBBox As CtsxBBox3f) '// Returns e_tsxTRUE if BBox1 and BBox2 intersect. '// If they do intersect, and pBBintx is non-zero, '// then BBintx gets their intersection. Declare Function tsxBBoxIntersection Lib "tsxapi.dll" ( _ ByRef pBBintx As CtsxBBox3f, _ ByRef pBBox1 As CtsxBBox3f, _ ByRef pBBox2 As CtsxBBox3f) As Long '------------------------------------------------------------------------------ '// File: tsxSobj.h '// Descr: Definition of tsxSOBJ '// Sobj Type Declare Function tsxSobjGetType Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// e_tsxTRUE if Node is a Sobj Declare Function tsxIsSobj Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Get the first child of an object. Declare Function tsxSobjGetFirstChild Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Get the last child of an object. Declare Function tsxSobjGetLastChild Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Get the next node of valid tsx Sobj Type '// pSobj is any Calobj Declare Function tsxSobjGetNext Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Get the prev node of valid tsx Sobj Type '// pSobj is any Calobj Declare Function tsxSobjGetPrev Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Delete and free memory, including internal allocations. '// Also delete all children, if any. '// Erases objects from all Views. Declare Sub tsxSobjDelete Lib "tsxapi.dll" (ByVal pSobj As Long) '------------------------------------------------------------------------------ '// File: tsxMatrl.h '// Descr: Definition of tsxMATERIAL '// Solid texture direction values (used in the grain fields). #Const tsxSOLID_DIR_X = 0 #Const tsxSOLID_DIR_Y = 1 #Const tsxSOLID_DIR_Z = 2 '// Simulates a granite like texture with upto 4 colors. Type CtsxGraniteProps color1 As CtsxColor '//The different stone colors. color2 As CtsxColor color3 As CtsxColor color4 As CtsxColor amount1 As Single '//Relative amount of color1 [0.0 - 1.0] (0=none) amount2 As Single '//Relative amount of color2 [0.0 - 1.0] amount3 As Single '//Relative amount of color3 [0.0 - 1.0] amount4 As Single '//Relative amount of color4 [0.0 - 1.0] sharpness As Single '//[0.0 (max blurring to one color) - 1.0 (no blur)] scale As CtsxVector3f 'Scaling along solid texture directions. Non-negative. '// Larger values result in finer texture. seed As Integer '//Random seed for generating pattern [0 - 64k] End Type '// Simulates texture of swirling veins produced by turbulent forces '// applied before marble solidifies. Type CtsxMarbleProps stonecol As CtsxColor '//Base stone color veincol As CtsxColor '//Color of veins turbulence As Integer '//Higher numbers result in larger, bumpier veins. '// 0 produces straight veins. Typically [0 - 20]. sharpness As Single '//Blending between vein and stone colors at vein edges. '// Higher values increase sharpness. [0.0 - 1.0] grain As Integer '//Vein direction (tsxSOLID_DIR_*). scale As CtsxVector3f '//Scaling along solid texture directions. Non-negative. '// Larger values result in more veins. seed As Integer '//Random seed for generating pattern [0 - 64k] End Type '// This produces concentric light (Spring) and dark (Summer) colored rings, '// around an axis. Type CtsxWoodProps lightcol As CtsxColor '//The light or spring color darkcol As CtsxColor '//The dark or summer color ldratio As Single '//Light/Dark ratio. '// [0.0 (almost all dark) - 1.0 (almost all light)] rdensity As Single '//Number of rings per unit distance. rwidthvar As Single '//Variation in ring width [0.0 (uniform) - 1.0] rshapevar As Single '//Variation in ring shape [0.0 (perfect circle) - 1.0] center As CtsxVector3f '//Location of rings center. grain As Integer '//Ring axis direction (tsxSOLID_DIR_*). scale As CtsxVector3f '//Scaling along solid texture directions. Non-negative. seed As Integer '//Random seed for generating pattern [0 - 64k] End Type '// Values for CtsxProcTexture::txtrtype #Const tsxTEXTURE_NONE = 0 #Const tsxTEXTURE_GRANITE = 1 #Const tsxTEXTURE_MARBLE = 2 #Const tsxTEXTURE_WOOD = 3 '// returned by `tsxMaterialGetTextureType' if texture is not procedural. '// Not a valid value for field txtrtype. #Const tsxTEXTURE_IMAGE = 4 '// Structure for specifying one of the procedural textures in tsxMATERIAL 'struct CtsxProcTexture '{ 'short txtrtype; //one of tsxTEXTURE_* 'Union '{ 'CtsxGraniteProps gprops; 'CtsxMarbleProps mprops; 'CtsxWoodProps wprops; '}; '}; Type CtsxGraniteTexture txtrtype As Integer '// one of tsxTEXTURE_* gprops As CtsxGraniteProps End Type Type CtsxMarbleTexture txtrtype As Integer '// one of tsxTEXTURE_* mprops As CtsxMarbleProps End Type Type CtsxWoodTexture txtrtype As Integer '// one of tsxTEXTURE_* wprops As CtsxWoodProps End Type '// Reflection shading types (mutually exclusive) #Const tsxSHADER_FLAT = 1 #Const tsxSHADER_PHONG = 2 #Const tsxSHADER_METAL = 4 '// Surface smoothness (mutually exclusive) #Const tsxFACET_FACETED = 1 #Const tsxFACET_AUTO = 2 #Const tsxFACET_SMOOTH = 4 '// Surface properties ...................................... Type CtsxSurfaceProps ka As Single '//ambient coefficent [0.0 -(0.01)- 1.0] ks As Single '//specular coefficent [0.0 -(0.01)- 1.0] exp As Single '//exponent of specularity (roughness) [0.0 -(0.01)- 1.0] End Type '// Texture Map properties .................................. #Const tsxTXTR_OVERLAY = 1 #Const tsxTXTR_ON = 2 '//otherwise OFF #Const tsxTXTR_MOVIE = 4 #Const tsxTXTR_MARBLE = 1024 #Const tsxTXTR_WOOD = 2048 #Const tsxTXTR_GRANITE = 4096 '// Only one of MARBLE, WOOD or GRANITE may be set. Type CtsxTextureProps offsetu As Single '//texture U offset [-1.0 -(.001)- 1.0] offsetv As Single '//texture V offset [-1.0 -(.001)- 1.0] repeatsu As Single '//texture repeats in U [0.01 -(.1)- 100.0] repeatsv As Single '//texture repeats in V [0.01 -(.1)- 100.0] flags As Integer '//see above End Type '// Bump Map properties ..................................... #Const tsxBUMP_ON = 2 '//otherwise OFF #Const tsxBUMP_MOVIE = 4 Type CtsxBumpProps offsetu As Single '//bump U offset [-1.0 -(.001)- 1.0] offsetv As Single '//bump V offset [-1.0 -(.001)- 1.0] repeatsu As Single '//bump repeats in U [0.01 -(.1)- 100.0] repeatsv As Single '//bump repeats in V [0.01 -(.1)- 100.0] amplitude As Single '//bump amplitude [-10.0 - 10.0] flags As Integer '//see above End Type '// Environment Map properties .............................. #Const tsxENVR_CUBIC = 1 '//cubic environment, otherwise its spherical #Const tsxENVR_ON = 2 '//otherwise OFF #Const tsxENVR_MOVIE = 4 #Const tsxUVPROJ_PLANE = 1 #Const tsxUVPROJ_PLANE_SQUARE = 2 #Const tsxUVPROJ_CYLINDER = 4 #Const tsxUVPROJ_SPHERE = 8 '// Create a new material object with default properties: '// - reflection shading = tsxSHADER_FLAT '// - Surface smoothness = tsxFACET_FACETED '// - alpha-chanel = 1 '// - index of refraction = 1 '// - Texture U repeats = 1 '// - Texture V repeats = 1 '// - Bump U repeats = 1 '// - Bump V repeats = 1 '// - Bump amplitude = 1 '// - Zero (0) in the rest of the fields '// Ptr to new object assigned to ppMatrl on success. 'TSXAPIFN tsxERR tsxMaterialCreate( tsxMATERIAL** ppMatrl ); Declare Function tsxMaterialCreate Lib "tsxapi.dll" _ (ByRef ppMatrl As Long) As Long '// Create a new material object, with same properties as pOldMatrl. '// Ptr to new object assigned to ppNewMatrl on success. 'TSXAPIFN tsxERR tsxMaterialCreateCopy( 'tsxMATERIAL** ppNewMatrl, 'tsxMATERIAL* pOldMatrl '); Declare Function tsxMaterialCreateCopy Lib "tsxapi.dll" _ (ByRef ppNewMatrl As Long, ByVal pOldMatrl As Long) As Long '// Create a new material object, with same properties as the Active Material. '// Ptr to new object assigned to ppMatrl on success. 'TSXAPIFN tsxERR tsxMaterialCreateCopyActive( tsxMATERIAL** ppMatrl ); Declare Function tsxMaterialCreateCopyActive Lib "tsxapi.dll" _ (ByRef ppMatrl As Long) As Long '// Destroy a material object. If assigned to faces, corresponding material '// entries in matlist set to null. 'TSXAPIFN void tsxMaterialDestroy( tsxMATERIAL* pMatrl ); Declare Sub tsxMaterialDestroy Lib "tsxapi.dll" _ (ByVal pMatrl As Long) '// Set the active material to pNewActive (may be NULL). 'TSXAPIFN void tsxMaterialSetActive( tsxMATERIAL* pNewActive ); Declare Sub tsxMaterialSetActive Lib "tsxapi.dll" _ (ByVal pNewActive As Long) '// Returns ptr to the Active Material (may be NULL) 'TSXAPIFN tsxMATERIAL* tsxMaterialGetActive(); Declare Function tsxMaterialGetActive Lib "tsxapi.dll" _ () As Long '// Copy Active Material's (if any) attributes into pMatrl. 'TSXAPIFN void tsxMaterialCopyActive( tsxMATERIAL* pMatrl ); Declare Sub tsxMaterialCopyActive Lib "tsxapi.dll" _ (ByVal pMatrl As Long) '// Testing two materials for equivalence. 'TSXAPIFN tsxBOOL tsxMaterialsAreEqual( tsxMATERIAL* pMatrl1, 'tsxMATERIAL* pMatrl2 ); Declare Function tsxMaterialsAreEqual Lib "tsxapi.dll" _ (ByVal pMatrl1 As Long, ByVal pMatrl2 As Long) As Long '// Get its ID (0-64K, -1 if not material) 'TSXAPIFN int tsxMaterialGetId( tsxMATERIAL* pMatrl ); Declare Function tsxMaterialGetId Lib "tsxapi.dll" _ (ByVal pMatrl As Long) As Long '// Surface attributes .......................................................... '// Reflection shading (tsxSHADER_*, 0 on error) 'TSXAPIFN int tsxMaterialGetShadingType( tsxMATERIAL* pMatrl ); Declare Function tsxMaterialGetShadingType Lib "tsxapi.dll" _ (ByVal pMatrl As Long) As Long '// Surface faceting (tsxFACET_*, 0 on error) 'TSXAPIFN int tsxMaterialGetFacetingType( tsxMATERIAL* pMatrl ); Declare Function tsxMaterialGetFacetingType Lib "tsxapi.dll" _ (ByVal pMatrl As Long) As Long '// The angle in degrees (0 - 120) 'TSXAPIFN int tsxMaterialGetAutofacetAngle( tsxMATERIAL* pMatrl ); Declare Function tsxMaterialGetAutofacetAngle Lib "tsxapi.dll" _ (ByVal pMatrl As Long) As Long '// Color 'TSXAPIFN void tsxMaterialGetColor( tsxMATERIAL* pMatrl, CtsxColor* pColor ); Declare Sub tsxMaterialGetColor Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByRef pColor As CtsxColor) '// Surface properties 'TSXAPIFN void tsxMaterialGetSurfaceProps( tsxMATERIAL* pMatrl, 'CtsxSurfaceProps* pSprops ); Declare Sub tsxMaterialGetSurfaceProps Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByRef pSprops As CtsxSurfaceProps) '// index of refraction (1.0 - 2.0, 0 on error) 'TSXAPIFN float tsxMaterialGetIor( tsxMATERIAL* pMatrl ); Declare Function tsxMaterialGetIor Lib "tsxapi.dll" _ (ByVal pMatrl As Long) As Single '// Returns tsxTEXTURE_* 'TSXAPIFN int tsxMaterialGetTextureType( tsxMATERIAL* pMatrl ); Declare Function tsxMaterialGetTextureType Lib "tsxapi.dll" _ (ByVal pMatrl As Long) As Long '// If not procedural texture, pPrTxt->txtrtype = tsxTEXTURE_NONE. 'TSXAPIFN void tsxMaterialGetProcTexture( tsxMATERIAL* pMatrl, 'CtsxProcTexture* pPrTxt ); Declare Sub tsxMaterialGetProcTexture Lib "tsxapi.dll" _ (ByVal pMatrl As Long, pPrTxt As Any) '// File used as texture map image. 'TSXAPIFN void tsxMaterialGetTextureFilename( 'tsxMATERIAL* pMatrl, 'char* szFilename, // File name copied here, if any 'int iFilenameSize // size of szFilename buffer '); Declare Sub tsxMaterialGetTextureFilename Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal szFilename As String, iFilenameSize As Long) '// Texture mapping parameters 'TSXAPIFN void tsxMaterialGetTextureProps( 'tsxMATERIAL* pMatrl, 'CtsxTextureProps* pTxtrProps '); Declare Sub tsxMaterialGetTextureProps Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByRef pTxtrProps As CtsxTextureProps) '// Bump Map .................................................................... '// File used as bump map image. 'TSXAPIFN void tsxMaterialGetBumpFilename( 'tsxMATERIAL* pMatrl, 'char* szFilename, // File name copied here, if any 'int iFilenameSize // size of szFilename buffer '); Declare Sub tsxMaterialGetBumpFilename Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal szFilename As String, iFilenameSize As Long) '// Bump mapping parameters 'TSXAPIFN void tsxMaterialGetBumpProps( 'tsxMATERIAL* pMatrl, 'CtsxBumpProps* pBumpProps '); Declare Sub tsxMaterialGetBumpProps Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByRef pTxtrProps As CtsxBumpProps) '// Environment Map ............................................................. '// File used as environment map image. 'TSXAPIFN void tsxMaterialGetEnvrFilename( 'tsxMATERIAL* pMatrl, 'char* szFilename, // File name copied here, if any 'int iFilenameSize // size of szFilename buffer '); Declare Sub tsxMaterialGetEnvrFilename Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal szFilename As String, iFilenameSize As Long) '// Returns tsxENVR_* (0 on error) 'TSXAPIFN int tsxMaterialGetEnvrFlags( tsxMATERIAL* pMatrl ); Declare Function tsxMaterialGetEnvrFlags Lib "tsxapi.dll" _ (ByVal pMatrl As Long) As Long '// Surface attributes .......................................................... '// Reflection shading (tsxSHADER_*) 'TSXAPIFN void tsxMaterialSetShadingType( tsxMATERIAL* pMatrl, int shading ); Declare Sub tsxMaterialSetShadingType Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal shading As Long) '// Surface faceting (tsxFACET_*) 'TSXAPIFN void tsxMaterialSetFacetingType( tsxMATERIAL* pMatrl, int faceting ); Declare Sub tsxMaterialSetFacetingType Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal faceting As Long) '// The angle in degrees (0 - 120) 'TSXAPIFN void tsxMaterialSetAutofacetAngle( tsxMATERIAL* pMatrl, 'int angleDegrees ); Declare Sub tsxMaterialSetAutofacetAngle Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal angleDegrees As Long) '// Color 'TSXAPIFN void tsxMaterialSetColor( tsxMATERIAL* pMatrl, CtsxColor* pColor ); Declare Sub tsxMaterialSetColor Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByRef pColor As CtsxColor) '// Surface properties 'TSXAPIFN void tsxMaterialSetSurfaceProps( tsxMATERIAL* pMatrl, 'CtsxSurfaceProps* pSprops ); Declare Sub tsxMaterialSetSurfaceProps Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByRef pSprops As CtsxSurfaceProps) '// index of refraction (1.0 - 2.0) 'TSXAPIFN void tsxMaterialSetIor( tsxMATERIAL* pMatrl, float ior ); Declare Function tsxMaterialSetIor Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal ior As Single) '// Texture Map ................................................................. '// Returns tsxTEXTURE_* 'TSXAPIFN void tsxMaterialSetTextureType( tsxMATERIAL* pMatrl, int txtype ); Declare Sub tsxMaterialSetTextureType Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal txtype As Long) '// If not procedural texture, pPrTxt->txtrtype = tsxTEXTURE_NONE. 'TSXAPIFN void tsxMaterialSetProcTexture( tsxMATERIAL* pMatrl, 'CtsxProcTexture* pPrTxt ); Declare Sub tsxMaterialSetProcTexture Lib "tsxapi.dll" _ (ByVal pMatrl As Long, pPrTxt As Any) '// File used as texture map image. 'TSXAPIFN void tsxMaterialSetTextureFilename( 'tsxMATERIAL* pMatrl, 'char* szFilename // File name ptr (may be NULL) '); Declare Sub tsxMaterialSetTextureFilename Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal szFilename As String) '// Texture mapping parameters 'TSXAPIFN void tsxMaterialSetTextureProps( 'tsxMATERIAL* pMatrl, 'CtsxTextureProps* pTxtrProps '); Declare Sub tsxMaterialSetTextureProps Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByRef pTxtrProps As CtsxTextureProps) '// Bump Map .................................................................... '// File used as bump map image. 'TSXAPIFN void tsxMaterialSetBumpFilename( 'tsxMATERIAL* pMatrl, 'char* szFilename // File name ptr (may be 0) '); Declare Sub tsxMaterialSetBumpFilename Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal szFilename As String) '// Bump mapping parameters 'TSXAPIFN void tsxMaterialSetBumpProps( 'tsxMATERIAL* pMatrl, 'CtsxBumpProps* pBumpProps '); Declare Sub tsxMaterialSetBumpProps Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByRef pBumpProps As CtsxBumpProps) '// Environment Map ............................................................. '// File used as environment map image. 'TSXAPIFN void tsxMaterialSetEnvrFilename( 'tsxMATERIAL* pMatrl, 'char* szFilename // File name ptr (may be 0) '); Declare Sub tsxMaterialSetEnvrFilename Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal szFilename As String) '// Environment flags tsxENVR_* 'TSXAPIFN void tsxMaterialSetEnvrFlags( tsxMATERIAL* pMatrl, int flags ); Declare Sub tsxMaterialSetEnvrFlags Lib "tsxapi.dll" _ (ByVal pMatrl As Long, ByVal flags As Long) '------------------------------------------------------------------------------ '// File: tsxScene.cpp '// Descr: Definition of tsxSCENE '// Get the trueSpace scene. 'TSXAPIFN tsxSCENE* tsxGetScene(); Declare Function tsxGetScene Lib "tsxapi.dll" _ () As Long '// Adds pGNode as top-level member of scene, and makes it the current selection. '// IF bNoDraw is TRUE THEN the object will not be drawn in this function call. '// pGNode must be a new object not already in Scene. 'TSXAPIFN void tsxSceneAddObject( tsxGNODE* pGNode, tsxBOOL bNoDraw ); Declare Sub tsxSceneAddObject Lib "tsxapi.dll" _ (ByVal pGNode As Long, ByVal bNoDraw As Long) '// Get the first top level GNode. '// The rest can be accessed using `tsxGNodeGetNext'. 'TSXAPIFN tsxGNODE* tsxSceneGetFirstNode(); Declare Function tsxSceneGetFirstNode Lib "tsxapi.dll" _ () As Long '// Returns tsxTRUE for Fog On. 'TSXAPIFN tsxBOOL tsxSceneIsFogOn(); Declare Function tsxSceneIsFogOn Lib "tsxapi.dll" _ () As Long '// Use tsxTRUE to set Fog On. 'TSXAPIFN void tsxSceneSwitchFog( tsxBOOL fog_on ); Declare Sub tsxSceneSwitchFog Lib "tsxapi.dll" _ (ByVal fog_on As Long) '// 'TSXAPIFN void tsxSceneGetFogParms( 'unsigned int* pFogRed, //0 - 255 'unsigned int* pFogBlue, //0 - 255 'unsigned int* pFogGreen, //0 - 255 'int* pFogNear, 'int* pFogFar, 'int* pFogMax '); Declare Sub tsxSceneGetFogParms Lib "tsxapi.dll" _ (ByRef pFogRed As Long, ByRef pFogBlue As Long, ByRef pFogGreen As Long, ByRef pFogNear As Long, ByRef pFogFar As Long, ByRef pFogMax As Long) '// 'TSXAPIFN void tsxSceneSetFogParms( 'unsigned int FogRed, //0 - 255 'unsigned int FogBlue, //0 - 255 'unsigned int FogGreen, //0 - 255 'int FogNear, 'int FogFar, 'int FogMax '); Declare Sub tsxSceneSetFogParms Lib "tsxapi.dll" _ (ByVal FogRed As Long, ByVal FogBlue As Long, ByVal FogGreen As Long, ByVal FogNear As Long, ByVal FogFar As Long, ByVal FogMax As Long) '// (Re)Draw the scene in the active View, in the View's rendering mode. 'TSXAPIFN void tsxSceneDraw(); Declare Sub tsxSceneDraw Lib "tsxapi.dll" () '------------------------------------------------------------------------------ '// File: tsxGNode.h '// Descr: Definition of tsxGNODE '// e_tsxTRUE if pSobj is a GNode 'TSXAPIFN tsxBOOL tsxIsGNode( tsxSOBJ* pSobj ); Declare Function tsxIsGNode Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Get a copy of the entire tree rooted at a GNode 'TSXAPIFN tsxERR tsxGNodeCopy( ' tsxGNODE* pGNode, // The GNode to copy ' tsxGNODE** ppGNodeCopy // Ptr to Copy placed here, on success ' ); Declare Function tsxGNodeCopy Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef ppGNodeCopy As Long) As Long '// Returns: 0 if pGNode is the Scene object; '// pGNode if parent of pGNode is the Scene object, '// or pGNode has no parent; '// else ptr to highest tsxGNODE ancestor of pGNode below Scene. 'TSXAPIFN tsxGNODE* tsxGNodeGetRoot( tsxGNODE* pGNode ); Declare Function tsxGNodeGetRoot Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Get the parent node in the scene graph. 'TSXAPIFN tsxGNODE* tsxGNodeGetParent( tsxGNODE* pGNode ); Declare Function tsxGNodeGetParent Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Returns e_tsxTRUE if pGNode is a member of the Scene at some level. 'TSXAPIFN tsxBOOL tsxIsGNodeInScene( tsxGNODE* pGNode ); Declare Function tsxIsGNodeInScene Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Get the first child of a Group or LOD object. 'TSXAPIFN tsxGNODE* tsxGNodeGetFirstChild( tsxGNODE* pGNode ); Declare Function tsxGNodeGetFirstChild Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Get the next node of valid tsx Type 'TSXAPIFN tsxGNODE* tsxGNodeGetNext( tsxGNODE* pGNode ); Declare Function tsxGNodeGetNext Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Get the prev node of valid tsx Type 'TSXAPIFN tsxGNODE* tsxGNodeGetPrev( tsxGNODE* pGNode ); Declare Function tsxGNodeGetPrev Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Returns e_tsxTRUE if pCheckGNode is a node in the tree rooted at pGNode. 'TSXAPIFN tsxBOOL tsxIsGNodeSubobj( tsxGNODE* pGNode, tsxGNODE* pCheckGNode ); Declare Function tsxIsGNodeSubobj Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal pCheckGNode As Long) As Long '// Draws pGNode in the current view, in the current view's rendering mode. 'TSXAPIFN void tsxGNodeDraw( tsxGNODE* pGNode ); Declare Sub tsxGNodeDraw Lib "tsxapi.dll" (ByVal pGNode As Long) '// Gets the Name of a GNode. '// Returns length of name. (0 if not valid request or null name) 'TSXAPIFN int tsxGNodeGetName( ' tsxGNODE* pGNode, ' char* pName, //buffer where name is copied ' int iNameSz //Size of pName buffer ' ); Declare Function tsxGNodeGetName Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal pName As String, ByVal iNameSz As Long) As Long '// Sets the Name of a GNode. '// Returns 0 on success. 'TSXAPIFN tsxERR tsxGNodeSetName( tsxGNODE* pGNode, char* szNewName ); Declare Function tsxGNodeSetName Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal pName As String) As Long '// Get the GNode's position in World coordinates. '// Returns 0 if not GNODE, else posn. 'TSXAPIFN CtsxVector3f* tsxGNodeGetAxesPosition( 'tsxGNODE* pGNode, 'CtsxVector3f* posn '); Declare Function tsxGNodeGetAxesPosition Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef posn As CtsxVector3f) As Long '// Get the GNode's model axes orientation, as a triple of normalized orthogonal '// vectors pointing in the directions of GNode's X, Y and Z. '// Returns 0 if not GNODE, else axes. 'TSXAPIFN CtsxAxes3f* tsxGNodeGetAxesOrientation( 'tsxGNODE* pGNode, 'CtsxAxes3f* axes ' ); Declare Function tsxGNodeGetAxesOrientation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef posn As CtsxAxes3f) As Long '// Add the bounding box of GNode to input BBox. '// Not valid for Track and Path objects. '// The resulting BBox will also enclose the input BBox bounds. To get BBox '// of only pGNode, use `tsxBBoxInit()' before calling this function. 'TSXAPIFN tsxERR tsxGNodeGetBBox( 'tsxGNODE* pGNode, //Non Track/Path GNode 'CtsxBBox3f* pBBox //BBox updated with result. '); Declare Function tsxGNodeGetBBox Lib "tsxapi.dll" _ (ByVal pGNode As Long, ByRef pBBox As CtsxBBox3f) As Long '// Get the location of GNode. '// Returns 0 if not GNODE, else loc. 'TSXAPIFN CtsxVector3f* tsxGNodeGetLocation( 'tsxGNODE* pGNode, 'CtsxVector3f* loc '); Declare Function tsxGNodeGetLocation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef loc As CtsxVector3f) As Long '// Get the euler angles of GNode's orientation. '// Returns 0 if not GNODE, else rot. 'TSXAPIFN CtsxVector3f* tsxGNodeGetRotation( 'tsxGNODE* pGNode, 'CtsxVector3f* rot '); Declare Function tsxGNodeGetRotation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef Rot As CtsxVector3f) As Long '// Get the size of GNode. '// Returns 0 if not GNODE, else size. 'TSXAPIFN CtsxVector3f* tsxGNodeGetSize( 'tsxGNODE* pGNode, 'CtsxVector3f* size '); Declare Function tsxGNodeGetSize Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef size As CtsxVector3f) As Long '// Set the location of GNode. 'TSXAPIFN void tsxGNodeSetLocation( 'tsxGNODE* pGNode, 'CtsxVector3f* loc '); Declare Sub tsxGNodeSetLocation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef loc As CtsxVector3f) '// Set the euler angles of GNode's orientation. 'TSXAPIFN void tsxGNodeSetRotation( 'tsxGNODE* pGNode, 'CtsxVector3f* rot '); Declare Sub tsxGNodeSetRotation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef Rot As CtsxVector3f) '// Set the size of GNode. 'TSXAPIFN void tsxGNodeSetSize( 'tsxGNODE* pGNode, 'CtsxVector3f* size '); Declare Sub tsxGNodeSetSize Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef size As CtsxVector3f) '// Returns Transformation matrix representation of the GNode's axes, '// with only Rotation and Translation elements, '// and no Scaling/Shearing factors. '// 0 if not GNode 'TSXAPIFN CtsxTxmx3f* tsxGNodeGetPureTransform( 'tsxGNODE* pGNode, 'CtsxTxmx3f* pTxmx '); Declare Function tsxGNodeGetPureTransform Lib "tsxapi.dll" ( _ ByVal pGNode As Long, _ ByRef pTxmx As CtsxTxmx3f) As Long '// Returns Transformation matrix of GNode, '// 0 if not GNode 'TSXAPIFN CtsxTxmx3f* tsxGNodeGetTransform( 'tsxGNODE* pGNode, 'CtsxTxmx3f* pTxmx '); Declare Function tsxGNodeGetTransform Lib "tsxapi.dll" ( _ ByVal pGNode As Long, _ ByRef pTxmx As CtsxTxmx3f) As Long '// Translate GNode by pVec, in the specified reference frame. 'TSXAPIFN void tsxGNodeTranslate( 'tsxGNODE* pGNode, 'CtsxVector3f* pVec, // translation vector 'tsxFRAMEID frameid // Reference frame for pVec '); Declare Sub tsxGNodeTranslate Lib "tsxapi.dll" ( _ ByVal pGNode As Long, _ ByRef pVec As CtsxVector3f, _ ByVal frameid As Long) '// Rotate by fAngle radians about pAxis passing thru pCenter, '// in the specified reference frame. 'TSXAPIFN void tsxGNodeRotate( 'tsxGNODE* pGNode, 'CtsxVector3f* pCenter, //Center of rotation. 'CtsxVector3f* pAxis, //Rotation axis passing thru pCenter. 'float fAngle, //Radians. Rotation angle. 'tsxFRAMEID frameid '); Declare Sub tsxGNodeRotate Lib "tsxapi.dll" ( _ ByVal pGNode As Long, _ ByRef pCenter As CtsxVector3f, _ ByRef pAxis As CtsxVector3f, _ ByVal fAngle As Single, _ ByVal frameid As Long) '// Scale by factors along each axis, in the specified reference frame. '// Scale factors must be non-zero. 'TSXAPIFN void tsxGNodeScale( 'tsxGNODE* pGNode, 'CtsxVector3f* pScaleFacs, //x, y, z scale factors (non-zero) 'tsxFRAMEID frameid '); Declare Sub tsxGNodeScale Lib "tsxapi.dll" ( _ ByVal pGNode As Long, _ ByRef pScaleFacs As CtsxVector3f, _ ByVal frameid As Long) '// Scale by factor UNIFORMLY along each axis, in the specified reference frame. '// Scale factor must be non-zero. 'TSXAPIFN void tsxGNodeScaleUniform( 'tsxGNODE* pGNode, 'float fScaleFac, 'tsxFRAMEID frameid '); Declare Sub tsxGNodeScaleUniform Lib "tsxapi.dll" ( _ ByVal pGNode As Long, _ ByVal pScaleFac As Single, _ ByVal frameid As Long) '------------------------------------------------------------------------------ '// File: tsxCamra.h '// Descr: Interface to tsxCAMERA '// Creates a camera at world origin, with the viewing plane on the world '// YZ plane, Z in the up direction, and pointing in the positive world X '// direction. On success, the new camera is the currently selected object. 'TSXAPIFN tsxERR tsxCameraCreateInScene(); Declare Function tsxCameraCreateInScene Lib "tsxapi.dll" () As Long '------------------------------------------------------------------------------ '// File: tsxLight.h '// Descr: Interface to tsxLIGHT '// Light types Enum tsxLIGHT_TYPE e_tsxLT_UNDEF = 0 e_tsxLT_INFINITE '//Light from an very distant source e_tsxLT_LOCAL '//Light from a local point source e_tsxLT_SPOT '//A spot-light End Enum '// Light intensity falloff Enum tsxLIGHT_FALLOFF e_tsxLF_UNDEF = 0 e_tsxLF_ZERO '//No falloff e_tsxLF_LINEAR '//Linear with distance e_tsxLF_SQUARED '//square of distance End Enum '// Shadow type Enum tsxLIGHT_SHADOWING e_tsxLS_NOSHADOWS = 0 e_tsxLS_RAYTRACE e_tsxLS_SHADOWMAP End Enum '// Shadow-map Size Enum tsxLIGHT_SMSIZE e_tsxSMZ_UNDEF = 0 e_tsxSMZ_LOW e_tsxSMZ_MEDIUM e_tsxSMZ_HIGH End Enum '// Shadow-map sharpness Enum tsxLIGHT_SMSHARPNESS e_tsxSMS_UNDEF = 0 e_tsxSMS_LOW e_tsxSMS_MEDIUM e_tsxSMS_HIGH End Enum '// Creates a Light of specified LtType at world origin, '// with default position, orientation and attributes. '// On success, the new Light is the currently selected object. '// Default location: Spot, Local -- (0,0,1), Infinite -- (0,0,0). '// Default orientation: 180 deg rotation about world X, making it '// point towards world origin (spot, infinite) with its Z axis. '// The axes are aligned as follows: '// X aligned with World X, '// Y and Z aligned with world negative Y and negative Z. 'TSXAPIFN tsxERR tsxLightCreateInScene( tsxLIGHT_TYPE LtType ); Declare Function tsxLightCreateInScene Lib "tsxapi.dll" ( _ ByVal LtType As tsxLIGHT_TYPE) As Long '// Light type 'TSXAPIFN tsxLIGHT_TYPE tsxLightGetType( tsxLIGHT* pLight ); Declare Function tsxLightGetType Lib "tsxapi.dll" ( _ ByVal pLight As Long) As tsxLIGHT_TYPE '// Get Light color (copied into pColor). 'TSXAPIFN void tsxLightGetColor( tsxLIGHT* pLight, CtsxColor* pColor ); Declare Sub tsxLightGetColor Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByRef pColor As CtsxColor) '// Set Light color (copied from pColor). 'TSXAPIFN void tsxLightSetColor( tsxLIGHT* pLight, CtsxColor* pColor ); Declare Sub tsxLightSetColor Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByRef pColor As CtsxColor) '// Get the light intensity. Returns -1 if not a light. 'TSXAPIFN float tsxLightGetIntensity( tsxLIGHT* pLight ); Declare Function tsxLightGetIntensity Lib "tsxapi.dll" ( _ ByVal pLight As Long) As Single '// Set the light intensity. Returns new intensity, -1.0 if not a light. 'TSXAPIFN float tsxLightSetIntensity( tsxLIGHT* pLight, float fNewIntens ); Declare Function tsxLightSetIntensity Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByVal fNewIntens As Single) As Single '// Get the light intensity falloff type with distance. 'TSXAPIFN tsxLIGHT_FALLOFF tsxLightGetFalloff( tsxLIGHT* pLight ); Declare Function tsxLightGetFalloff Lib "tsxapi.dll" ( _ ByVal pLight As Long) As tsxLIGHT_FALLOFF '// Set the light intensity falloff type with distance. '// Returns new value, or tsxLF_UNDEF for invalid request. 'TSXAPIFN tsxLIGHT_FALLOFF tsxLightSetFalloff( tsxLIGHT* pLight, ' tsxLIGHT_FALLOFF NewFo ); Declare Function tsxLightSetFalloff Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByVal NewFo As tsxLIGHT_FALLOFF) As tsxLIGHT_FALLOFF '// Shadowing. 'TSXAPIFN tsxLIGHT_SHADOWING tsxLightGetShadType( tsxLIGHT* pLight ); Declare Function tsxLightGetShadType Lib "tsxapi.dll" ( _ ByVal pLight As Long) As tsxLIGHT_SHADOWING '// Set shadowing type. '// Returns new value, e_tsxLS_NOSHADOWS if not a light. 'TSXAPIFN tsxLIGHT_SHADOWING tsxLightSetShadType( 'tsxLIGHT* pLight, 'tsxLIGHT_SHADOWING newShType '); Declare Function tsxLightSetShadType Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByVal newShType As tsxLIGHT_SHADOWING) As tsxLIGHT_SHADOWING '// True if shadow-map is image size dependent. 'TSXAPIFN tsxBOOL tsxLightIsShadImgDep( tsxLIGHT* pLight ); Declare Function tsxLightIsShadImgDep Lib "tsxapi.dll" ( _ ByVal pLight As Long) As tsxBool '// (Un)Set shadow-map's image size dependence. '// Returns new value, False if not a light. 'TSXAPIFN tsxBOOL tsxLightSetShadImgDep( 'tsxLIGHT* pLight, 'tsxBOOL bDependent //True to make it dependent '); Declare Function tsxLightSetShadImgDep Lib "tsxapi.dll" ( _ ByVal pLight As Long, bDependent As tsxBool) As tsxBool '// Get shadow-map size 'TSXAPIFN tsxLIGHT_SMSIZE tsxLightGetShmapSize( tsxLIGHT* pLight ); Declare Function tsxLightGetShmapSize Lib "tsxapi.dll" ( _ ByVal pLight As Long) As tsxLIGHT_SMSIZE '// Set shadow-map size. Returns new value, or e_tsxSMZ_UNDEF if invalid request. 'TSXAPIFN tsxLIGHT_SMSIZE tsxLightSetShmapSize( 'tsxLIGHT* pLight, 'tsxLIGHT_SMSIZE NewSz '); Declare Function tsxLightSetShmapSize Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByVal NewSz As tsxLIGHT_SMSIZE) As tsxLIGHT_SMSIZE '// Get shadow-map sharpness (_UNDEF if not light). 'TSXAPIFN tsxLIGHT_SMSHARPNESS tsxLightGetShmapSharpness( tsxLIGHT* pLight ); Declare Function tsxLightGetShmapSharpness Lib "tsxapi.dll" ( _ ByVal pLight As Long) As tsxLIGHT_SMSHARPNESS '// Set shadow-map sharpness. '// Returns new value, or tsxSMS_UNDEF for invalid request. 'TSXAPIFN tsxLIGHT_SMSHARPNESS tsxLightSetShmapSharpness( 'tsxLIGHT* pLight, 'tsxLIGHT_SMSHARPNESS NewSharpness '); Declare Function tsxLightSetShmapSharpness Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByVal NewSharpness As tsxLIGHT_SMSHARPNESS) As tsxLIGHT_SMSHARPNESS '// Get cone angle (in radians). '// This is the solid angle of the lit area subtended at the light source. '// Returns -1.0 if not a spotlight. 'TSXAPIFN float tsxLightGetSpotAngle( tsxLIGHT* pLight ); Declare Function tsxLightGetSpotAngle Lib "tsxapi.dll" ( _ ByVal pLight As Long) As Single '// Set the spotlight cone angle (in radians). '// Returns the new angle, -1 if not a spotlight. 'TSXAPIFN float tsxLightSetSpotAngle( tsxLIGHT* pLight, float newAngle ); Declare Function tsxLightSetSpotAngle Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByVal newAngle As Single) As Single '// Get the hot-spot ratio. '// The hot-spot in a spotlight is the inner circle of even bright light. '// In the lit ring outside the hot-spot, the light intensity decreases '// towards the outer edge. The hot-spot ratio is the ratio of the hot-spot '// cone solid angle to the entire spotlight cone solid angle. '// Returns 0.0 <= ratio <= 1.0, -1.0 if not a light. 'TSXAPIFN float tsxLightGetSpotRatio( tsxLIGHT* pLight ); Declare Function tsxLightGetSpotRatio Lib "tsxapi.dll" ( _ ByVal pLight As Long) As Single '// Set the hot-spot ratio (see `tsxLightGetSpotRatio'). '// Returns new value, -1.0 if not a light, or invalid newRatio. 'TSXAPIFN float tsxLightSetSpotRatio( tsxLIGHT* pLight, float newRatio ); Declare Function tsxLightSetSpotRatio Lib "tsxapi.dll" ( _ ByVal pLight As Long, ByVal newRatio As Single) As Single '------------------------------------------------------------------------------ '// File: tsxMNode.h '// Descr: Definition of tsxMNODE '// e_tsxTRUE if pSobj is a MNode 'TSXAPIFN tsxBOOL tsxIsMNode( tsxSOBJ* pSobj ); Declare Function tsxIsMNode Lib "tsxapi.dll" (ByVal pSobj As Long) As tsxBool '// Returns e_tsxTRUE if pMNode is Visible in a rendered scene. '// A Group object may return TRUE even if it does not have any '// Polyhdera descendants. 'TSXAPIFN tsxBOOL tsxMNodeIsVisible( tsxMNODE* pMNode ); Declare Function tsxMNodeIsVisible Lib "tsxapi.dll" (ByVal pMNode As Long) As tsxBool '// Makes pMNode Visible. Effect on next Draw operation. 'TSXAPIFN void tsxMNodeSetVisible( tsxMNODE* pMNode ); Declare Sub tsxMNodeSetVisible Lib "tsxapi.dll" (ByVal pMNode As Long) '// Makes pMNode Invisible. Effect on next Draw operation. 'TSXAPIFN void tsxMNodeSetInvisible( tsxMNODE* pMNode ); Declare Sub tsxMNodeSetInvisible Lib "tsxapi.dll" (ByVal pMNode As Long) '// Returns e_tsxTRUE if MNode has its Axes displayed in tS. 'TSXAPIFN tsxBOOL tsxMNodeAreAxesVisible( tsxMNODE* pMNode ); Declare Function tsxMNodeAreAxesVisible Lib "tsxapi.dll" (ByVal pMNode As Long) As tsxBool '// Toggles (On/Off) the display of the current object's axes, if applicable. 'TSXAPIFN void tsxCurrobjToggleAxes(); Declare Sub tsxCurrobjToggleAxes Lib "tsxapi.dll" () '// Set the position of MNode's axes. '// Does not update views. 'TSXAPIFN void tsxMNodeSetAxesPosition( tsxMNODE* pMNode, CtsxVector3f* posn ); Declare Sub tsxMNodeSetAxesPosition Lib "tsxapi.dll" (ByVal pMNode As Long, ByRef posn As CtsxVector3f) '// Set the orientation of MNode's axes. '// `axes' must point to valid (orthogonal, unit) axes. '// Does not update views. 'TSXAPIFN void tsxMNodeSetAxesOrientation( tsxMNODE* pMNode, CtsxAxes3f* axes ); Declare Sub tsxMNodeSetAxesOrientation Lib "tsxapi.dll" (ByVal pMNode As Long, ByRef axes As CtsxAxes3f) '------------------------------------------------------------------------------ '// File: tsxGroup.cpp '// Descr: Definition of tsxGROUP '// This is the same function as used in the [Glue as Child] button. '// (Currobj = currently selected object) '// Makes pGNode and Currobj children of a new Group obj, and '// the Group obj is placed where Currobj was in the Scene Graph. '// The new Group obj becomes the current selection, and acquires '// the previous Currobj's axes position and orientation. '// The animation timeline window is updated. '// pGNode and Currobj must have different Roots (`tsxGNodeGetRoot'). '// Returns: 0 if no pGNode or Currobj, or not valid GNodes, or '// if pGNode is same as Currobj (no grouping done), else '// ptr to the new Group obj. 'TSXAPIFN tsxGROUP* tsxGroupNewWithCurrobj( tsxGNODE* pGNode ); Declare Function tsxGroupNewWithCurrobj Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// This is the same function as used in the [Glue as Sibling] button. '// (Currobj = currently selected object) '// IF Currobj is a Group node, '// THEN pGNode is added to it as another child; '// ELSE '// Makes pGNode and Currobj children of a new Group obj, and '// the Group obj is placed where Currobj was in the Scene Graph. '// The new Group obj becomes the current selection, and acquires '// the previous Currobj's axes position and orientation. '// The animation timeline window is updated. '// pGNode and Currobj must have different Roots (`tsxGNodeGetRoot'). '// pGNode must be a top level object (no parent groups above it). '// Returns: 0 if no pGNode or Currobj, or not valid GNodes, or '// if pGNode is same as Currobj (no grouping done), else '// ptr to the (new or Currobj) Group obj. 'TSXAPIFN tsxGROUP* tsxGroupAtCurrobj( tsxGNODE* pGNode ); Declare Function tsxGroupAtCurrobj Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// This is the same function as used in the [Unglue] button. '// Currobj is removed from its parent Group and added as a top level object '// to the scene. Current selection is updated to next available sibling. '// Side Effect: If the Currobj has only one sibling before calling this '// function, then the parent GROUP object is removed and the sibling takes '// the place in the scene graph of the removed GROUP object. Thus this '// function never results in a Group object with just one child. '// (Parent = parent GROUP of Currobj before calling this function) '// Returns: '// 0 on failure (e.g. No Currobj, Currobj not part of group), else '// ptr to oject that takes the place of Parent in the scene graph '// (see note on Side Effect): '// = Parent if it had more than 2 children before this function, else '// = the sibling that replaces Parent. 'TSXAPIFN tsxGNODE* tsxGroupRemoveCurrobj(); Declare Function tsxGroupRemoveCurrobj Lib "tsxapi.dll" () As Long '------------------------------------------------------------------------------ '// File: tsxPolyh.h '// Descr: Definition of tsxPOLYHEDRA '// Face -> Vertex data '// Note: Use the TSXAPI memory routines (tsxMisc.h) to allocate '// the memory area for instances of this type. '// DO NOT use `new' or `malloc/calloc'! Type CtsxFaceVx vix As Long '// Index into Polyhedron's Vertex Array (see `tsxPolyhGetVxArray'). uvix As Long '// Index into Polyhedron's UV Array. nextfaceix As Long '// Index (in Polyh) of next face containing this vertex. '// Use `tsxPolyhComputeFaceAdjacency' to set this field. color As CtsxColor '//IF color.alpha == 0 THEN use material color '//OTHERWISE use vertex color. End Type '// Face. '// Faces are one-sided polygons, with their vertices specified in clockwise '// order when looking at the front of the polygon. The surface normal points '// out of (or away from) the front. '// Use `tsxPolyhGetFaceptrArray' to access a polyhedron's faces. '// You must use `tsxFaceAlloc' or `tsxFaceCopy' to create instances of this type. Type CtsxFace nbrVxs As Integer '//Nbr of Vertices pFVxs As Long '//Array of Face-Vertex data, Vertices in clockwise order. r1 As Byte '// reserved r2 As Byte '// reserved r3 As Long '// reserved normVxs(0 To 2) As Byte '//Indices into pFVxs of 3 vertices '// ... to build Face Normal (see below). materialIdx As Integer '//ID of Face's material End Type '// Note on the field tsxFace.normVxs ... '// The three indices represent three face vertices in clockwise order, '// defining two rays in the plane of the face: '// ORIGIN -> RAY1 and ORIGIN -> RAY2 '// The cross-product of (ray1 x ray2) gives an unnormalized vector '// perpendicular to the face, facing out. These vertices must not be colinear. #Const tsx_NORM_VXS_ORIGIN = 1 #Const tsx_NORM_VXS_RAY1 = 0 #Const tsx_NORM_VXS_RAY2 = 2 '// Creates an empty Polyhedron (0 vertices and faces). '// The Model-Axes are set to the World Axes. '// The Vertex Transformation Matrix is set to the identity matrix '// with no translation. 'TSXAPIFN tsxERR tsxPolyhCreate( tsxPOLYHEDRON** ppPolyh ); Declare Function tsxPolyhCreate Lib "tsxapi.dll" (ByRef ppPolyh As Long) As Long '// Clears a Polyhedron to 0 vertices & faces, freeing related structures. 'TSXAPIFN void tsxPolyhClear( tsxPOLYHEDRON* pPolyh ); Declare Sub tsxPolyhClear Lib "tsxapi.dll" (ByVal ppPolyh As Long) '// Tessellate the polyhedron. '// The geometry of the polyhedron is modified so that all faces are triangles. '// If the original polyhedron had some non-triangular faces, then the number '// of faces will probably increase. Actually replaces the internal face '// and related structures. 'TSXAPIFN tsxERR tsxPolyhTessellate( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhTessellate Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Tell tS that this Polyhedron's Geometry has changed. 'TSXAPIFN void tsxPolyhMarkGeomChange( tsxPOLYHEDRON* pPolyh ); Declare Sub tsxPolyhMarkGeomChange Lib "tsxapi.dll" (ByVal pPolyh As Long) '// Tell tS that this Polyhedron's Topology has changed. 'TSXAPIFN void tsxPolyhMarkTopologyChange( tsxPOLYHEDRON* pPolyh ); Declare Sub tsxPolyhMarkTopologyChange Lib "tsxapi.dll" (ByVal pPolyh As Long) '// Tell tS that this Polyhedron's Material(s) have changed. '// Use after modifying UV entries, for example. 'TSXAPIFN void tsxPolyhMarkMaterialChange( tsxPOLYHEDRON* pPolyh ); Declare Sub tsxPolyhMarkMaterialChange Lib "tsxapi.dll" (ByVal pPolyh As Long) '// Tell tS that this Polyhedron's Vertex has changed. 'TSXAPIFN void tsxPolyhMarkVertexChange( tsxPOLYHEDRON* pPolyh , long vertex ); Declare Sub tsxPolyhMarkVertexChange Lib "tsxapi.dll" (ByVal pPolyh As Long) '// Get the number of vertices (0 if not a Polyhedron). 'TSXAPIFN int tsxPolyhGetNbrVxs( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhGetNbrVxs Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Get pointer to the array of vertices (0 if not a Polyhedron). '// The Vertex coordinates are in the frame defined by '// the Vertex Transformation Matrix. 'TSXAPIFN CtsxVector3f* tsxPolyhGetVxArray( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhGetVxArray Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Get the Vertex Transformation Matrix. Returns pTxmx, if valid operation. '// Note: This matrix includes scaling and shearing terms, so it is not '// guaranteed to be orthogonal. Use `tsxUnMatrix3f' before inverting. 'TSXAPIFN CtsxTxmx3f* tsxPolyhGetVxTxmx( 'tsxPOLYHEDRON* pPolyh, 'CtsxTxmx3f* pTxmx ); //ptr to Txmx where result is copied. Declare Function tsxPolyhGetVxTxmx Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByRef pTxmx As CtsxTxmx3f) As Long '// Assign a new vertex array to the Polyhedron. '// The corresponding field in pPolyh is set to pVxs. '// Clears old Vx array and frees memory, if any. '// Note: Use the TSXAPI memory routines (tsxMisc.h) to allocate '// the memory area (pVxs) for the Vertex Array '// -- DO NOT use `new' or `malloc/calloc'! 'TSXAPIFN void tsxPolyhSetVxs( 'tsxPOLYHEDRON* pPolyh, 'int iNbrVxs, // Number of Vxs (>= 0) 'CtsxVector3f pVxs[] ); // ptr to Array. May be 0. Declare Sub tsxPolyhSetVxs Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByVal iNbrVxs As Long, _ ByVal pVxs As Long) '// Copies a new Vertex Transformation Matrix into pPolyh. 'TSXAPIFN void tsxPolyhSetVxTxmx( ' tsxPOLYHEDRON* pPolyh, ' CtsxTxmx3f* pTxmx ); //ptr to new Txmx copied into Polyh. Declare Sub tsxPolyhSetVxTxmx Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByRef pTxmx As CtsxTxmx3f) '// Allocate a new face structure 'TSXAPIFN CtsxFace* tsxFaceAlloc(); Declare Function tsxFaceAlloc Lib "tsxapi.dll" () As Long '// Delete's pFace and all related structures. 'TSXAPIFN void tsxFaceDelete( CtsxFace* pFace ); Declare Sub tsxFaceDelete Lib "tsxapi.dll" (ByVal pFace As Long) '// Allocates new Face structure, assigning it to ppFaceCopy, '// and Copies pFace and all related structures into it. 'TSXAPIFN tsxERR tsxFaceCopy( CtsxFace** ppFaceCopy, CtsxFace* pFace ); Declare Function tsxFaceCopy Lib "tsxapi.dll" (ByRef ppFaceCopy As Long, ByVal pFace As Long) As Long '// Get the number of Faces (0 if not a Polyhedron). 'TSXAPIFN int tsxPolyhGetNbrFaces( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhGetNbrFaces Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Get pointer to the array of Face-ptrs (0 if not a Polyhedron). 'TSXAPIFN CtsxFace** tsxPolyhGetFaceptrArray( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhGetFaceptrArray Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Assign a new Face-ptr array to the Polyhedron. '// The corresponding field in pPolyh is set to pFaces. '// Clears old Faces and array and frees memory, if any. '// Note: Use the TSXAPI memory routines (tsxMisc.h) to allocate '// the memory area (pFaces) for the Face Array '// -- DO NOT use `new' or `malloc/calloc'! 'TSXAPIFN void tsxPolyhSetFaces( 'tsxPOLYHEDRON* pPolyh, 'int iNbrFaces, // Number of Faces (>= 0) 'CtsxFace* pFaces[] ); // Array of ptrs. May be 0. Declare Sub tsxPolyhSetFaces Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByVal iNbrFaces As Long, _ ByVal pFaces As Long) '// Uses pFace->normVxs to compute face normal of pFace in pPolyh. '// Normal returned in pNorm, in the frame defined by the '// Vertex Transformation Matrix. 'TSXAPIFN void tsxPolyhGetFaceNormal( 'tsxPOLYHEDRON* pPolyh, 'CtsxFace* pFace, 'CtsxVector3f* pNorm ); //ptr to struct where result is copied. Declare Sub tsxPolyhGetFaceNormal Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByVal pFace As Long, _ ByRef pNorm As CtsxVector3f) '// Sets up the `nextfaceix' fields in CtsxFaceVx structs. '// Call after all the other Face-Vertex data has been set for all faces. 'TSXAPIFN tsxERR tsxPolyhComputeFaceAdjacency( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhComputeFaceAdjacency Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Get the number of entries in UV-array (0 if not a Polyhedron). 'TSXAPIFN int tsxPolyhGetNbrUV( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhGetNbrUV Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Get pointer to the UV-array (0 if not a Polyhedron). 'TSXAPIFN CtsxUV* tsxPolyhGetUVArray( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhGetUVArray Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Assign a new UV array to the Polyhedron. '// The corresponding field in pPolyh is set to pUV. '// Clears old Faces and array and frees memory, if any. '// Note: Use the TSXAPI memory routines (tsxMisc.h) to allocate '// the memory area (pUV) for the UV Array -- DO NOT use `new' or `malloc/calloc'! 'TSXAPIFN void tsxPolyhSetUVArray( 'tsxPOLYHEDRON* pPolyh, 'int iNbrUV, // Number of UV entries (>= 0) 'CtsxUV *pUV ); // ptr to UV-Array. May be 0. Declare Sub tsxPolyhSetUVArray Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByVal iNbrUV As Long, _ ByVal pUV As Long) '// Assigns active material to entire Polyhedron. '// Call this function AFTER setting/modifying a polyhedron's geometry, '// and BEFORE painting faces or vertices. '// Use other material functions to specify specific materials. 'TSXAPIFN tsxERR tsxPolyhInitializeMaterials( tsxPOLYHEDRON* pPolyh ); Declare Function tsxPolyhInitializeMaterials Lib "tsxapi.dll" (ByVal pPolyh As Long) As Long '// Give entire pPolyh the material pMatrl. Remove old materials. '// Note: A copy of pMatrl is created and assigned to the Polyhedron. '// Caller is responsible for managing pMatrl. 'TSXAPIFN void tsxPolyhPaint( tsxPOLYHEDRON* pPolyh, tsxMATERIAL* pMatrl ); Declare Sub tsxPolyhPaint Lib "tsxapi.dll" (ByVal pPolyh As Long, ByVal pMatrl As Long) '// Paint face with a material. '// Returns e_tsxFALSE on failure or if object not changed. '// Note: A copy of pMatrl is created and assigned to the Polyhedron. '// Caller is responsible for managing pMatrl. 'TSXAPIFN tsxBOOL tsxPolyhPaintFace( 'tsxPOLYHEDRON* pPolyh, 'int iFaceIndex, //Index of face to be painted in pPolyh 'tsxMATERIAL* pMatrl, //New material to paint on face 'tsxBOOL bClearVxColors //e_tsxTRUE if Vertex colors should be cleared. '); Declare Function tsxPolyhPaintFace Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByVal iFaceIndex As Long, _ ByVal pMatrl As Long, _ bClearVxColors As tsxBool) As tsxBool '// Paint vertex with a color. '// Returns e_tsxFALSE on failure or if object not changed. '// Note: A copy of pColor is created and assigned to the Polyhedron. '// Caller is responsible for managing pColor. 'TSXAPIFN tsxBOOL tsxPolyhPaintVertex( 'tsxPOLYHEDRON* pPolyh, 'int iVxIndex, //Index of face to be painted in pPolyh 'CtsxColor* pColor //New color to paint on face '); Declare Function tsxPolyhPaintVertex Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByVal iVxIndex As Long, _ ByRef pColor As CtsxColor) As tsxBool '// Use this function to access the material assigned to a face. '// pMatrl is a pointer to a Material object created through one of the '// tsxMaterialCreate functions. The face's material, if any, is copied '// into this structure. '// Returns e_tsxFALSE on failure or if face does not have a material. 'TSXAPIFN tsxBOOL tsxPolyhGetMaterial( 'tsxPOLYHEDRON* pPolyh, 'unsigned short materialIdx, //From CtsxFace.materialIdx 'tsxMATERIAL* pMatrl //Material copied into this structure '); Declare Function tsxPolyhGetMaterial Lib "tsxapi.dll" ( _ ByVal pPolyh As Long, _ ByVal materialIdx As Integer, _ ByVal pMatrl As Long) As tsxBool '// Photo-render a face in the active view. 'TSXAPIFN tsxERR tsxPolyhPhrenderFace( tsxPOLYHEDRON* pPolyh, int iFaceIndex ); Declare Function tsxPolyhPhrenderFace Lib "tsxapi.dll" (ByVal pPolyh As Long, ByVal iFaceIndex As Integer) As Long '// Creates a sphere sitting on the XY plane, with Z as the vertical axis. 'TSXAPIFN tsxPOLYHEDRON* tsxCreateSphere( 'int NbrLongitudes, // # Longs (Min = 3) 'int NbrLattitudes, // # Latts (Min = 2) 'float radius ); Declare Function tsxCreateSphere Lib "tsxapi.dll" ( _ ByVal NbrLongitudes As Long, _ ByVal NbrLattitudes As Long, _ ByVal radius As Single) As Long '// Creates a Cylinder with the base in the XY plane and Z as the vertical axis. 'TSXAPIFN tsxPOLYHEDRON* tsxCreateCylinder( 'int NbrLongitudes, // # Longs (Min = 3) 'int NbrLattitudes, // # Latts (Min = 2) 'float topRadius, // Top radius 'float botRadius, // Base radius 'float height ); Declare Function tsxCreateCylinder Lib "tsxapi.dll" ( _ ByVal NbrLongitudes As Long, _ ByVal NbrLattitudes As Long, _ ByVal topRadius As Single, _ ByVal botRadius As Single, _ ByVal height As Single) As Long '// Creates a Cone (really a cylinder with a very very small top) '// with the base in the XY plae, and Z as the vertical axis. 'TSXAPIFN tsxPOLYHEDRON* tsxCreateCone( 'int NbrLongitudes, // # Longitudes (Min = 3) 'int NbrLattitudes, // # Lattitudes (Min = 2) 'float botRadius, // Base radius 'float height ); Declare Function tsxCreateCone Lib "tsxapi.dll" ( _ ByVal NbrLongitudes As Long, _ ByVal NbrLattitudes As Long, _ ByVal botRadius As Single, _ ByVal height As Single) As Long '// Creates a cube aligned with the World axes. 'TSXAPIFN tsxPOLYHEDRON* tsxCreateCube( 'int nbrSections, 'float x, 'float y, 'float z ); Declare Function tsxCreateCube Lib "tsxapi.dll" ( _ ByVal nbrSections As Long, _ ByVal x As Single, _ ByVal y As Single, _ ByVal z As Single) As Long '// Create a torus with Z as the axis. 'TSXAPIFN tsxPOLYHEDRON* tsxCreateTorus( 'int NbrLongitudes, // # Longitudes (Min = 3) 'int NbrLattitudes, // # Lattitudes (Min = 3) 'float innerRadius ); // Inner radius (0 < radius < 1.0) Declare Function tsxCreateTorus Lib "tsxapi.dll" ( _ ByVal NbrLongitudes As Long, _ ByVal NbrLatitudes As Long, _ ByVal innerRadius As Single) As Long '// Creates rectangular plane in XY plane. 'TSXAPIFN tsxPOLYHEDRON* tsxCreatePlane( 'int nbrXrects, // # rects in X direction (Min = 1) 'int nbrYrects ); // # rects in Y direction (Min = 1) Declare Function tsxCreatePlane Lib "tsxapi.dll" ( _ ByVal nbrXrects As Long, _ ByVal nbrYrects As Long) As Long '------------------------------------------------------------------------------ '// File: tsxSelect.h '// Descr: The Selection Mechanism Enum tsxSELECTMODE e_tsxSELECT '// Ordinary Selection of a Node. e_tsxERASE '// For selecting an object after erasing curr obj. e_tsxGLUE '// For selecting an object to attach to curr obj. End Enum '// e_tsxTRUE if pSobj is of supported selectable type (see doc above). 'TSXAPIFN tsxBOOL tsxIsSelectable( tsxSOBJ* pSobj ); Declare Function tsxIsSelectable Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// e_tsxTRUE if pSobj is part of a selected Object/Group 'TSXAPIFN tsxBOOL tsxIsSelected( tsxSOBJ* pSobj ); Declare Function tsxIsSelected Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Get pointer to the currently selected object. '// Note: trueSpace may select objects that are not currently supported in TSX. 'TSXAPIFN tsxSOBJ* tsxGetCurrentSelection(); Declare Function tsxGetCurrentSelection Lib "tsxapi.dll" () As Long '// Essentially same (with correct args) as picking an object with the mouse. '// Make specified pSobj the current selection. '// Set `bNoDraw' to e_tsxTRUE if you do not wish the object to be redrawn in '// "selected" mode. Use this feature carefully, as it might result in all '// or portions of the object being erased when the next object is selected. '// Primarily meant as a mechanism for temporarily selecting an object for '// operations, and to be followed by a scene refresh. 'TSXAPIFN void tsxSelectSobj( 'tsxSOBJ* pSobj, //Must be `tsxIsSelectable' 'tsxSELECTMODE selmode, 'tsxBOOL bNoDraw //TRUE if Views should not be updated. '); Declare Sub tsxSelectSobj Lib "tsxapi.dll" ( _ ByVal pSobj As Long, _ ByVal selmode As Long, _ ByVal bNoDraw As tsxBool _ ) '// Same function as called on the [downArrow] button. '// Selects a child of the Currobj. '// Views updated. 'TSXAPIFN void tsxSelectDown(); Declare Sub tsxSelectDown Lib "tsxapi.dll" () '// Same function as called on the [upArrow] button. '// Selects parent of Currobj. '// Views updated. 'TSXAPIFN void tsxSelectUp(); Declare Sub tsxSelectUp Lib "tsxapi.dll" () '// Same function as called on the <rightArrow> key. '// Selects a sibling of the Currobj, following Currobj in the list. '// Views updated. 'TSXAPIFN void tsxSelectNext(); Declare Sub tsxSelectNext Lib "tsxapi.dll" () '// Same function as called on the <leftArrow> key. '// Selects a sibling of the Currobj, preceeding Currobj in the list. '// Views updated. 'TSXAPIFN void tsxSelectPrev(); Declare Sub tsxSelectPrev Lib "tsxapi.dll" () '// Removes the current object and substitutes it with pNewGNode. '// If the selected part of the current object does not include it's children, '// the children are moved to the new object and removed from the current '// object, leaving the children non-selected. pNewGNode is installed in '// Currobj's location, and becomes the new Currobj. The old Currobj is deleted. 'TSXAPIFN void tsxCurrobjReplace( 'tsxGNODE* pNewGNode, 'tsxBOOL bNoDraw //TRUE if View displays should not be refreshed. '); Declare Sub tsxCurrobjReplace Lib "tsxapi.dll" (ByVal pNewGNode As Long, ByVal bNoDraw As Long) '// Copy curr obj and add to scene at top level, making it new currobj. 'TSXAPIFN tsxERR tsxCurrobjCopy(); Declare Function tsxCurrobjCopy Lib "tsxapi.dll" () As Long '// Draw the curr selection 'TSXAPIFN void tsxCurrobjDraw(); Declare Sub tsxCurrobjDraw Lib "tsxapi.dll" () '// Photo-render the current object in the active view. 'TSXAPIFN void tsxCurrobjPhrender(); Declare Sub tsxCurrobjPhrender Lib "tsxapi.dll" () '------------------------------------------------------------------------------ '// File: tsxAnim.h '// Descr: Animation Enum tsxKFRAME_TYPE e_tsxKFT_UNDEF ' // undefined e_tsxKFT_LOOK ' // look at object or ahead (valid only for tsxGNODE types) e_tsxKFT_ROTATE ' // object rotate (valid only for tsxGNODE types) e_tsxKFT_MOVE ' // object move (valid only for tsxGNODE types) e_tsxKFT_SCALE ' // object scale (valid only for tsxGNODE types) e_tsxKFT_DEFORM ' // object deformation (valid only for tsxLATTICE type) e_tsxKFT_RECT ' // material rectangle position and siza in UV space (valid only for tsxMATRECT type) e_tsxKFT_COLOR ' // color of material (valid only for tsxMATERIAL type) e_tsxKFT_SURFACE ' // shader of material (valid only for tsxMATERIAL type) e_tsxKFT_BUMP ' // bump mapping of material (valid only for tsxMATERIAL type) e_tsxKFT_TEXTURE ' // texture mapping of material (valid only for tsxMATERIAL type) e_tsxKFT_PROCTEX ' // procedural texture of material (valid only for tsxMATERIAL type) e_tsxKFT_ENVIRON ' // environment mapping of material (valid only for tsxMATERIAL type) e_tsxKFT_FACETCOS ' // autofacet angle of material (valid only for tsxMATERIAL type) e_tsxKFT_LCOLOR ' // color of light (valid only for tsxLIGHT type) e_tsxKFT_BACKGROUND ' // background (valid only for tsxSCENE type) e_tsxKFT_GLOBENV ' // global environment (valid only for tsxSCENE type) e_tsxKFT_FOG ' // fog (valid only for tsxSCENE type) e_tsxKFT_RAYTRACE ' // raytrace refraction (valid only for tsxSCENE type) e_tsxKFT_PLUGIN ' // Photoshop plugin (valid only for tsxPLUGIN type) e_tsxKFT_NAIL ' // position of nail (valid only for tsxNAIL type) e_tsxKFT_JOINT ' // joint parameters (valid only for tsxJOINT type) e_tsxKFT_KINEMATICS ' // inverse kinematics (valid only for tsxGROUP type) e_tsxKFT_VERTEX ' // vertex move (valid only for tsxPOLYHEDRON type) e_tsxKFT_INVISIBLE ' // invisibility (valid only for tsxPOLYHEDRON and tsxGROUP types) e_tsxKFT_END End Enum '// Creates and attaches a Script, if none present. 'TSXAPIFN tsxERR tsxSobjCreateScript( tsxSOBJ* pSobj ); Declare Function tsxSobjCreateScript Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Creates and attaches a Script, if none present. '// Obsolete for tS3.1 and later versions, kept for compatibility with tS3.0 'TSXAPIFN tsxERR tsxGNodeCreateScript( tsxGNODE* pGNode ); Declare Function tsxGNodeCreateScript Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Creates and attaches a Script, if none present for object and all its children 'TSXAPIFN tsxERR tsxSobjTreeCreateScript( tsxSOBJ* pSobj ); Declare Function tsxSobjTreeCreateScript Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Creates and attaches a Script, if none present for object and all its children '// Obsolete for tS3.1 and later versions, kept for compatibility with tS3.0 'TSXAPIFN tsxERR tsxGNodeCreateScriptTree( tsxGNODE* pGNode ); Declare Function tsxGNodeCreateScriptTree Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Deletes animation for the object 'TSXAPIFN tsxERR tsxSobjDeleteScript( tsxSOBJ* pSobj ); Declare Function tsxSobjDeleteScript Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Deletes animation for the object '// Obsolete for tS3.1 and later versions, kept for compatibility with tS3.0 'TSXAPIFN tsxERR tsxGNodeDeleteScript( tsxGNODE* pGNode ); Declare Function tsxGNodeDeleteScript Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Deletes animation for for object and all its children 'TSXAPIFN tsxERR tsxSobjTreeDeleteScript( tsxSOBJ* pSobj ); Declare Function tsxSobjTreeDeleteScript Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Deletes animation for for object and all its children '// Obsolete for tS3.1 and later versions, kept for compatibility with tS3.0 'TSXAPIFN tsxERR tsxGNodeDeleteScriptTree( tsxGNODE* pGNode ); Declare Function tsxGNodeDeleteScriptTree Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Copies animation of From object to destination To object 'TSXAPIFN tsxERR tsxSobjCopyScript( tsxSOBJ* pSobjTo, tsxSOBJ* pSobjFrom ); Declare Function tsxSobjCopyScript Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Copies animation of From object to destination To object '// Obsolete for tS3.1 and later versions, kept for compatibility with tS3.0 'TSXAPIFN tsxERR tsxGNodeCopyScript( tsxGNODE* pGNodeTo, tsxGNODE* pGNodeFrom ); Declare Function tsxGNodeCopyScript Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Tests for an empty animation of the object 'TSXAPIFN tsxBOOL tsxSobjEmptyScript( tsxSOBJ* pSobj ); Declare Function tsxSobjEmptyScript Lib "tsxapi.dll" (ByVal pSobj As Long) As Long '// Tests for an empty animation of the object and all its children 'TSXAPIFN tsxBOOL tsxSobjTreeEmptyScript( tsxSOBJ* pSobj ); Declare Function tsxSobjTreeEmptyScript Lib "tsxapi.dll" (ByVal pSobj As Long) As Long Enum tsxANIM_PLAYMODE e_tsxPLAY_SCENE ' // Update whole scene when ActiveTime changed. e_tsxPLAY_OBJECT ' // Update only selected object when ActiveTime changed. End Enum '// Set the active frame number for pGNode, related preparation. '// Obsolete for tS3.1 and later versions, kept for compatibility with tS3.0 '// Although it says that it sets frame number for specified GNode, '// it only changes the active frame number indicator without any change '// of GNode. 'TSXAPIFN void tsxAnimSetActiveFrame( tsxGNODE* pGNode, float frameNbr ); Declare Sub tsxAnimSetActiveFrame Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal frameNbr As Single) '// Set the active frame number. '// It updates whole scene according the new frame number. If there is an '// animated object in the scene, it may be changed to correspond its keyframes. '// So if an eXtension is animating the Sobj, it should repeat following three '// steps: '// 1/ set the active frame number, '// 2/ change animated attribute of Sobj (i.e. its position), '// 3/ create keyframe of the attribute in active frame number (see below). 'TSXAPIFN void tsxAnimSetActiveTime( float frameNbr ); Declare Sub tsxAnimSetActiveTime Lib "tsxapi.dll" (ByVal frameNbr As Single) '// Get the active frame number. 'TSXAPIFN float tsxAnimGetActiveTime( void ); Declare Function tsxAnimGetActiveTime Lib "tsxapi.dll" () As Single '// Specify callback function for a change of the active frame number. '// The function `func' will get called each time there is a change in the '// frame number, made by the normal trueSpace animation panels or through a '// call to one of the above functions for setting active time. Use 0 (NULL) '// to remove an installed callback. '// Returns the previous callback function pointer (or 0 if none). 'TSXAPIFN tsxBasicCallbackFP tsxActiveTimeChangedCB( 'int tsxid, // Id of this eXtn (see tsxGetData). 'tsxBasicCallbackFP func // This function gets installed as the callback. '); Declare Function tsxActiveTimeChangedCB Lib "tsxapi.dll" ( _ ByVal tsxid As Long, _ func As Long) As Long '// Set ranges for playback. 'TSXAPIFN void tsxAnimSetPlayRanges( float start, float end ); Declare Sub tsxAnimSetPlayRanges Lib "tsxapi.dll" (ByVal pStart As Single, ByVal pEnd As Single) '// Get ranges for playback. 'TSXAPIFN void tsxAnimGetPlayRanges( float* start, float* end ); Declare Sub tsxAnimGetPlayRanges Lib "tsxapi.dll" (ByRef pStart As Single, ByRef pEnd As Single) '// Set mode for playback. 'TSXAPIFN void tsxAnimSetPlayMode( tsxANIM_PLAYMODE mode ); Declare Sub tsxAnimSetPlayMode Lib "tsxapi.dll" (ByVal mode As tsxANIM_PLAYMODE) '// Get mode for playback. 'TSXAPIFN tsxANIM_PLAYMODE tsxAnimGetPlayMode( void ); Declare Function tsxAnimGetPlayMode Lib "tsxapi.dll" () As tsxANIM_PLAYMODE '// Run playback. 'TSXAPIFN tsxERR tsxAnimPlay( void ); Declare Function tsxAnimPlay Lib "tsxapi.dll" () As Long '// Get base framerate. 'TSXAPIFN float tsxAnimGetBaseFramerate(void); Declare Function tsxAnimGetBaseFramerate Lib "tsxapi.dll" () As Single '// Create Keyframe (at curr active frame nbr) for obj, for specified attributes. 'TSXAPIFN tsxERR tsxSobjSetFrame( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType ); Declare Function tsxSobjSetFrame Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE) As Long '// Create Keyframe (at curr active frame nbr) for obj, for specified attributes. '// Obsolete for tS3.1 and later versions, kept for compatibility with tS3.0 'TSXAPIFN tsxERR tsxGNodeSetFrame( tsxGNODE* pGNode, tsxKFRAME_TYPE keyfType ); Declare Function tsxGNodeSetFrame Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal keyfType As tsxKFRAME_TYPE) As Long '// Delete Keyframe (at curr active frame nbr) for obj, for specified attributes. 'TSXAPIFN tsxERR tsxSobjUnsetFrame( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType ); Declare Function tsxSobjUnsetFrame Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE) As Long '// Delete Keyframe (at curr active frame nbr) for obj, for specified attributes. '// Obsolete for tS3.1 and later versions, kept for compatibility with tS3.0 'TSXAPIFN tsxERR tsxGNodeUnsetFrame( tsxGNODE* pGNode, tsxKFRAME_TYPE keyfType ); Declare Function tsxGNodeUnsetFrame Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal keyfType As tsxKFRAME_TYPE) As Long '// Get time of the first frame for specified attribute if it exists (otherwise -1). 'TSXAPIFN float tsxSobjGetFirstTime( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType ); Declare Function tsxSobjGetFirstTime Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE) As Single '// Get time of the last frame for specified attribute if it exists (otherwise -1). 'TSXAPIFN float tsxSobjGetLastTime( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType ); Declare Function tsxSobjGetLastTime Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE) As Single '// Get time of the next frame for specified attribute if it exists (otherwise -1). 'TSXAPIFN float tsxSobjGetNextTime( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, float time ); Declare Function tsxSobjGetNextTime Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal time As Single) As Single '// Get time of the previous frame for specified attribute if it exists (otherwise -1). 'TSXAPIFN float tsxSobjGetPrevTime( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, float time ); Declare Function tsxSobjGetPrevTime Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal time As Single) As Single '// Get time of the closest next frame for specified attribute for whole tree if it exists (otherwise -1). 'TSXAPIFN float tsxSobjTreeGetNextTime( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, float time ); Declare Function tsxSobjTreeGetNextTime Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal time As Single) As Single '// Get time of the closest previous frame for specified attribute for whole tree if it exists (otherwise -1). 'TSXAPIFN float tsxSobjTreeGetPrevTime( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, float time ); Declare Function tsxSobjTreeGetPrevTime Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal time As Single) As Single '// Get time ranges of whole animation of Sobj. 'TSXAPIFN tsxERR tsxSobjGetMinMaxTime( tsxSOBJ* pSobj, float* min, float* max ); Declare Function tsxSobjGetMinMaxTime Lib "tsxapi.dll" (ByVal pSobj As Long, ByRef min As Single, ByRef max As Single) As Long '// Get time ranges of whole animation of Sobj and all its children. 'TSXAPIFN tsxERR tsxSobjTreeGetMinMaxTime( tsxSOBJ* pSobj, float* min, float* max ); Declare Function tsxSobjTreeGetMinMaxTime Lib "tsxapi.dll" (ByVal pSobj As Long, ByRef min As Single, ByRef max As Single) As Long '// Create Keyframe for specified attribute. 'TSXAPIFN tsxERR tsxFrameCreate( tsxKEYFRAME** ppKFrame, tsxKFRAME_TYPE keyfType ); Declare Function tsxFrameCreate Lib "tsxapi.dll" (ByRef ppKFrame As Long, ByVal keyfType As tsxKFRAME_TYPE) As Long '// Delete Keyframe. 'TSXAPIFN void tsxFrameDelete( tsxKEYFRAME* pKFrame ); Declare Sub tsxFrameDelete Lib "tsxapi.dll" (ByVal pKFrame As Long) '// Get attribute of Keyframe. 'TSXAPIFN tsxKFRAME_TYPE tsxFrameGetType( tsxKEYFRAME* pKFrame ); Declare Function tsxFrameGetType Lib "tsxapi.dll" (ByVal pKFrame As Long) As tsxKFRAME_TYPE '// Get name of attribute. 'TSXAPIFN const char* tsxAnimGetTypeName( tsxKFRAME_TYPE keyfType ); Declare Function tsxAnimGetTypeName Lib "tsxapi.dll" (ByVal keyfType As tsxKFRAME_TYPE) As String '// Copy Keyframe. 'TSXAPIFN tsxERR tsxFrameCopy( tsxKEYFRAME* pKFrame, tsxKEYFRAME** ppKFrameCopy ); Declare Function tsxFrameCopy Lib "tsxapi.dll" (ByVal pKFrame As Long, ByRef ppKFrameCopy As Long) As Long '// Add Keyframe to obj, for specified attribute (and optional segment). 'TSXAPIFN tsxERR tsxSobjInsertFrame( tsxSOBJ* pSobj, tsxKEYFRAME* pKFrame , long segment, float time ); Declare Function tsxSobjInsertFrame Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal pKFrame As Long, ByVal segment As Long, ByVal time As Single) As Long '// Remove Keyframe from whatever list it is in. 'TSXAPIFN void tsxFrameRemove( tsxKEYFRAME* pKFrame ); Declare Sub tsxFrameRemove Lib "tsxapi.dll" (ByVal pKFrame As Long) '// Get first Keyframe of obj, for specified attribute (and optional segment). 'TSXAPIFN tsxKEYFRAME* tsxSobjGetFirstFrame( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, long segment ); Declare Function tsxSobjGetFirstFrame Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal segment As Long) As Long '// Get last Keyframe of obj, for specified attribute (and optional segment). 'TSXAPIFN tsxKEYFRAME* tsxSobjGetLastFrame( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, long segment ); Declare Function tsxSobjGetLastFrame Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal segment As Long) As Long '// Get Keyframe at specified time for specified attribute (and optional segment) if it exists. 'TSXAPIFN tsxKEYFRAME* tsxSobjGetFrame( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, long segment, float time ); Declare Function tsxSobjGetFrame Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal segment As Long, ByVal time As Single) As Long '// Get closest previous (to specified time) Keyframe of obj, for specified attribute (and optional segment). 'TSXAPIFN tsxKEYFRAME* tsxSobjGetLeftFrame( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, long segment, float time ); Declare Function tsxSobjGetLeftFrame Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal segment As Long, ByVal time As Single) As Long '// Get next Keyframe. 'TSXAPIFN tsxKEYFRAME* tsxFrameGetNextFrame( tsxKEYFRAME* pKFrame ); Declare Function tsxFrameGetNextFrame Lib "tsxapi.dll" (ByVal pKFrame As Long) As Long '// Get previous Keyframe. 'TSXAPIFN tsxKEYFRAME* tsxFrameGetPrevFrame( tsxKEYFRAME* pKFrame ); Declare Function tsxFrameGetPrevFrame Lib "tsxapi.dll" (ByVal pKFrame As Long) As Long '// Get frame number of Keyframe. 'TSXAPIFN float tsxFrameGetTime( tsxKEYFRAME* pKFrame ); Declare Function tsxFrameGetTime Lib "tsxapi.dll" (ByVal pKFrame As Long) As Single '// There is no symmetrical routine: tsxFrameSetTime '// To change the time (frame number) of the keyframe use tsxSobjInsertFrame with desired time. '// It removes the keyframe from current place and inserts it to proper place to keep '// all keyframes sorted by time. '// Get spline parameters of Keyframe. 'TSXAPIFN tsxERR tsxFrameGetSplineParameters( tsxKEYFRAME* pKFrame, float* continuity, float* tension, float* bias ); Declare Function tsxFrameGetSplineParameters Lib "tsxapi.dll" (ByVal pKFrame As Long, ByRef continuity As Single, ByRef tension As Single, ByRef float As Single) As Long '// Set spline parameters of Keyframe. 'TSXAPIFN tsxERR tsxFrameSetSplineParameters( tsxKEYFRAME* pKFrame, float continuity, float tension, float bias ); Declare Function tsxFrameSetSplineParameters Lib "tsxapi.dll" (ByVal pKFrame As Long, ByVal continuity As Single, ByVal tension As Single, ByVal float As Single) As Long '// Get length of Keyframe data. 'TSXAPIFN long tsxFrameGetDataLength( tsxKEYFRAME* pKFrame ); Declare Function tsxFrameGetDataLength Lib "tsxapi.dll" (ByVal pKFrame As Long) As Long '// Get description of Keyframe data. Returns size of description. 'TSXAPIFN long tsxFrameGetDataDescription( tsxKEYFRAME* pKFrame, short** ppDescr ); Declare Function tsxFrameGetDataDescription Lib "tsxapi.dll" (ByVal pKFrame As Long, ByRef ppDescr As Long) As Long '// Get Keyframe data. 'TSXAPIFN long tsxFrameGetData( tsxKEYFRAME* pKFrame, void* pData, long length ); Declare Function tsxFrameGetData Lib "tsxapi.dll" (ByVal pKFrame As Long, ByVal pData As Long, ByVal length As Long) As Long '// Set Keyframe data. 'TSXAPIFN long tsxFrameSetData( tsxKEYFRAME* pKFrame, void* pData, long length ); Declare Function tsxFrameSetData Lib "tsxapi.dll" (ByVal pKFrame As Long, ByVal pData As Long, ByVal length As Long) As Long '// Get interpolated data for specified attribute (and optional segment) at specified time. 'TSXAPIFN long tsxSobjGetInterpolatedData( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, long segment, ' float time, void* pData, long length ); Declare Function tsxSobjGetInterpolatedData Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal segment As Long, _ ByVal time As Single, ByVal pData As Long, ByVal length As Long) As Long '// Function for extAnimSetOriginCB and extAnimPutOriginCB. 'typedef tsxERR (*tsxAnimOriginCallbackFP)( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType); '// Function for extAnimSetFrameCB, extAnimUnSetFrameCB and extAnimPutFrameCB. 'typedef tsxERR (*tsxAnimFrameCallbackFP)( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, float time); 'typedef struct { '// To store original value of Attribute of Sobj (may not be specified). 'tsxAnimOriginCallbackFP extAnimSetOriginCB; '// To restore original value of Attribute of Sobj (may not be specified). 'tsxAnimOriginCallbackFP extAnimPutOriginCB; '// To create Keyframe(s) of keyfType for Sobj at specified time. 'tsxAnimFrameCallbackFP extAnimSetFrameCB; '// To delete Keyframe(s) of keyfType for Sobj at specified time (may not be specified). 'tsxAnimFrameCallbackFP extAnimUnSetFrameCB; '// To update Attribute of Sobj according Keyframes of keyfType at specified time. 'tsxAnimFrameCallbackFP extAnimPutFrameCB; '} tsxAnimCallbackFP; Type tsxAnimCallbackFP '// To store original value of Attribute of Sobj (may not be specified). extAnimSetOriginCB As Long '// To restore original value of Attribute of Sobj (may not be specified). extAnimPutOriginCB As Long '// To create Keyframe(s) of keyfType for Sobj at specified time. extAnimSetFrameCB As Long '// To delete Keyframe(s) of keyfType for Sobj at specified time (may not be specified). extAnimUnSetFrameCB As Long '// To update Attribute of Sobj according Keyframes of keyfType at specified time. extAnimPutFrameCB As Long End Type '// Register an attribute among attributes that may be animated. 'TSXAPIFN tsxKFRAME_TYPE tsxAnimCreateAttribute( 'int tsxid, // eXtension id 'char* name, // name of the attribute (max 16 characters) 'tsxAnimCallbackFP* attrCallback, // callback functions for the attribute 'long attrDataLength, // length of stored original data (may be 0L) 'short* kfDataDescription, // description of keyframe data (see below) 'long kfDataDescriptionSize // length of description array '); Declare Function tsxAnimCreateAttribute Lib "tsxapi.dll" ( _ ByVal tsxid As Long, _ ByVal name As String, _ ByVal attrCallback As Long, _ ByRef kfDataDescription As Integer, _ ByVal kfDataDescriptionSize As Long) As tsxKFRAME_TYPE '// Allow an animation of specified attribute for Sobj. 'TSXAPIFN tsxERR tsxSobjAddAttribute( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType ); Declare Function tsxSobjAddAttribute Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE) As Long '// Get the first attribute of Sobj. 'TSXAPIFN tsxKFRAME_TYPE tsxSobjGetFirstAttribute( tsxSOBJ* pSobj ); Declare Function tsxSobjGetFirstAttribute Lib "tsxapi.dll" (ByVal pSobj As Long) As tsxKFRAME_TYPE '// Get the next attribute of Sobj. 'TSXAPIFN tsxKFRAME_TYPE tsxSobjGetNextAttribute( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType ); Declare Function tsxSobjGetNextAttribute Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE) As tsxKFRAME_TYPE '// Test for attribute of Sobj. 'TSXAPIFN tsxBOOL tsxSobjHasAttribute( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType ); Declare Function tsxSobjHasAttribute Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE) As Long '// Get the first segment of attribute of Sobj. 'TSXAPIFN long tsxSobjGetFirstSegment( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType ); Declare Function tsxSobjGetFirstSegment Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE) As Long '// Get the next segment of attribute of Sobj. 'TSXAPIFN long tsxSobjGetNextSegment( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, long segment ); Declare Function tsxSobjGetNextSegment Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal segment As Long) As Long '// Attribute data descriptor '//------------------------------------------------------------------------ '// Descriptor for allowing attribute to animate over time. A structure of '// this type is added with each attribute that the eXtension animates to '// describe the data structure of its parameters. Specify pdOpaque for any '// non-scalar data in the record, or data that you don't want trueSpace to '// interpolate for you. Make the DataDescription describe all the bytes of '// the parameter block. '//----------------------------------------------------------------------- '// Specifies the type of the data #Const pdOpaque = 0 '// Opaque, meaning don't interpolate this. Followed by count of bytes to skip '// with pdOpaque, eg, pdOpaque, 4 '// If it is followed by 0, it terminates the description. #Const pdChar = 1 '// Interpolate as signed byte #Const pdShort = 2 '// Interpolate as signed short #Const pdLong = 3 '// Interpolate as signed long #Const pdUnsignedChar = 4 '// Interpolate as unsigned byte #Const pdUnsignedShort = 5 '// Interpolate as unsigned short #Const pdUnsignedLong = 6 '// Interpolate as unsigned long #Const pdDouble = 8 '// Interpolate as a double #Const pdFloat = 9 '// Interpolate as a float '// Get length of Attribute data. 'TSXAPIFN long tsxSobjGetAttrDataLength( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType); Declare Function tsxSobjGetAttrDataLength Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal segment As Long) As Long '// Get Attribute data. 'TSXAPIFN long tsxSobjGetAttrData( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, void* pData, long length); Declare Function tsxSobjGetAttrData Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal pData As Long, ByVal length As Long) As Long '// Set Attribute data. 'TSXAPIFN long tsxSobjSetAttrData( tsxSOBJ* pSobj, tsxKFRAME_TYPE keyfType, void* pData, long length); Declare Function tsxSobjSetAttrData Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal keyfType As tsxKFRAME_TYPE, ByVal pData As Long, ByVal length As Long) As Long '------------------------------------------------------------------------------ '// File: tsxMisc.h '// Descr: Miscellaneous items '//------------------------------------------------------------------------------ '// Accessing an installed trueSpace's TSX Version Info '//------------------------------------------------------------------------------ '// An eXtension may want to confirm that it is compatible with the version of '// trueSpace it is being installed into (actually, compatible with the TSXAPI), '// by checking the version number of tsxapi.dll . '// '// Note on TSX API Version numbering scheme: '// Major is the major release version of trueSpace, in hundreds. '// For example, '// for trueSpace 3, Major = 300; '// for trueSpace 3.5 (should there be one) Major = 350. '// Minor is the minor release version of TSX API. '// Negative numbers in the minor refer to pre-release (alpha, beta) versions. '// '// To check compatibility, '// if a TSX requires any version on or after [baseMajor, baseMinor], '// check for: (Major >= baseMajor) && '// (Minor >= baseMinor) '// Accessing an installed trueSpace's TSX Version Info. Values placed in '// the arguments. 'TSXAPIFN void tsxGetTsVersionNbrs( 'short* pMajor, // Major version nbr 'short* pMinor // Minor version nbr '); Declare Sub tsxGetTsVersionNbrs Lib "tsxapi.dll" _ (ByRef pMajor As Integer, ByRef pMinor As Integer) '//------------------------------------------------------------------------------ '// Accessing The primary view-window client area '//------------------------------------------------------------------------------ '// Returns handle to the main view window. 'TSXAPIFN HWND tsxGetMainViewHwnd(void); Declare Function tsxGetMainViewHWND Lib "tsxapi.dll" () As Long '//------------------------------------------------------------------------------ '// Requesting (De)Activation '//------------------------------------------------------------------------------ '// Requests a left-click action on the extension's button (see tsxOnLeftClick). '// Useful when, e.g., an extension wants to leave a panel on the screen even '// when deactivated, and then requests re-activation when a button is clicked '// on this panel. Also useful to deactivate an active extension when user '// exits from extensions parameter panel. 'TSXAPIFN tsxERR tsxForceLeftClick( 'int tsxid // extension-id (see tsxGetData) '); Declare Function tsxForceLeftClick Lib "tsxapi.dll" (ByVal tsxid As Long) As Long '//------------------------------------------------------------------------------ '// Heap Memory '//------------------------------------------------------------------------------ '// Use these memory routines when allocating memory for trueSpace, '// e.g. vertex-array for Polyhedra (tsxPolyh.h). 'TSXAPIFN void* tsxMalloc( unsigned int size ); Declare Function tsxMalloc Lib "tsxapi.dll" (ByVal size As Long) As Long 'TSXAPIFN void* tsxCalloc( unsigned int num, unsigned int size ); Declare Function tsxCalloc Lib "tsxapi.dll" (ByVal num As Long, ByVal size As Long) As Long '// You MUST use the following two functions to reallocate or free '// memory blocks allocated by the above functions. 'TSXAPIFN void* tsxRealloc( void* memblock, unsigned int size ); Declare Function tsxRealloc Lib "tsxapi.dll" (ByVal memblock As Long, ByVal size As Long) As Long 'TSXAPIFN void tsxFree( void* memblock ); Declare Sub tsxFree Lib "tsxapi.dll" (ByVal memblock As Long) '------------------------------------------------------------------------------ '// File: tsxMouse.h '// Descr: Interface to the Mouse '// This is the interface to the Mouse-Tool in trueSpace. '// For an extension to receive mouse action messages, it must install '// the mouse-tool (using tsxMtoolInstall). '// See also picking functions in "tsxAView.h". '//------------------------------------------------------------------------------ '// Related Types and Definitions '//------------------------------------------------------------------------------ '// Internal data structure for managing the mouse tool. 'struct tsxMousetool {}; '// Callback type for mouse-tool message 'typedef BOOL (*tsxMtoolMsg)( 'tsxMousetool *mt, 'short msg, //see mouse-tool messages, below. 'short x, //mouse position on screen, viewport X coordinate. 'short y, //mouse position on screen, viewport Y coordinate. 'short data //additional data depending upon msg. '); '// Callback type for mouse events 'typedef BOOL (*tsxMtoolClick)( 'tsxMousetool *mt, 'short x, //mouse position on screen, viewport X coordinate. 'short y, //mouse position on screen, viewport Y coordinate. 'short flags //see mouse event flags, below. '); '// Mouse-tool messages #Const tsxMTM_ACTIVATE = 1 '//Mousetool is being activated. #Const tsxMTM_DEACTIVATE = 2 '//Mousetool is being deactivated. #Const tsxMTM_DESELECT = 3 '//Current object is being deselected. #Const tsxMTM_SELECT = 4 '//New current object has been selected. #Const tsxMTM_KEY = 5 '//Key has been pressed: char is in `data'. '// Return FALSE if key is used. #Const tsxMTM_CREATE = 6 '//Mousetool has been created. #Const tsxMTM_DESTROY = 7 '//Mousetool is being destroyed. #Const tsxMTM_ERASE = 8 '//Erase requested on currently selected object. '// If TRUE is returned the current object is deleted. #Const tsxMTM_CHECKCURSOR = 9 '//Called on WM_MOUSEMOVE, WM_KEYUP, WM_KEYDOWN. '// `data' contains mouse event flags. '// For Mouse-move, mouse coordinates are passed. '// Mouse event flags #Const tsxMTF_RIGHT = 1 '//Right mouse button clicked #Const tsxMTF_LEFT = 2 '//Left mouse button clicked #Const tsxMTF_SHIFT = 4 '//Shift key is pressed #Const tsxMTF_CTRL = 8 '//Control key is pressed #Const tsxMTF_OUTSIDE = 16384 '//Mouse is outside window (for drag operations) #Const tsxMTF_DBLCLK = 32768 '//Mouse button was double-clicked '//------------------------------------------------------------------------------ '// Management '//------------------------------------------------------------------------------ '// When a new mouse-tool is installed, `pMtoolMsgFunc' is called with the '// message tsxMTM_CREATE, and then with tsxMTM_ACTIVATE. The eXtension '// MUST be active at this time. '// A mouse-tool installed by an extension is removed before the extension is '// deactivated. It is also removed when trueSpace receives a new install request. '// Before a mouse-tool is removed, its message function `pMtoolMsgFunc' is '// called first with the message tsxMTM_DEACTIVATE and then with tsxMTM_DESTROY. '// '// Typical sequence of events: '// - User selects eXtn '// - eXtn is activated '// - eXtn installs mouse-tool '// - pMtoolMsgFunc called with message tsxMTM_CREATE '// - pMtoolMsgFunc called with message tsxMTM_ACTIVATE '// - ... handle mouse events ... '// - user selects another tS tool '// - pMtoolMsgFunc called with message tsxMTM_DEACTIVATE '// - pMtoolMsgFunc called with message tsxMTM_DESTROY '// - eXtn is deactivated (tsxDeactivate) '// - control switches to the new tool selected by user '// Installs the mouse-tool if the eXtension is active. '// Function pointers cannot be NULL. 'TSXAPIFN tsxERR tsxMtoolInstall( 'int tsxid, // extension-id (see tsxGetData) 'tsxMtoolMsg pMtoolMsgFunc, // mouse-tool-message callback 'tsxMtoolClick pMtoolEventFunc // mouse-event callback '); Declare Function tsxMtoolInstall Lib "tsxapi.dll" ( _ ByVal tsxid As Long, _ ByVal tsxMtoolMsg As Long, _ ByVal tsxMtoolClick As Long _ ) As Long '// Removes the mouse-tool installed by this extension, if any. '// Extension must be active. 'TSXAPIFN void tsxMtoolRemove( int tsxid ); Declare Sub tsxMtoolRemove Lib "tsxapi.dll" (ByVal tsxid As Long) '------------------------------------------------------------------------------ '// File: tsxAView.h '// Descr: Interface to the Active View '// This is the interface to the active viewport and its "eye" attributes. '// The Active Viewport is the currently active view into the scene. '// Eye attributes: '// - Position '// - Bank angle w.r.t. the world X axis '// - "Look at" direction '// - Zoom '// The eye's frame is similar to that of a Camera, with the Z axis pointing '// out into the scene, and the Y axis pointing up. '// See also "tsxCamra.h" and "tsxMouse.h". '//------------------------------------------------------------------------------ '// Related Types '//------------------------------------------------------------------------------ '// Rendering modes Enum tsxRENDERMODE e_tsxRM_UNDEF e_tsxRM_WIRE '//Wire-frame e_tsxRM_3DR '//3DR e_tsxRM_D3D '//Direct3D End Enum '// Viewing modes Enum tsxVIEWMODE e_tsxVM_PERSPECTIVE e_tsxVM_TOP e_tsxVM_FRONT e_tsxVM_LEFT e_tsxVM_CAMERA '//Look through an object or camera End Enum '//------------------------------------------------------------------------------ '// Refreshing the Active View '//------------------------------------------------------------------------------ '// Use this function to refresh the active view of the scene after changing '// the view's attributes. 'TSXAPIFN void tsxAViewRefresh(); Declare Sub tsxAViewRefresh Lib "tsxapi.dll" () '//------------------------------------------------------------------------------ '// Refreshing All Views Simultaneously '//------------------------------------------------------------------------------ '// Use this function to refresh all views of the scene simultaneously 'TSXAPIFN void tsxAllViewsRefresh(); Declare Sub tsxAllViewsRefresh Lib "tsxapi.dll" () '//------------------------------------------------------------------------------ '// Render and View Mode '//------------------------------------------------------------------------------ '// Get the rendering mode of the active view. 'TSXAPIFN tsxRENDERMODE tsxAViewGetRenderMode(); Declare Function tsxAViewGetRenderMode Lib "tsxapi.dll" () As tsxRENDERMODE '// Get the view mode for the active view. 'TSXAPIFN tsxVIEWMODE tsxAViewGetViewMode(); Declare Function tsxAViewGetViewMode Lib "tsxapi.dll" () As tsxVIEWMODE '// Change the view mode for teh active view. '// If newmode is e_tsxVM_CAMERA, it is set to look through the currently '// selected object, if any. Useful with Cameras and Lights. '// Returns: e_tsxTRUE if there is a change in mode. 'TSXAPIFN tsxBOOL tsxAViewSetViewMode( tsxVIEWMODE newmode ); Declare Function tsxAViewSetViewMode Lib "tsxapi.dll" (ByVal newmode As tsxVIEWMODE) As Long '// Make the active view look through an object (pGNode), until further notice. '// In this mode, any changes to the eye's position, orientation and direction '// will also be transmitted to the object. 'TSXAPIFN tsxERR tsxAViewSetCameraMode( tsxGNODE* pGNode ); Declare Function tsxAViewSetCameraMode Lib "tsxapi.dll" (ByVal pGNode As Long) As Long '// Turn off the camera mode, removing the constraint on the active view '// to look through an object. The current view of the scene is not changed. 'TSXAPIFN void tsxAViewUnsetCameraMode(); Declare Sub tsxAViewUnsetCameraMode Lib "tsxapi.dll" () '// Get pointer to the object that the active view is currently constrained '// to look through, if any. 'TSXAPIFN tsxSOBJ* tsxAViewGetCameraObj(); Declare Function tsxAViewGetCameraObj Lib "tsxapi.dll" () As Long '//------------------------------------------------------------------------------ '// Eye attributes '//------------------------------------------------------------------------------ '// Get the eye position (copied into `posn') in world coordinates 'TSXAPIFN void tsxAViewGetPosition( CtsxVector3f* posn ); Declare Sub tsxAViewGetPosition Lib "tsxapi.dll" (ByRef posn As CtsxVector3f) '// Get the direction in which the view is pointed, as a normalized '// vector relative to its position (copied into `dirn') 'TSXAPIFN void tsxAViewGetDirection( CtsxVector3f* dirn ); Declare Sub tsxAViewGetDirection Lib "tsxapi.dll" (ByRef dirn As CtsxVector3f) '// Get the Bank angle 'TSXAPIFN float tsxAViewGetBankAngle(); Declare Function tsxAViewGetBankAngle Lib "tsxapi.dll" () As Single '// Get the Zoom 'TSXAPIFN float tsxAViewGetZoom(); Declare Function tsxAViewGetZoom Lib "tsxapi.dll" () As Single '// Use this function to change the position and direction of the active '// view's "eye". A NULL value for `pEyePosn' or `pLookAt' indicates no '// change in that parameter. 'TSXAPIFN void tsxAViewSetView( 'CtsxVector3f* pEyePosn, //New position of eye, in world coordinates 'CtsxVector3f* pLookAt, //New point at which eye should point, in world coord 'tsxBOOL bLevelIt //e_tsxTRUE if eye's horizontal axis should be made '// parallel to world X, otherwise current bank angle '// with world-X is maintained. '); Declare Sub tsxAViewSetView Lib "tsxapi.dll" ( _ ByRef pEyePosn As CtsxVector3f, _ ByRef pLookAt As CtsxVector3f, _ bLevelIt As Long) '// Change the bank angle between the view's horizontal axis and the world X axis. 'TSXAPIFN void tsxAViewSetBank( float bankAngle ); Declare Sub tsxAViewSetBank Lib "tsxapi.dll" (ByVal bankAngle As Single) '// Change the active view's zoom (clamped to allowed min/max values). '// Returns: the new zoom value. 'TSXAPIFN float tsxAViewSetZoom( float newzoom ); Declare Function tsxAViewSetZoom Lib "tsxapi.dll" (ByVal newzoom As Single) As Single '//------------------------------------------------------------------------------ '// Frame relationships '//------------------------------------------------------------------------------ '// Matrix for transforming world coordinates to viewport (screen) coordinates. '// Returns: pTxmx. 'TSXAPIFN CtsxTxmx3f* tsxAViewGetWorld2VportTxmx( CtsxTxmx3f* pTxmx ); Declare Function tsxAViewGetWorld2VportTxmx Lib "tsxapi.dll" (ByRef pTxmx As CtsxTxmx3f) As Long '// Matrix for transforming world coordinates to view's Eye coordinates. '// Returns: pTxmx. 'TSXAPIFN CtsxTxmx3f* tsxAViewGetWorld2EyeTxmx( CtsxTxmx3f* pTxmx ); Declare Function tsxAViewGetWorld2EyeTxmx Lib "tsxapi.dll" (ByRef pTxmx As CtsxTxmx3f) As Long '// Matrix for transforming view's Eye coordinates to world coordinates '// (inverse of the World-to-Eye matrix). '// Returns: pTxmx. 'TSXAPIFN CtsxTxmx3f* tsxAViewGetEye2WorldTxmx( CtsxTxmx3f* pTxmx ); Declare Function tsxAViewGetEye2WorldTxmx Lib "tsxapi.dll" (ByRef pTxmx As CtsxTxmx3f) As Long '// Computes a ray pointing from the eye's viewpoint through the mouse point. '// The ray is returned in pRayOrigin and pRayDirn, the latter giving the '// direction as a normalized vector pointing from pRayOrigin. '// Any of the output arguments may be NULL, if that value is not desired. 'TSXAPIFN void tsxAViewGetMouseRay( 'short mousePtX, //IN: mouse X coordinate (in screen space) 'short mousePtY, //IN: mouse Y coordinate 'CtsxVector3f* pRayOrigin, //OUT: Eye location for active view 'CtsxVector3f* pRayDirn //OUT: Normalized direction from pRayOrigin '); Declare Sub tsxAViewGetMouseRay Lib "tsxapi.dll" ( _ ByVal mousePtX As Integer, _ ByVal mousePtY As Integer, _ ByRef pRayOrigin As CtsxVector3f, _ ByRef pRayDirn As CtsxVector3f _ ) '//------------------------------------------------------------------------------ '// Picking '//------------------------------------------------------------------------------ '// Pick the Root object in scene containing the object under the mouse. '// A Root object has the scene as its parent. '// Returns: e_tsxTRUE on successful pick. 'TSXAPIFN tsxBOOL tsxAViewPickRoot( 'short x, //Screen coordinates of mouse 'short y, 'tsxSOBJ** ppSobj //OUT: Ptr to root object containing picked object. '); Declare Function tsxAViewPickRoot Lib "tsxapi.dll" ( _ ByVal x As Integer, _ ByVal y As Integer, _ ByRef ppSobj As Long _ ) As Long '// Picking nearest one of MNode's vertices under the mouse, if any. '// If pMNode is 0 (null) then all objects in scene are tested. '// Returns: e_tsxTRUE on successful pick. 'TSXAPIFN tsxBOOL tsxAViewPickVertex( 'tsxMNODE* pMNode, //Must be a Group or Polyhedron. 0 = all objs in scene. 'short x, //Screen coordinates of mouse 'short y, 'tsxPOLYHEDRON** ppPolyh, //OUT: Polyhderon whose vertex picked 'int* pVxIndex //OUT: Index of picked vertex in pPolyh '); Declare Function tsxAViewPickVertex Lib "tsxapi.dll" ( _ ByVal pMNode As Long, _ ByVal x As Integer, _ ByVal y As Integer, _ ByRef ppPolyh As Long, _ ByRef pVxIndex As Long _ ) As Long '// Picks nearest one of MNode's faces under the mouse, if any. '// If pMNode is 0 (null) then all objects in scene are tested. '// Returns: e_tsxTRUE on successful pick. 'TSXAPIFN tsxBOOL tsxAViewPickFace( 'tsxMNODE* pMNode, //Must be a Group or Polyhedron. 0 = all objs in scene. 'short x, //Screen coordinates of mouse 'short y, 'tsxPOLYHEDRON** ppPolyh, //OUT: Polyhderon whose face picked 'int* pFxIndex, //OUT: Index of picked face in pPolyh 'float* pFxDist //OUT: Distance to picked face '); Declare Function tsxAViewPickFace Lib "tsxapi.dll" ( _ ByVal pMNode As Long, _ ByVal x As Integer, _ ByVal y As Integer, _ ByRef ppPolyh As Long, _ ByRef pFxIndex As Long, _ ByRef pFxDist As Single _ ) As Long '//------------------------------------------------------------------------------ '// Miscellaneous '//------------------------------------------------------------------------------ '// Handle to the active view's window 'TSXAPIFN HWND tsxAViewGetHwnd(); Declare Function tsxAViewGetHwnd Lib "tsxapi.dll" () As Long '------------------------------------------------------------------------------