home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 March / Chip_1998-03_cd.bin / tema / TS3 / Caligari / pluSpack1 / primitiveitch / atf10.exe / TsxApi.bas < prev    next >
Encoding:
BASIC Source File  |  1997-11-05  |  43.9 KB  |  1,097 lines

  1. Attribute VB_Name = "TsxApi"
  2. '------------------------------------------------------------------------------
  3. ' VbTsxApi
  4. ' v.1.1
  5. '
  6. ' VB5 Declarations for
  7. ' TsxAPI 3.1
  8. '
  9. ' v1.0 - 10/21/97
  10. ' v1.1 - 12/04/97
  11. '------------------------------------------------------------------------------
  12.  
  13. '------------------------------------------------------------------------------
  14. '//    File: tsxTypes.h
  15. '//   Descr: Basic data types used in most places
  16.  
  17. '// Return type for functions that test a condition.
  18. Enum tsxBool
  19.     e_tsxFALSE = 0
  20.     e_tsxTRUE
  21. End Enum
  22.  
  23. '// Return type for functions that simply report success or failure.
  24. Enum tsxRET
  25.     e_tsxFAILURE = 0
  26.     e_tsxSUCCESS
  27. End Enum
  28.  
  29. '// Return type for functions that return an error code when they fail.
  30. '// These are documented in "tsxErr.h".
  31. 'typedef int tsxERR;
  32.  
  33. '//  Geometry
  34.  
  35. '// Reference Frames: World or Model
  36. Enum tsxFRAMEID
  37.     e_tsxWorldFrame
  38.     e_tsxModelFrame
  39. End Enum
  40.  
  41. '// Specifying Vectors and Points
  42. Type CtsxVector2f
  43.     x As Single
  44.     y As Single
  45. End Type
  46.  
  47. Type CtsxVector3f
  48.     x As Single
  49.     y As Single
  50.     z As Single
  51. End Type
  52.  
  53. '// Specifying axes.
  54. Type CtsxAxes3f
  55.     xAxis As CtsxVector3f '//Unit vector specifying orientation of Model's X axis.
  56.     yaxis As CtsxVector3f  '// ... Y ...
  57.     zAxis As CtsxVector3f  '// ... Z ...
  58. End Type
  59.  
  60. '// Transformation Matrix.
  61. Type CtsxTxmx3f
  62.     matrix(0 To 3, 0 To 2) As Single
  63. End Type
  64.  
  65. '// Bounding Box.
  66. Type CtsxBBox3f
  67.     minbounds As CtsxVector3f
  68.     maxbounds As CtsxVector3f
  69. End Type
  70.  
  71. '// For specifying color, e.g. in a material or for a vertex.
  72. Type CtsxColor
  73.     red As Byte
  74.     green As Byte
  75.     blue As Byte
  76.     alpha As Byte
  77. End Type
  78.  
  79. '// For specifying UV-space coordinates of a vertex.
  80. Type CtsxUV
  81.     u As Single
  82.     v As Single
  83. End Type
  84.  
  85. '// Object types in a scene.
  86. Enum tsxSOBJTYPE
  87.     e_tsxUNDEFINED = 0 '//Not a TSX-supported SOBJ type
  88.     '// SOBJ types
  89.     e_tsxMATERIAL = 1
  90.     e_tsxSCENE
  91.     e_tsxPLUGIN_FILTER
  92.     e_tsxPHYS_WIND
  93.     e_tsxMATRECT
  94.     '// Selectable objects
  95.     e_tsxSELECTABLE = 50 '//(Not a legal SOBJ type)
  96.     e_tsxAXES
  97.     '// GNODE types
  98.     e_tsxGNODETYPES = 100 '//(Not a legal SOBJ type)
  99.     e_tsxCAMERA
  100.     e_tsxLIGHT
  101.     e_tsxJOINT
  102.     e_tsxNAIL
  103.     e_tsxLATTICE
  104.     e_tsxPATH
  105.     '// MNODE types
  106.     e_tsxMNODETYPES = 200 '//(Not a legal SOBJ type)
  107.     e_tsxPOLYHEDRON
  108.     e_tsxGROUP
  109.     e_tsxLODGROUP '//Levels of Detail
  110.     e_tsxMBALLOBJ '//Object with meta-balls
  111. '//    e_tsxOPARTICLE
  112.     e_tsxSADEF '// Free-standing deformation
  113.     e_tsxIKGROUP '//Object with joints (Inverse Kinematics)
  114.  
  115.     e_tsxSOBJEND '//(Not a legal SOBJ type)
  116. End Enum
  117.  
  118. '------------------------------------------------------------------------------
  119. '//    File: tsxErr.h
  120. '//   Descr: TSX Error Codes
  121.  
  122. #Const tsxERR_SUCCESS = 0
  123.  
  124. '// Defined Error Codes
  125.  
  126. #Const tsxERR_NOGOOD = -1      '// something generally went wrong
  127. #Const tsxERR_NO_MEMORY = -2  '// no memory available
  128. #Const tsxERR_NULL_REF = -3   '// null pointer reference
  129. #Const tsxERR_BAD_INPUT = -4  '// bad input data
  130. #Const tsxERR_FORMAT = -5     '// general bad data format
  131. #Const tsxERR_ABORT = -8      '// user abort request
  132. #Const tsxERR_REPORTED = -10  '// still an error but was reported below
  133. #Const tsxERR_UNIMPL = -11    '// feature unimplemented
  134. #Const tsxERR_IDENTIFIER = -12 '// bad identifier on data or record
  135. #Const tsxERR_VERSION = -13   '// Correct file type but wrong version
  136. #Const tsxERR_NOT_FOUND = -14 '// object not found
  137. #Const tsxERR_OVERFLOW = -15  '// data overflow for size of result
  138. #Const tsxERR_RANGE = -16     '// value out of range
  139. #Const tsxERR_INIT = -18  '// subsystem improperly initialized
  140.  
  141. '// system errors
  142. #Const tsxERR_SYSERR_BASE = -50
  143. #Const tsxERR_STDIO = (tsxERR_SYSERR_BASE - 0)    '// error occurred in io
  144. #Const tsxERR_MSWIN = (tsxERR_SYSERR_BASE - 1)    '// error occurred in windows
  145.  
  146. '------------------------------------------------------------------------------
  147. '//    File: tsxGeom.h
  148. '//   Descr: Basic geometric manipulation in 2D and 3D.
  149.  
  150. #Const M_PI = 3.14159265359
  151.  
  152. '// 180/pi
  153. #Const tsxRAD2DEG_FAC = 57.29577951308
  154. '// pi/180
  155. #Const tsxDEG2RAD_FAC = 0.01745329251994
  156.  
  157. '// |vect|
  158. Declare Function tsxMagnitude3f Lib "tsxapi.dll" (ByRef vec As CtsxVector3f) As Single
  159. Declare Function tsxMagnitude2f Lib "tsxapi.dll" (ByRef vec As CtsxVector2f) As Single
  160.  
  161. '//      Normalizing ... returns the length of the original vector `vec'.
  162. Declare Function tsxNormalize3f Lib "tsxapi.dll" (ByRef vec As CtsxVector3f) As Single
  163. Declare Function tsxNormalize2f Lib "tsxapi.dll" (ByRef vec As CtsxVector2f) As Single
  164. '// norm = vec/|vec|
  165. Declare Function tsxGetNormalized3f Lib "tsxapi.dll" (ByRef norm As CtsxVector3f, ByRef vec As CtsxVector3f) As Single
  166. Declare Function tsxGetNormalized2f Lib "tsxapi.dll" (ByRef norm As CtsxVector2f, ByRef vec As CtsxVector2f) As Single
  167.  
  168. '//      Scalar-Vector arithmetic ... `vec' is modified and returned
  169. '// vec = vec + s
  170. Declare Function tsxAddScalar3f Lib "tsxapi.dll" (ByRef vec As CtsxVector2f, s As Single) As Variant
  171. '// vec = vec * s
  172. Declare Function tsxMulScalar3f Lib "tsxapi.dll" (ByRef vec As CtsxVector2f, s As Single) As Variant
  173.  
  174. '//      Vector-Vector arithmetic ... Vector `u' is modified and returned
  175. '// u = u + v
  176. Declare Function tsxAddVec3f Lib "tsxapi.dll" (ByRef u As CtsxVector3f, ByRef v As CtsxVector3f) As Variant
  177. '// u = u - v
  178. Declare Function tsxSubVec3f Lib "tsxapi.dll" (ByRef u As CtsxVector3f, ByRef v As CtsxVector3f) As Variant
  179.  
  180. '//      Vector Multiplication
  181. '// u . v ... Dot Product
  182. Declare Function tsxDProdVec3f Lib "tsxapi.dll" (ByRef u As CtsxVector3f, ByRef v As CtsxVector3f) As Single
  183. '// uxv = u x v ... Cross Product
  184. Declare Function tsxXProdVec3f Lib "tsxapi.dll" (ByRef uxv As CtsxVector3f, ByRef u As CtsxVector3f, ByRef v As CtsxVector3f) As Variant
  185. '// Returns Signed angle from vector `u' to `v' about the axis `axis'.
  186. '// `axis' gets the (unnormalized) cross-product (axis = u x v). Angle in radians.
  187. Declare Function tsxAngleBtwVecs3f Lib "tsxapi.dll" (ByRef u As CtsxVector3f, ByRef v As CtsxVector3f, ByRef axis As CtsxVector3f) As Single
  188.  
  189. '// Distance between 2 points `p', `q'.
  190. Declare Function tsxDistanceToPoint3f Lib "tsxapi.dll" (ByRef p As CtsxVector3f, ByRef q As CtsxVector3f) As Single
  191. '// Distance from a point `p' to a line containing point `line_point' and
  192. '// with unit direction vector `line_unitvec'.
  193. Declare Function tsxDistanceToLine3f Lib "tsxapi.dll" (ByRef p As CtsxVector3f, ByRef line_point As CtsxVector3f, ByRef line_unitvec As CtsxVector3f) As Single
  194. '// Distance from a Point `p' to a Plane with normal `plane_norm' and
  195. '// containing Point `plane_point'. This distance is positive only if
  196. '// `plane_norm' points towards `p'.
  197. Declare Function tsxDistanceToPlane3f Lib "tsxapi.dll" (ByRef p As CtsxVector3f, ByRef plane_norm As CtsxVector3f, ByRef plane_point As CtsxVector3f) As Single
  198.  
  199.  
  200. '// A = B x C ... Matrix Multiplication.
  201. '// A may be the same as B or C.
  202. Declare Function tsxXProdMx3f Lib "tsxapi.dll" (ByRef A As CtsxTxmx3f, ByRef B As CtsxTxmx3f, ByRef C As CtsxTxmx3f) As Variant
  203. '// Minv = Inverse(M) ... Matrix Inverse
  204. '// Returns e_tsxFAILURE if result is not reliable.
  205. Declare Function tsxInvertMx3f Lib "tsxapi.dll" (ByRef Minv As CtsxTxmx3f, ByRef M As CtsxTxmx3f) As Long
  206.  
  207. '// Makes Transformation Matrix from specified X and Z axes and Origin.
  208. '// pTxmx points to matrix where result Transformation Matrix is stored.
  209. '// If pInvTxmx is specified, the inverted Transform is stored there.
  210. '// Returns reference to Txmx.
  211. Declare Function tsxMakeMxFromXZO3f Lib "tsxapi.dll" (ByRef xAxis As CtsxVector3f, _
  212.                                                       ByRef zAxis As CtsxVector3f, _
  213.                                                       ByRef origin As CtsxVector3f, _
  214.                                                       ByRef pTxmx As CtsxTxmx3f, _
  215.                                                       pInvTxmx As Any) As Variant
  216.  
  217. '// Makes a transformation matrix for rotation by `angle' about a line
  218. '// defined by the center point `cent' and the normalized axis vector `axis'.
  219. '// Returns reference to Txmx.
  220. Declare Function tsxMakeRotMx3f Lib "tsxapi.dll" (ByRef cent As CtsxVector3f, _
  221.                                                   ByRef axis As CtsxVector3f, _
  222.                                                   ByVal angle As Single, _
  223.                                                   ByRef pTxmx As CtsxTxmx3f, _
  224.                                                   pInvTxmx As Any) As Long
  225.                                                   
  226. '// This version builds a pure rotation matrix, leaving other cells untouched.
  227. '// The rotation is about a (unit) vector `axis'.
  228. Declare Function tsxMakePureRotMx3f Lib "tsxapi.dll" (ByRef axis As CtsxVector3f, _
  229.                                                       ByVal angle As Single, _
  230.                                                       ByRef pTxmx As CtsxTxmx3f, _
  231.                                                       pInvTxmx As Any) As Long
  232.  
  233. '//      Translation in the Txmx
  234. '// Get the translation components {x, y, z} into `trvec'.
  235. Declare Function tsxGetMxTranslation3f Lib "tsxapi.dll" (ByRef trvec As CtsxVector3f, ByRef txmx As CtsxTxmx3f) As Long
  236. '// Set the translation components of a Txmx
  237. Declare Function tsxSetMxTranslation3f Lib "tsxapi.dll" (ByRef txmx As CtsxTxmx3f, ByRef trvec As CtsxVector3f) As Long
  238. '// Add translation vector `trvec' to Txmx
  239. Declare Function tsxAddMxTranslation3f Lib "tsxapi.dll" (ByRef txmx As CtsxTxmx3f, ByRef trvec As CtsxVector3f) As Long
  240. '// Subtract translation vector `trvec' from Txmx
  241. Declare Function tsxSubMxTranslation3f Lib "tsxapi.dll" (ByRef txmx As CtsxTxmx3f, ByRef trvec As CtsxVector3f) As Long
  242. '// Extract the pure rotation matrix (Rot) and scaling/shearing factors
  243. '// from a Transformation Matrix (Txmx).
  244. '// If specified, pScaleShear must be float[6], and is assigned as follows:
  245. '//      { Sx, Sy, Sz, Sxy, Sxz, Syz }
  246. Declare Sub tsxUnMatrix3f Lib "tsxapi.dll" (ByRef txmx As CtsxTxmx3f, ByRef Rot As CtsxTxmx3f, pScaleShear As Long)
  247.  
  248. '// Transform an array of vectors `pInVecs', placing result in `pOutVecs'.
  249. Declare Sub tsxTransformVecs3f Lib "tsxapi.dll" (ByVal numVecs As Long, _
  250.                                                  ByRef pOutVecs As CtsxVector3f, _
  251.                                                  ByRef pInVecs As CtsxVector3f, _
  252.                                                  ByRef txmx As CtsxTxmx3f)
  253. '// Apply only the rotational part of the Txmx to an array of vectors.
  254. Declare Sub tsxRotateVecs3f Lib "tsxapi.dll" (ByVal numVecs As Long, _
  255.                                               ByRef pOutVecs As CtsxVector3f, _
  256.                                               ByRef pInVecs As CtsxVector3f, _
  257.                                               ByRef txmx As CtsxTxmx3f)
  258. '// OutAxes = Rotate InAxes using Txmx. Ignore non-rotational part of Txmx.
  259. '// IF InAxes are orthogonal and unit, then OutAxes are also valid axes.
  260. Declare Sub tsxRotateAxes3f Lib "tsxapi.dll" (ByRef pOutAxes As CtsxAxes3f, ByRef pInAxes As CtsxAxes3f, ByRef txmx As CtsxTxmx3f)
  261.  
  262. '// Initialize BBox to negative volume.
  263. Declare Sub tsxBBoxInit Lib "tsxapi.dll" (ByRef pBBox As CtsxBBox3f)
  264.  
  265. '// Returns e_tsxTRUE if BBox1 and BBox2 intersect.
  266. '// If they do intersect, and pBBintx is non-zero,
  267. '// then BBintx gets their intersection.
  268. Declare Function tsxBBoxIntersection Lib "tsxapi.dll" ( _
  269.                           ByRef pBBintx As CtsxBBox3f, _
  270.                           ByRef pBBox1 As CtsxBBox3f, _
  271.                           ByRef pBBox2 As CtsxBBox3f) As Long
  272.  
  273. '------------------------------------------------------------------------------
  274. '//    File: tsxSobj.h
  275. '//   Descr: Definition of tsxSOBJ
  276.  
  277. '// Sobj Type
  278. Declare Function tsxSobjGetType Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  279.  
  280. '// e_tsxTRUE if Node is a Sobj
  281. Declare Function tsxIsSobj Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  282.  
  283. '// Get the first child of an object.
  284. Declare Function tsxSobjGetFirstChild Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  285.  
  286. '// Get the last child of an object.
  287. Declare Function tsxSobjGetLastChild Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  288.  
  289. '// Get the next node of valid tsx Sobj Type
  290. '// pSobj is any Calobj
  291. Declare Function tsxSobjGetNext Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  292.  
  293. '// Get the prev node of valid tsx Sobj Type
  294. '// pSobj is any Calobj
  295. Declare Function tsxSobjGetPrev Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  296.  
  297. '// Delete and free memory, including internal allocations.
  298. '// Also delete all children, if any.
  299. '// Erases objects from all Views.
  300. Declare Sub tsxSobjDelete Lib "tsxapi.dll" (ByVal pSobj As Long)
  301.  
  302. '------------------------------------------------------------------------------
  303. '//    File: tsxMisc.h
  304. '//   Descr: Miscellaneous items
  305.  
  306. 'procedure tsxGetTsVersionNbrs(
  307. '       var pMajor: Short;  // Major version nbr
  308. '        var pMinor: Short   // Minor version nbr
  309. '        ); cdecl;
  310. Declare Sub tsxGetTsVersionNbrs Lib "tsxapi.dll" _
  311.     (ByRef pMajor As Integer, ByRef pMinor As Integer)
  312.     
  313. '// Returns handle to the main view window.
  314. 'TSXAPIFN HWND tsxGetMainViewHwnd(void);
  315. Declare Function tsxGetMainViewHWND Lib "tsxapi.dll" () As Long
  316.  
  317. '// Get the number of Faces (0 if not a Polyhedron).
  318. 'function tsxPolyhGetNbrFaces(pPolyh: PTsxPolyhedron): Integer; cdecl;
  319. Declare Function tsxPolyhGetNbrFaces Lib "tsxapi.dll" _
  320.     (ByVal pPolyh As Long) As Long
  321.     
  322. '------------------------------------------------------------------------------
  323. '//    File: tsxMatrl.h
  324. '//   Descr: Definition of tsxMATERIAL
  325.  
  326. '// Solid texture direction values (used in the grain fields).
  327. #Const tsxSOLID_DIR_X = 0
  328. #Const tsxSOLID_DIR_Y = 1
  329. #Const tsxSOLID_DIR_Z = 2
  330.  
  331. '// Simulates a granite like texture with upto 4 colors.
  332. Type CtsxGraniteProps
  333.     color1 As CtsxColor '//The different stone colors.
  334.     color2 As CtsxColor
  335.     color3 As CtsxColor
  336.     color4 As CtsxColor
  337.     amount1 As Single '//Relative amount of color1 [0.0 - 1.0] (0=none)
  338.     amount2 As Single '//Relative amount of color2 [0.0 - 1.0]
  339.     amount3 As Single '//Relative amount of color3 [0.0 - 1.0]
  340.     amount4 As Single '//Relative amount of color4 [0.0 - 1.0]
  341.     sharpness As Single '//[0.0 (max blurring to one color) - 1.0 (no blur)]
  342.     scale As CtsxVector3f 'Scaling along solid texture directions. Non-negative.
  343.                           '// Larger values result in finer texture.
  344.     seed As Integer '//Random seed for generating pattern [0 - 64k]
  345. End Type
  346.  
  347. '// Simulates texture of swirling veins produced by turbulent forces
  348. '// applied before marble solidifies.
  349. Type CtsxMarbleProps
  350.     stonecol As CtsxColor '//Base stone color
  351.     veincol As CtsxColor '//Color of veins
  352.     turbulence As Integer '//Higher numbers result in larger, bumpier veins.
  353.                           '// 0 produces straight veins. Typically [0 - 20].
  354.     sharpness As Single '//Blending between vein and stone colors at vein edges.
  355.                         '// Higher values increase sharpness. [0.0 - 1.0]
  356.     grain As Integer '//Vein direction (tsxSOLID_DIR_*).
  357.     scale As CtsxVector3f '//Scaling along solid texture directions. Non-negative.
  358.                           '// Larger values result in more veins.
  359.     seed As Integer '//Random seed for generating pattern [0 - 64k]
  360. End Type
  361.  
  362. '// This produces concentric light (Spring) and dark (Summer) colored rings,
  363. '// around an axis.
  364. Type CtsxWoodProps
  365.     lightcol As CtsxColor '//The light or spring color
  366.     darkcol As CtsxColor '//The dark or summer color
  367.     ldratio As Single '//Light/Dark ratio.
  368.                       '// [0.0 (almost all dark) - 1.0 (almost all light)]
  369.     rdensity As Single '//Number of rings per unit distance.
  370.     rwidthvar As Single '//Variation in ring width [0.0 (uniform) - 1.0]
  371.     rshapevar As Single '//Variation in ring shape [0.0 (perfect circle) - 1.0]
  372.     center As CtsxVector3f '//Location of rings center.
  373.     grain As Integer '//Ring axis direction (tsxSOLID_DIR_*).
  374.     scale As CtsxVector3f '//Scaling along solid texture directions. Non-negative.
  375.     seed As Integer '//Random seed for generating pattern [0 - 64k]
  376. End Type
  377.  
  378. '// Values for CtsxProcTexture::txtrtype
  379. #Const tsxTEXTURE_NONE = 0
  380. #Const tsxTEXTURE_GRANITE = 1
  381. #Const tsxTEXTURE_MARBLE = 2
  382. #Const tsxTEXTURE_WOOD = 3
  383. '// returned by `tsxMaterialGetTextureType' if texture is not procedural.
  384. '// Not a valid value for field txtrtype.
  385. #Const tsxTEXTURE_IMAGE = 4
  386.  
  387. '// Structure for specifying one of the procedural textures in tsxMATERIAL
  388. 'struct CtsxProcTexture
  389. '{
  390.     'short txtrtype; //one of tsxTEXTURE_*
  391.     'Union
  392.     '{
  393.         'CtsxGraniteProps gprops;
  394.         'CtsxMarbleProps  mprops;
  395.         'CtsxWoodProps    wprops;
  396.     '};
  397. '};
  398. Type CtsxGraniteTexture
  399.     txtrtype As Integer '// one of tsxTEXTURE_*
  400.     gprops As CtsxGraniteProps
  401. End Type
  402.  
  403. Type CtsxMarbleTexture
  404.     txtrtype As Integer '// one of tsxTEXTURE_*
  405.     mprops As CtsxMarbleProps
  406. End Type
  407.  
  408. Type CtsxWoodTexture
  409.     txtrtype As Integer '// one of tsxTEXTURE_*
  410.     wprops As CtsxWoodProps
  411. End Type
  412.  
  413. '// Reflection shading types (mutually exclusive)
  414. #Const tsxSHADER_FLAT = 1
  415. #Const tsxSHADER_PHONG = 2
  416. #Const tsxSHADER_METAL = 4
  417. '// Surface smoothness (mutually exclusive)
  418. #Const tsxFACET_FACETED = 1
  419. #Const tsxFACET_AUTO = 2
  420. #Const tsxFACET_SMOOTH = 4
  421.  
  422. '// Surface properties ......................................
  423. Type CtsxSurfaceProps
  424.     ka As Single '//ambient coefficent [0.0 -(0.01)- 1.0]
  425.     ks As Single '//specular coefficent [0.0 -(0.01)- 1.0]
  426.     exp As Single '//exponent of specularity (roughness) [0.0 -(0.01)- 1.0]
  427. End Type
  428.  
  429. '// Texture Map properties ..................................
  430.  
  431. #Const tsxTXTR_OVERLAY = 1
  432. #Const tsxTXTR_ON = 2         '//otherwise OFF
  433. #Const tsxTXTR_MOVIE = 4
  434. #Const tsxTXTR_MARBLE = 1024
  435. #Const tsxTXTR_WOOD = 2048
  436. #Const tsxTXTR_GRANITE = 4096
  437. '// Only one of MARBLE, WOOD or GRANITE may be set.
  438.  
  439. Type CtsxTextureProps
  440.     offsetu As Single '//texture U offset [-1.0 -(.001)- 1.0]
  441.     offsetv As Single '//texture V offset [-1.0 -(.001)- 1.0]
  442.     repeatsu As Single '//texture repeats in U [0.01 -(.1)- 100.0]
  443.     repeatsv As Single '//texture repeats in V [0.01 -(.1)- 100.0]
  444.     flags As Integer '//see above
  445. End Type
  446.  
  447. '// Bump Map properties .....................................
  448. #Const tsxBUMP_ON = 2         '//otherwise OFF
  449. #Const tsxBUMP_MOVIE = 4
  450.  
  451. Type CtsxBumpProps
  452.     offsetu As Single '//bump U offset [-1.0 -(.001)- 1.0]
  453.     offsetv As Single '//bump V offset [-1.0 -(.001)- 1.0]
  454.     repeatsu As Single '//bump repeats in U [0.01 -(.1)- 100.0]
  455.     repeatsv As Single '//bump repeats in V [0.01 -(.1)- 100.0]
  456.     amplitude As Single '//bump amplitude [-10.0 - 10.0]
  457.     flags As Integer '//see above
  458. End Type
  459.  
  460. '// Environment Map properties ..............................
  461.  
  462. #Const tsxENVR_CUBIC = 1      '//cubic environment, otherwise its spherical
  463. #Const tsxENVR_ON = 2         '//otherwise OFF
  464. #Const tsxENVR_MOVIE = 4
  465.  
  466.  
  467. #Const tsxUVPROJ_PLANE = 1
  468. #Const tsxUVPROJ_PLANE_SQUARE = 2
  469. #Const tsxUVPROJ_CYLINDER = 4
  470. #Const tsxUVPROJ_SPHERE = 8
  471.  
  472. '// Create a new material object with default properties:
  473. '//   - reflection shading = tsxSHADER_FLAT
  474. '//   - Surface smoothness = tsxFACET_FACETED
  475. '//   - alpha-chanel = 1
  476. '//   - index of refraction = 1
  477. '//   - Texture U repeats = 1
  478. '//   - Texture V repeats = 1
  479. '//   - Bump U repeats = 1
  480. '//   - Bump V repeats = 1
  481. '//   - Bump amplitude = 1
  482. '//   - Zero (0) in the rest of the fields
  483. '// Ptr to new object assigned to ppMatrl on success.
  484. 'TSXAPIFN tsxERR tsxMaterialCreate( tsxMATERIAL** ppMatrl );
  485. Declare Function tsxMaterialCreate Lib "tsxapi.dll" _
  486.     (ByRef ppMatrl As Long) As Long
  487.  
  488. '// Create a new material object, with same properties as pOldMatrl.
  489. '// Ptr to new object assigned to ppNewMatrl on success.
  490. 'TSXAPIFN tsxERR tsxMaterialCreateCopy(
  491.     'tsxMATERIAL** ppNewMatrl,
  492.     'tsxMATERIAL* pOldMatrl
  493.     ');
  494. Declare Function tsxMaterialCreateCopy Lib "tsxapi.dll" _
  495.     (ByRef ppNewMatrl As Long, ByVal pOldMatrl As Long) As Long
  496.  
  497. '// Create a new material object, with same properties as the Active Material.
  498. '// Ptr to new object assigned to ppMatrl on success.
  499. 'TSXAPIFN tsxERR tsxMaterialCreateCopyActive( tsxMATERIAL** ppMatrl );
  500. Declare Function tsxMaterialCreateCopyActive Lib "tsxapi.dll" _
  501.     (ByRef ppMatrl As Long) As Long
  502.  
  503. '// Destroy a material object.  If assigned to faces, corresponding material
  504. '// entries in matlist set to null.
  505. 'TSXAPIFN void tsxMaterialDestroy( tsxMATERIAL* pMatrl );
  506. Declare Sub tsxMaterialDestroy Lib "tsxapi.dll" _
  507.     (ByVal pMatrl As Long)
  508.  
  509. '// Set the active material to pNewActive (may be NULL).
  510. 'TSXAPIFN void tsxMaterialSetActive( tsxMATERIAL* pNewActive );
  511. Declare Sub tsxMaterialSetActive Lib "tsxapi.dll" _
  512.     (ByVal pNewActive As Long)
  513.  
  514. '// Returns ptr to the Active Material (may be NULL)
  515. 'TSXAPIFN tsxMATERIAL* tsxMaterialGetActive();
  516. Declare Function tsxMaterialGetActive Lib "tsxapi.dll" _
  517.     () As Long
  518.  
  519. '// Copy Active Material's (if any) attributes into pMatrl.
  520. 'TSXAPIFN void tsxMaterialCopyActive( tsxMATERIAL* pMatrl );
  521. Declare Sub tsxMaterialCopyActive Lib "tsxapi.dll" _
  522.     (ByVal pMatrl As Long)
  523.  
  524. '// Testing two materials for equivalence.
  525. 'TSXAPIFN tsxBOOL tsxMaterialsAreEqual( tsxMATERIAL* pMatrl1,
  526.                                        'tsxMATERIAL* pMatrl2 );
  527. Declare Function tsxMaterialsAreEqual Lib "tsxapi.dll" _
  528.     (ByVal pMatrl1 As Long, ByVal pMatrl2 As Long) As Long
  529.  
  530. '// Get its ID (0-64K, -1 if not material)
  531. 'TSXAPIFN int tsxMaterialGetId( tsxMATERIAL* pMatrl );
  532. Declare Function tsxMaterialGetId Lib "tsxapi.dll" _
  533.     (ByVal pMatrl As Long) As Long
  534.  
  535. '// Surface attributes ..........................................................
  536.  
  537. '// Reflection shading (tsxSHADER_*, 0 on error)
  538. 'TSXAPIFN int tsxMaterialGetShadingType( tsxMATERIAL* pMatrl );
  539. Declare Function tsxMaterialGetShadingType Lib "tsxapi.dll" _
  540.     (ByVal pMatrl As Long) As Long
  541.  
  542. '// Surface faceting (tsxFACET_*, 0 on error)
  543. 'TSXAPIFN int tsxMaterialGetFacetingType( tsxMATERIAL* pMatrl );
  544. Declare Function tsxMaterialGetFacetingType Lib "tsxapi.dll" _
  545.     (ByVal pMatrl As Long) As Long
  546.  
  547. '// The angle in degrees (0 - 120)
  548. 'TSXAPIFN int tsxMaterialGetAutofacetAngle( tsxMATERIAL* pMatrl );
  549. Declare Function tsxMaterialGetAutofacetAngle Lib "tsxapi.dll" _
  550.     (ByVal pMatrl As Long) As Long
  551.  
  552. '// Color
  553. 'TSXAPIFN void tsxMaterialGetColor( tsxMATERIAL* pMatrl, CtsxColor* pColor );
  554. Declare Sub tsxMaterialGetColor Lib "tsxapi.dll" _
  555.     (ByVal pMatrl As Long, ByRef pColor As CtsxColor)
  556.  
  557. '// Surface properties
  558. 'TSXAPIFN void tsxMaterialGetSurfaceProps( tsxMATERIAL* pMatrl,
  559.                                           'CtsxSurfaceProps* pSprops );
  560. Declare Sub tsxMaterialGetSurfaceProps Lib "tsxapi.dll" _
  561.     (ByVal pMatrl As Long, ByRef pSprops As CtsxSurfaceProps)
  562.  
  563. '// index of refraction (1.0 - 2.0, 0 on error)
  564. 'TSXAPIFN float tsxMaterialGetIor( tsxMATERIAL* pMatrl );
  565. Declare Function tsxMaterialGetIor Lib "tsxapi.dll" _
  566.     (ByVal pMatrl As Long) As Single
  567.  
  568. '// Returns tsxTEXTURE_*
  569. 'TSXAPIFN int tsxMaterialGetTextureType( tsxMATERIAL* pMatrl );
  570. Declare Function tsxMaterialGetTextureType Lib "tsxapi.dll" _
  571.     (ByVal pMatrl As Long) As Long
  572.  
  573. '// If not procedural texture, pPrTxt->txtrtype = tsxTEXTURE_NONE.
  574. 'TSXAPIFN void tsxMaterialGetProcTexture( tsxMATERIAL* pMatrl,
  575.                                          'CtsxProcTexture* pPrTxt );
  576. Declare Sub tsxMaterialGetProcTexture Lib "tsxapi.dll" _
  577.     (ByVal pMatrl As Long, pPrTxt As Any)
  578.  
  579. '// File used as texture map image.
  580. 'TSXAPIFN void tsxMaterialGetTextureFilename(
  581.     'tsxMATERIAL* pMatrl,
  582.     'char* szFilename,   // File name copied here, if any
  583.     'int iFilenameSize   // size of szFilename buffer
  584.     ');
  585. Declare Sub tsxMaterialGetTextureFilename Lib "tsxapi.dll" _
  586.     (ByVal pMatrl As Long, ByVal szFilename As String, iFilenameSize As Long)
  587.  
  588. '// Texture mapping parameters
  589. 'TSXAPIFN void tsxMaterialGetTextureProps(
  590.     'tsxMATERIAL* pMatrl,
  591.     'CtsxTextureProps* pTxtrProps
  592.     ');
  593. Declare Sub tsxMaterialGetTextureProps Lib "tsxapi.dll" _
  594.     (ByVal pMatrl As Long, ByRef pTxtrProps As CtsxTextureProps)
  595.  
  596.  
  597. '// Bump Map ....................................................................
  598.  
  599. '// File used as bump map image.
  600. 'TSXAPIFN void tsxMaterialGetBumpFilename(
  601.     'tsxMATERIAL* pMatrl,
  602.     'char* szFilename,   // File name copied here, if any
  603.     'int iFilenameSize   // size of szFilename buffer
  604.     ');
  605. Declare Sub tsxMaterialGetBumpFilename Lib "tsxapi.dll" _
  606.     (ByVal pMatrl As Long, ByVal szFilename As String, iFilenameSize As Long)
  607.  
  608. '// Bump mapping parameters
  609. 'TSXAPIFN void tsxMaterialGetBumpProps(
  610.     'tsxMATERIAL* pMatrl,
  611.     'CtsxBumpProps* pBumpProps
  612.     ');
  613. Declare Sub tsxMaterialGetBumpProps Lib "tsxapi.dll" _
  614.     (ByVal pMatrl As Long, ByRef pTxtrProps As CtsxBumpProps)
  615.  
  616.  
  617. '// Environment Map .............................................................
  618.  
  619. '// File used as environment map image.
  620. 'TSXAPIFN void tsxMaterialGetEnvrFilename(
  621.     'tsxMATERIAL* pMatrl,
  622.     'char* szFilename,   // File name copied here, if any
  623.     'int iFilenameSize   // size of szFilename buffer
  624.     ');
  625. Declare Sub tsxMaterialGetEnvrFilename Lib "tsxapi.dll" _
  626.     (ByVal pMatrl As Long, ByVal szFilename As String, iFilenameSize As Long)
  627.  
  628. '// Returns tsxENVR_* (0 on error)
  629. 'TSXAPIFN int tsxMaterialGetEnvrFlags( tsxMATERIAL* pMatrl );
  630. Declare Function tsxMaterialGetEnvrFlags Lib "tsxapi.dll" _
  631.     (ByVal pMatrl As Long) As Long
  632.  
  633.  
  634. '// Surface attributes ..........................................................
  635.  
  636. '// Reflection shading (tsxSHADER_*)
  637. 'TSXAPIFN void tsxMaterialSetShadingType( tsxMATERIAL* pMatrl, int shading );
  638. Declare Sub tsxMaterialSetShadingType Lib "tsxapi.dll" _
  639.     (ByVal pMatrl As Long, ByVal shading As Long)
  640.  
  641. '// Surface faceting (tsxFACET_*)
  642. 'TSXAPIFN void tsxMaterialSetFacetingType( tsxMATERIAL* pMatrl, int faceting );
  643. Declare Sub tsxMaterialSetFacetingType Lib "tsxapi.dll" _
  644.     (ByVal pMatrl As Long, ByVal faceting As Long)
  645.  
  646. '// The angle in degrees (0 - 120)
  647. 'TSXAPIFN void tsxMaterialSetAutofacetAngle( tsxMATERIAL* pMatrl,
  648.                                             'int angleDegrees );
  649. Declare Sub tsxMaterialSetAutofacetAngle Lib "tsxapi.dll" _
  650.     (ByVal pMatrl As Long, ByVal angleDegrees As Long)
  651.  
  652. '// Color
  653. 'TSXAPIFN void tsxMaterialSetColor( tsxMATERIAL* pMatrl, CtsxColor* pColor );
  654. Declare Sub tsxMaterialSetColor Lib "tsxapi.dll" _
  655.     (ByVal pMatrl As Long, ByRef pColor As CtsxColor)
  656.  
  657. '// Surface properties
  658. 'TSXAPIFN void tsxMaterialSetSurfaceProps( tsxMATERIAL* pMatrl,
  659.                                           'CtsxSurfaceProps* pSprops );
  660. Declare Sub tsxMaterialSetSurfaceProps Lib "tsxapi.dll" _
  661.     (ByVal pMatrl As Long, ByRef pSprops As CtsxSurfaceProps)
  662.  
  663. '// index of refraction (1.0 - 2.0)
  664. 'TSXAPIFN void tsxMaterialSetIor( tsxMATERIAL* pMatrl, float ior );
  665. Declare Function tsxMaterialSetIor Lib "tsxapi.dll" _
  666.     (ByVal pMatrl As Long, ByVal ior As Single)
  667.  
  668. '// Texture Map .................................................................
  669.  
  670. '// Returns tsxTEXTURE_*
  671. 'TSXAPIFN void tsxMaterialSetTextureType( tsxMATERIAL* pMatrl, int txtype );
  672. Declare Sub tsxMaterialSetTextureType Lib "tsxapi.dll" _
  673.     (ByVal pMatrl As Long, ByVal txtype As Long)
  674.  
  675. '// If not procedural texture, pPrTxt->txtrtype = tsxTEXTURE_NONE.
  676. 'TSXAPIFN void tsxMaterialSetProcTexture( tsxMATERIAL* pMatrl,
  677.                                          'CtsxProcTexture* pPrTxt );
  678. Declare Sub tsxMaterialSetProcTexture Lib "tsxapi.dll" _
  679.     (ByVal pMatrl As Long, pPrTxt As Any)
  680.  
  681. '// File used as texture map image.
  682. 'TSXAPIFN void tsxMaterialSetTextureFilename(
  683.     'tsxMATERIAL* pMatrl,
  684.     'char* szFilename    // File name ptr (may be NULL)
  685.     ');
  686. Declare Sub tsxMaterialSetTextureFilename Lib "tsxapi.dll" _
  687.     (ByVal pMatrl As Long, ByVal szFilename As String)
  688.  
  689. '// Texture mapping parameters
  690. 'TSXAPIFN void tsxMaterialSetTextureProps(
  691.     'tsxMATERIAL* pMatrl,
  692.     'CtsxTextureProps* pTxtrProps
  693.     ');
  694. Declare Sub tsxMaterialSetTextureProps Lib "tsxapi.dll" _
  695.     (ByVal pMatrl As Long, ByRef pTxtrProps As CtsxTextureProps)
  696.  
  697.  
  698. '// Bump Map ....................................................................
  699.  
  700. '// File used as bump map image.
  701. 'TSXAPIFN void tsxMaterialSetBumpFilename(
  702.     'tsxMATERIAL* pMatrl,
  703.     'char* szFilename    // File name ptr (may be 0)
  704.     ');
  705. Declare Sub tsxMaterialSetBumpFilename Lib "tsxapi.dll" _
  706.     (ByVal pMatrl As Long, ByVal szFilename As String)
  707.  
  708. '// Bump mapping parameters
  709. 'TSXAPIFN void tsxMaterialSetBumpProps(
  710.     'tsxMATERIAL* pMatrl,
  711.     'CtsxBumpProps* pBumpProps
  712.     ');
  713. Declare Sub tsxMaterialSetBumpProps Lib "tsxapi.dll" _
  714.     (ByVal pMatrl As Long, ByRef pBumpProps As CtsxBumpProps)
  715.  
  716.  
  717. '// Environment Map .............................................................
  718.  
  719. '// File used as environment map image.
  720. 'TSXAPIFN void tsxMaterialSetEnvrFilename(
  721.     'tsxMATERIAL* pMatrl,
  722.     'char* szFilename    // File name ptr (may be 0)
  723.     ');
  724. Declare Sub tsxMaterialSetEnvrFilename Lib "tsxapi.dll" _
  725.     (ByVal pMatrl As Long, ByVal szFilename As String)
  726.  
  727. '// Environment flags tsxENVR_*
  728. 'TSXAPIFN void tsxMaterialSetEnvrFlags( tsxMATERIAL* pMatrl, int flags );
  729. Declare Sub tsxMaterialSetEnvrFlags Lib "tsxapi.dll" _
  730.     (ByVal pMatrl As Long, ByVal flags As Long)
  731.  
  732. '------------------------------------------------------------------------------
  733. '//    File: tsxScene.cpp
  734. '//   Descr: Definition of tsxSCENE
  735.  
  736. '// Get the trueSpace scene.
  737. 'TSXAPIFN tsxSCENE* tsxGetScene();
  738. Declare Function tsxGetScene Lib "tsxapi.dll" _
  739.     () As Long
  740.  
  741. '// Adds pGNode as top-level member of scene, and makes it the current selection.
  742. '// IF bNoDraw is TRUE THEN the object will not be drawn in this function call.
  743. '// pGNode must be a new object not already in Scene.
  744. 'TSXAPIFN void tsxSceneAddObject( tsxGNODE* pGNode, tsxBOOL bNoDraw );
  745. Declare Sub tsxSceneAddObject Lib "tsxapi.dll" _
  746.     (ByVal pGNode As Long, ByVal bNoDraw As Long)
  747.  
  748. '// Get the first top level GNode.
  749. '// The rest can be accessed using `tsxGNodeGetNext'.
  750. 'TSXAPIFN tsxGNODE* tsxSceneGetFirstNode();
  751. Declare Function tsxSceneGetFirstNode Lib "tsxapi.dll" _
  752.     () As Long
  753.  
  754. '// Returns tsxTRUE for Fog On.
  755. 'TSXAPIFN tsxBOOL tsxSceneIsFogOn();
  756. Declare Function tsxSceneIsFogOn Lib "tsxapi.dll" _
  757.     () As Long
  758.  
  759. '// Use tsxTRUE to set Fog On.
  760. 'TSXAPIFN void tsxSceneSwitchFog( tsxBOOL fog_on );
  761. Declare Sub tsxSceneSwitchFog Lib "tsxapi.dll" _
  762.     (ByVal fog_on As Long)
  763.     
  764. '//
  765. 'TSXAPIFN void tsxSceneGetFogParms(
  766.     'unsigned int* pFogRed,      //0 - 255
  767.     'unsigned int* pFogBlue,     //0 - 255
  768.     'unsigned int* pFogGreen,    //0 - 255
  769.     'int*          pFogNear,
  770.     'int*          pFogFar,
  771.     'int*          pFogMax
  772.     ');
  773. Declare Sub tsxSceneGetFogParms Lib "tsxapi.dll" _
  774.     (ByRef pFogRed As Long, ByRef pFogBlue As Long, ByRef pFogGreen As Long, ByRef pFogNear As Long, ByRef pFogFar As Long, ByRef pFogMax As Long)
  775.  
  776. '//
  777. 'TSXAPIFN void tsxSceneSetFogParms(
  778.     'unsigned int FogRed,        //0 - 255
  779.     'unsigned int FogBlue,       //0 - 255
  780.     'unsigned int FogGreen,      //0 - 255
  781.     'int          FogNear,
  782.     'int          FogFar,
  783.     'int          FogMax
  784.     ');
  785. Declare Sub tsxSceneSetFogParms Lib "tsxapi.dll" _
  786.     (ByVal FogRed As Long, ByVal FogBlue As Long, ByVal FogGreen As Long, ByVal FogNear As Long, ByVal FogFar As Long, ByVal FogMax As Long)
  787.  
  788. '// (Re)Draw the scene in the active View, in the View's rendering mode.
  789. 'TSXAPIFN void tsxSceneDraw();
  790. Declare Sub tsxSceneDraw Lib "tsxapi.dll" ()
  791.  
  792. '------------------------------------------------------------------------------
  793. '//    File: tsxGNode.h
  794. '//   Descr: Definition of tsxGNODE
  795.  
  796. '// e_tsxTRUE if pSobj is a GNode
  797. 'TSXAPIFN tsxBOOL tsxIsGNode( tsxSOBJ* pSobj );
  798. Declare Function tsxIsGNode Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  799.  
  800. '// Get a copy of the entire tree rooted at a GNode
  801. 'TSXAPIFN tsxERR tsxGNodeCopy(
  802. '    tsxGNODE* pGNode,       // The GNode to copy
  803. '    tsxGNODE** ppGNodeCopy  // Ptr to Copy placed here, on success
  804. '    );
  805. Declare Function tsxGNodeCopy Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef ppGNodeCopy As Long) As Long
  806.  
  807. '// Returns: 0       if pGNode is the Scene object;
  808. '//          pGNode  if parent of pGNode is the Scene object,
  809. '//                  or pGNode has no parent;
  810. '//     else ptr to highest tsxGNODE ancestor of pGNode below Scene.
  811. 'TSXAPIFN tsxGNODE* tsxGNodeGetRoot( tsxGNODE* pGNode );
  812. Declare Function tsxGNodeGetRoot Lib "tsxapi.dll" (ByVal pGNode As Long) As Long
  813.  
  814. '// Get the parent node in the scene graph.
  815. 'TSXAPIFN tsxGNODE* tsxGNodeGetParent( tsxGNODE* pGNode );
  816. Declare Function tsxGNodeGetParent Lib "tsxapi.dll" (ByVal pGNode As Long) As Long
  817.  
  818. '// Returns e_tsxTRUE if pGNode is a member of the Scene at some level.
  819. 'TSXAPIFN tsxBOOL tsxIsGNodeInScene( tsxGNODE* pGNode );
  820. Declare Function tsxIsGNodeInScene Lib "tsxapi.dll" (ByVal pGNode As Long) As Long
  821.  
  822. '// Get the first child of a Group or LOD object.
  823. 'TSXAPIFN tsxGNODE* tsxGNodeGetFirstChild( tsxGNODE* pGNode );
  824. Declare Function tsxGNodeGetFirstChild Lib "tsxapi.dll" (ByVal pGNode As Long) As Long
  825.  
  826. '// Get the next node of valid tsx Type
  827. 'TSXAPIFN tsxGNODE* tsxGNodeGetNext( tsxGNODE* pGNode );
  828. Declare Function tsxGNodeGetNext Lib "tsxapi.dll" (ByVal pGNode As Long) As Long
  829.  
  830. '// Get the prev node of valid tsx Type
  831. 'TSXAPIFN tsxGNODE* tsxGNodeGetPrev( tsxGNODE* pGNode );
  832. Declare Function tsxGNodeGetPrev Lib "tsxapi.dll" (ByVal pGNode As Long) As Long
  833.  
  834. '// Returns e_tsxTRUE if pCheckGNode is a node in the tree rooted at pGNode.
  835. 'TSXAPIFN tsxBOOL tsxIsGNodeSubobj( tsxGNODE* pGNode, tsxGNODE* pCheckGNode );
  836. Declare Function tsxIsGNodeSubobj Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal pCheckGNode As Long) As Long
  837.  
  838. '// Draws pGNode in the current view, in the current view's rendering mode.
  839. 'TSXAPIFN void tsxGNodeDraw( tsxGNODE* pGNode );
  840. Declare Sub tsxGNodeDraw Lib "tsxapi.dll" (ByVal pGNode As Long)
  841.  
  842. '// Gets the Name of a GNode.
  843. '// Returns length of name. (0 if not valid request or null name)
  844. 'TSXAPIFN int tsxGNodeGetName(
  845. '    tsxGNODE* pGNode,
  846. '    char*     pName,    //buffer where name is copied
  847. '    int       iNameSz   //Size of pName buffer
  848. '    );
  849. Declare Function tsxGNodeGetName Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal pName As String, ByVal iNameSz As Long) As Long
  850.  
  851. '// Sets the Name of a GNode.
  852. '// Returns 0 on success.
  853. 'TSXAPIFN tsxERR tsxGNodeSetName( tsxGNODE* pGNode, char* szNewName );
  854. Declare Function tsxGNodeSetName Lib "tsxapi.dll" (ByVal pGNode As Long, ByVal pName As String) As Long
  855.  
  856. '// Get the GNode's position in World coordinates.
  857. '// Returns 0 if not GNODE, else posn.
  858. 'TSXAPIFN CtsxVector3f* tsxGNodeGetAxesPosition(
  859.     'tsxGNODE* pGNode,
  860.     'CtsxVector3f* posn
  861.     ');
  862. Declare Function tsxGNodeGetAxesPosition Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef posn As CtsxVector3f) As Long
  863.  
  864. '// Get the GNode's model axes orientation, as a triple of normalized orthogonal
  865. '// vectors pointing in the directions of GNode's X, Y and Z.
  866. '// Returns 0 if not GNODE, else axes.
  867. 'TSXAPIFN CtsxAxes3f* tsxGNodeGetAxesOrientation(
  868.     'tsxGNODE* pGNode,
  869.     'CtsxAxes3f* axes
  870. '    );
  871. Declare Function tsxGNodeGetAxesOrientation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef posn As CtsxAxes3f) As Long
  872.  
  873. '// Add the bounding box of GNode to input BBox.
  874. '// Not valid for Track and Path objects.
  875. '// The resulting BBox will also enclose the input BBox bounds. To get BBox
  876. '// of only pGNode, use `tsxBBoxInit()' before calling this function.
  877. 'TSXAPIFN tsxERR tsxGNodeGetBBox(
  878.     'tsxGNODE* pGNode,   //Non Track/Path GNode
  879.     'CtsxBBox3f* pBBox   //BBox updated with result.
  880.     ');
  881. Declare Function tsxGNodeGetBBox Lib "tsxapi.dll" _
  882.     (ByVal pGNode As Long, ByRef pBBox As CtsxBBox3f) As Long
  883.  
  884. '// Get the location of GNode.
  885. '// Returns 0 if not GNODE, else loc.
  886. 'TSXAPIFN CtsxVector3f* tsxGNodeGetLocation(
  887.     'tsxGNODE* pGNode,
  888.     'CtsxVector3f* loc
  889.     ');
  890. Declare Function tsxGNodeGetLocation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef loc As CtsxVector3f) As Long
  891.  
  892. '// Get the euler angles of GNode's orientation.
  893. '// Returns 0 if not GNODE, else rot.
  894. 'TSXAPIFN CtsxVector3f* tsxGNodeGetRotation(
  895.     'tsxGNODE* pGNode,
  896.     'CtsxVector3f* rot
  897.     ');
  898. Declare Function tsxGNodeGetRotation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef Rot As CtsxVector3f) As Long
  899.  
  900. '// Get the size of GNode.
  901. '// Returns 0 if not GNODE, else size.
  902. 'TSXAPIFN CtsxVector3f* tsxGNodeGetSize(
  903.     'tsxGNODE* pGNode,
  904.     'CtsxVector3f* size
  905.     ');
  906. Declare Function tsxGNodeGetSize Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef size As CtsxVector3f) As Long
  907.  
  908. '// Set the location of GNode.
  909. 'TSXAPIFN void tsxGNodeSetLocation(
  910.     'tsxGNODE* pGNode,
  911.     'CtsxVector3f* loc
  912.     ');
  913. Declare Sub tsxGNodeSetLocation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef loc As CtsxVector3f)
  914.  
  915. '// Set the euler angles of GNode's orientation.
  916. 'TSXAPIFN void tsxGNodeSetRotation(
  917.     'tsxGNODE* pGNode,
  918.     'CtsxVector3f* rot
  919.     ');
  920. Declare Sub tsxGNodeSetRotation Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef Rot As CtsxVector3f)
  921.  
  922. '// Set the size of GNode.
  923. 'TSXAPIFN void tsxGNodeSetSize(
  924.     'tsxGNODE* pGNode,
  925.     'CtsxVector3f* size
  926.     ');
  927. Declare Sub tsxGNodeSetSize Lib "tsxapi.dll" (ByVal pGNode As Long, ByRef size As CtsxVector3f)
  928.  
  929. '// Returns Transformation matrix representation of the GNode's axes,
  930. '//         with only Rotation and Translation elements,
  931. '//         and no Scaling/Shearing factors.
  932. '//         0 if not GNode
  933. 'TSXAPIFN CtsxTxmx3f* tsxGNodeGetPureTransform(
  934.     'tsxGNODE* pGNode,
  935.     'CtsxTxmx3f* pTxmx
  936.     ');
  937. Declare Function tsxGNodeGetPureTransform Lib "tsxapi.dll" ( _
  938.       ByVal pGNode As Long, _
  939.       ByRef pTxmx As CtsxTxmx3f) As Long
  940.  
  941. '// Returns Transformation matrix of GNode,
  942. '//         0 if not GNode
  943. 'TSXAPIFN CtsxTxmx3f* tsxGNodeGetTransform(
  944.     'tsxGNODE* pGNode,
  945.     'CtsxTxmx3f* pTxmx
  946.     ');
  947. Declare Function tsxGNodeGetTransform Lib "tsxapi.dll" ( _
  948.       ByVal pGNode As Long, _
  949.       ByRef pTxmx As CtsxTxmx3f) As Long
  950.  
  951. '// Translate GNode by pVec, in the specified reference frame.
  952. 'TSXAPIFN void tsxGNodeTranslate(
  953.     'tsxGNODE* pGNode,
  954.     'CtsxVector3f* pVec, // translation vector
  955.     'tsxFRAMEID frameid   // Reference frame for pVec
  956.     ');
  957. Declare Sub tsxGNodeTranslate Lib "tsxapi.dll" ( _
  958.       ByVal pGNode As Long, _
  959.       ByRef pVec As CtsxVector3f, _
  960.       ByVal frameid As Long)
  961.  
  962. '// Rotate by fAngle radians about pAxis passing thru pCenter,
  963. '// in the specified reference frame.
  964. 'TSXAPIFN void tsxGNodeRotate(
  965.     'tsxGNODE* pGNode,
  966.     'CtsxVector3f* pCenter,  //Center of rotation.
  967.     'CtsxVector3f* pAxis,    //Rotation axis passing thru pCenter.
  968.     'float fAngle,       //Radians. Rotation angle.
  969.     'tsxFRAMEID frameid
  970.     ');
  971. Declare Sub tsxGNodeRotate Lib "tsxapi.dll" ( _
  972.       ByVal pGNode As Long, _
  973.       ByRef pCenter As CtsxVector3f, _
  974.       ByRef pAxis As CtsxVector3f, _
  975.       ByVal fAngle As Single, _
  976.       ByVal frameid As Long)
  977.  
  978. '// Scale by factors along each axis, in the specified reference frame.
  979. '// Scale factors must be non-zero.
  980. 'TSXAPIFN void tsxGNodeScale(
  981.     'tsxGNODE* pGNode,
  982.     'CtsxVector3f* pScaleFacs,   //x, y, z scale factors (non-zero)
  983.     'tsxFRAMEID frameid
  984.     ');
  985. Declare Sub tsxGNodeScale Lib "tsxapi.dll" ( _
  986.       ByVal pGNode As Long, _
  987.       ByRef pScaleFacs As CtsxVector3f, _
  988.       ByVal frameid As Long)
  989.  
  990. '// Scale by factor UNIFORMLY along each axis, in the specified reference frame.
  991. '// Scale factor must be non-zero.
  992. 'TSXAPIFN void tsxGNodeScaleUniform(
  993.     'tsxGNODE* pGNode,
  994.     'float fScaleFac,
  995.     'tsxFRAMEID frameid
  996.     ');
  997. Declare Sub tsxGNodeScaleUniform Lib "tsxapi.dll" ( _
  998.       ByVal pGNode As Long, _
  999.       ByVal pScaleFac As Single, _
  1000.       ByVal frameid As Long)
  1001.       
  1002. '------------------------------------------------------------------------------
  1003. '//    File: tsxCamra.h
  1004. '//   Descr: Interface to tsxCAMERA
  1005.  
  1006. '// Creates a camera at world origin, with the viewing plane on the world
  1007. '// YZ plane, Z in the up direction, and pointing in the positive world X
  1008. '// direction. On success, the new camera is the currently selected object.
  1009. 'TSXAPIFN tsxERR tsxCameraCreateInScene();
  1010. Declare Function tsxCameraCreateInScene Lib "tsxapi.dll" () As Long
  1011.  
  1012. '------------------------------------------------------------------------------
  1013. '//    File: tsxSelect.h
  1014. '//   Descr: The Selection Mechanism
  1015.  
  1016. Enum tsxSELECTMODE
  1017.     e_tsxSELECT    '// Ordinary Selection of a Node.
  1018.     e_tsxERASE     '// For selecting an object after erasing curr obj.
  1019.     e_tsxGLUE      '// For selecting an object to attach to curr obj.
  1020. End Enum
  1021.  
  1022. '// e_tsxTRUE if pSobj is of supported selectable type (see doc above).
  1023. 'TSXAPIFN tsxBOOL tsxIsSelectable( tsxSOBJ* pSobj );
  1024. Declare Function tsxIsSelectable Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  1025.  
  1026. '// e_tsxTRUE if pSobj is part of a selected Object/Group
  1027. 'TSXAPIFN tsxBOOL tsxIsSelected( tsxSOBJ* pSobj );
  1028. Declare Function tsxIsSelected Lib "tsxapi.dll" (ByVal pSobj As Long) As Long
  1029.  
  1030. '// Get pointer to the currently selected object.
  1031. '// Note: trueSpace may select objects that are not currently supported in TSX.
  1032. 'TSXAPIFN tsxSOBJ* tsxGetCurrentSelection();
  1033. Declare Function tsxGetCurrentSelection Lib "tsxapi.dll" () As Long
  1034.  
  1035. '// Essentially same (with correct args) as picking an object with the mouse.
  1036. '// Make specified pSobj the current selection.
  1037. '// Set `bNoDraw' to e_tsxTRUE if you do not wish the object to be redrawn in
  1038. '// "selected" mode.  Use this feature carefully, as it might result in all
  1039. '// or portions of the object being erased when the next object is selected.
  1040. '// Primarily meant as a mechanism for temporarily selecting an object for
  1041. '// operations, and to be followed by a scene refresh.
  1042. 'TSXAPIFN void tsxSelectSobj(
  1043.     'tsxSOBJ* pSobj,     //Must be `tsxIsSelectable'
  1044.     'tsxSELECTMODE selmode,
  1045.     'tsxBOOL bNoDraw     //TRUE if Views should not be updated.
  1046.     ');
  1047. Declare Sub tsxSelectSobj Lib "tsxapi.dll" (ByVal pSobj As Long, ByVal selmode As Long, ByVal bNoDraw As Long)
  1048.  
  1049. '// Same function as called on the [downArrow] button.
  1050. '// Selects a child of the Currobj.
  1051. '// Views updated.
  1052. 'TSXAPIFN void tsxSelectDown();
  1053. Declare Sub tsxSelectDown Lib "tsxapi.dll" ()
  1054.  
  1055. '// Same function as called on the [upArrow] button.
  1056. '// Selects parent of Currobj.
  1057. '// Views updated.
  1058. 'TSXAPIFN void tsxSelectUp();
  1059. Declare Sub tsxSelectUp Lib "tsxapi.dll" ()
  1060.  
  1061. '// Same function as called on the <rightArrow> key.
  1062. '// Selects a sibling of the Currobj, following Currobj in the list.
  1063. '// Views updated.
  1064. 'TSXAPIFN void tsxSelectNext();
  1065. Declare Sub tsxSelectNext Lib "tsxapi.dll" ()
  1066.  
  1067. '// Same function as called on the <leftArrow> key.
  1068. '// Selects a sibling of the Currobj, preceeding Currobj in the list.
  1069. '// Views updated.
  1070. 'TSXAPIFN void tsxSelectPrev();
  1071. Declare Sub tsxSelectPrev Lib "tsxapi.dll" ()
  1072.  
  1073. '// Removes the current object and substitutes it with pNewGNode.
  1074. '// If the selected part of the current object does not include it's children,
  1075. '// the children are moved to the new object and removed from the current
  1076. '// object, leaving the children non-selected. pNewGNode is installed in
  1077. '// Currobj's location, and becomes the new Currobj. The old Currobj is deleted.
  1078. 'TSXAPIFN void tsxCurrobjReplace(
  1079.     'tsxGNODE* pNewGNode,
  1080.     'tsxBOOL bNoDraw    //TRUE if View displays should not be refreshed.
  1081.     ');
  1082. Declare Sub tsxCurrobjReplace Lib "tsxapi.dll" (ByVal pNewGNode As Long, ByVal bNoDraw As Long)
  1083.  
  1084. '// Copy curr obj and add to scene at top level, making it new currobj.
  1085. 'TSXAPIFN tsxERR tsxCurrobjCopy();
  1086. Declare Function tsxCurrobjCopy Lib "tsxapi.dll" () As Long
  1087.  
  1088. '// Draw the curr selection
  1089. 'TSXAPIFN void tsxCurrobjDraw();
  1090. Declare Sub tsxCurrobjDraw Lib "tsxapi.dll" ()
  1091.  
  1092. '// Photo-render the current object in the active view.
  1093. 'TSXAPIFN void tsxCurrobjPhrender();
  1094. Declare Sub tsxCurrobjPhrender Lib "tsxapi.dll" ()
  1095.  
  1096.  
  1097.