File3DSTypes.pas 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317
  1. //
  2. // This unit is part of the GLScene Engine, http://glscene.org
  3. //
  4. {
  5. Implements the standard Teapot, build from evaluators.
  6. }
  7. // This unit contains all of the data types used by the core routines. Most of these are only used
  8. // with the internal database, created when a file is loaded.
  9. //
  10. // Last change - 03. October 1999
  11. //
  12. // (c) Copyright 1999, Dipl. Ing. Mike Lischke ([email protected])
  13. unit File3DSTypes;
  14. {$ALIGN ON}
  15. {$MINENUMSIZE 4}
  16. interface
  17. {$I GLScene.inc}
  18. uses
  19. System.Classes, // for TStringList
  20. System.SysUtils;
  21. //---------------- commonly used structures ----------------------------------
  22. type
  23. TDumpLevel = (dlTerseDump, dlMediumDump, dlMaximumDump);
  24. PChar3DS = PAnsiChar;
  25. String3DS = UTF8String;
  26. String64 = string[64];
  27. PWordList = ^TWordList;
  28. TWordList = array[0..MaxInt div (2*SizeOf(Word))] of Word;
  29. PIntegerArray = ^TIntegerArray;
  30. TIntegerArray = array[0..MaxInt div (2*SizeOf(Integer))] of Integer;
  31. PCardinalArray = ^TCardinalArray;
  32. TCardinalArray = array[0..MaxInt div (2*SizeOf(Cardinal))] of Cardinal;
  33. PSingleList = ^TSingleList;
  34. TSingleList = array[0..MaxInt div (2*SizeOf(Single))] of Single;
  35. PPoint3DS = ^TPoint3DS; // 3D point structure
  36. TPoint3DS = record
  37. X, Y, Z : Single;
  38. end;
  39. PPointList = ^TPointList;
  40. TPointList = array[0..MaxInt div (2*SizeOf(TPoint3DS))] of TPoint3DS;
  41. PFColor3DS = ^TFColor3DS; // RGB Color components
  42. TFColor3DS = record
  43. R, G, B: Single;
  44. end;
  45. PFColorList = ^TFColorList;
  46. TFColorList = array[0..MaxInt div (2*SizeOf(TFColor3DS))] of TFColor3DS;
  47. PFace3DS = ^TFace3DS; // Face List element
  48. TFace3DS = packed record
  49. case Boolean of
  50. True: (V1, V2, V3, Flag: Word);
  51. False: (FaceRec: array[0..3] of Word);
  52. end;
  53. PFaceList = ^TFaceList;
  54. TFaceList = array[0..MaxInt div (2*SizeOf(TFace3DS))] of TFace3DS;
  55. PTexVert3DS = ^TTexVert3DS; // Texture assignment coordinate
  56. TTexVert3DS = record
  57. U, V: Single;
  58. end;
  59. PTexVertList = ^TTexVertList;
  60. TTexVertList = array[0..MaxInt div (2*SizeOf(TTexVert3DS))] of TTexVert3DS;
  61. PTrackHeader3DS = ^TTrackHeader3DS; // Global track settings
  62. TTrackHeader3DS = record
  63. Flags: Word;
  64. nu1, nu2,
  65. KeyCount: Integer; // Number of keys in the track
  66. end;
  67. PKeyHeader3DS = ^TKeyHeader3DS; // Animation key settings
  68. TKeyHeader3DS = record
  69. Time: Integer; // Key's frame position
  70. RFlags: Word; // Spline terms used flag
  71. Tension: Single; // Flagged with $01
  72. Continuity: Single; // Flagged with $02
  73. Bias: Single; // Flagged with $04
  74. EaseTo: Single; // Flagged with $08
  75. EaseFrom: Single; // Flagged with $10
  76. end;
  77. PKeyHeaderList = ^TKeyHeaderList;
  78. TKeyHeaderList = array[0..MaxInt div (2*SizeOf(TKeyHeader3DS))] of TKeyHeader3DS;
  79. PKFRotKey3DS = ^TKFRotKey3DS; // Rotation key
  80. TKFRotKey3DS = record
  81. Angle: Single; // Angle of Rotation
  82. X, Y, Z: Single; // Rotation axis vector
  83. end;
  84. PKFRotKeyList = ^TKFRotKeyList;
  85. TKFRotKeyList = array[0..MaxInt div (2*SizeOf(TKFRotKey3DS))] of TKFRotKey3DS;
  86. PKFMorphKey3DS = ^TKFMorphKey3DS; // Object Morph key
  87. TKFMorphKey3DS = String; // Name of Target Morph object
  88. PKFMorphKeyList = ^TKFMorphKeyList;
  89. TKFMorphKeyList = array[0..MaxInt div (2*SizeOf(TKFMorphKey3DS))] of TKFMorphKey3DS;
  90. PChunk3DS = ^TChunk3DS; // internal database representation of file information
  91. PChunkListEntry3DS = ^TChunkListEntry3DS; // cross reference between Name and Chunk
  92. TChunkListEntry3DS = record
  93. NameStr: String; // chunk name list
  94. Chunk: PChunk3DS; // corresponding pos
  95. end;
  96. PChunkList = ^TChunkList;
  97. TChunkList = array[0..MaxInt div (2*SizeOf(TChunkListEntry3DS))] of TChunkListEntry3DS;
  98. PChunkList3DS = ^TChunkList3DS; // list of cross references
  99. TChunkList3DS = record
  100. Count: Integer; // number of entries in List
  101. List: PChunkList; // contents of List
  102. end;
  103. { replaced by a TStringList
  104. PNameList = ^TNameList;
  105. TNameList = array[0..0] of String;
  106. PNameList3DS = ^TNameList3DS; // list of database object names
  107. TNameList3DS = record
  108. Count : Integer; // how many entries are in list
  109. Spaces : Integer; // how much space for entries
  110. Names : PNameList; // to access pointers
  111. end;}
  112. // Database type settings
  113. TDBType3DS = (dbUnknown, // database has not been created yet
  114. dbMeshFile, // 3D Studio .3DS file
  115. dbProjectFile, // 3D Studio .PRJ file
  116. dbMaterialFile // 3D Studio .MLI file
  117. );
  118. PNodeList = ^TNodeList;
  119. TNodeList = record
  120. ID: SmallInt;
  121. Tag: Word;
  122. Name,
  123. InstStr: String;
  124. ParentID: SmallInt;
  125. Next: PNodeList;
  126. end;
  127. PDatabase3DS = ^TDatabase3DS; // file database
  128. TDatabase3DS = record
  129. TopChunk: PChunk3DS; // Top chunk in the file
  130. ObjListDirty, // If True, than ObjList needs to be recreated
  131. MatListDirty,
  132. NodeListDirty: Boolean;
  133. ObjList, // Quick Cross references between names and database chunks
  134. MatList,
  135. NodeList: PChunkList3DS;
  136. end;
  137. TViewType3DS = (vtNoView3DS,
  138. vtTopView3DS,
  139. vtBottomView3DS,
  140. vtLeftView3DS,
  141. vtRightView3DS,
  142. vtFrontView3DS,
  143. vtBackView3DS,
  144. vtUserView3DS,
  145. vtCameraView3DS,
  146. vtSpotlightView3DS);
  147. PViewSize3DS = ^TViewSize3DS;
  148. TViewSize3DS = record
  149. XPos,
  150. YPos,
  151. Width,
  152. Height: Word;
  153. end;
  154. POrthoView3DS = ^TOrthoView3DS; // Used to describe Top, Bottom, left, right, front and back views
  155. TOrthoView3DS = record
  156. Center: TPoint3DS; // Center of orthogonal View
  157. Zoom: Single; // View Zoom factor
  158. end;
  159. PUserView3DS = ^TUserView3DS;
  160. TUserView3DS = record // Used to describe User views
  161. Center: TPoint3DS; // Center of User View
  162. Zoom: Single; // View Zoom factor
  163. HorAng: Single; // Horizontal Angle of View
  164. VerAng: Single; // Vertical Angle of View
  165. end;
  166. PViewport3DS = ^TViewport3DS; // Viewport structure details the kind of View in a viewport
  167. TViewport3DS = record
  168. AType: TViewType3DS; // top, bottom, left, right, front, back, user and camera, spot
  169. Size: TViewSize3DS; // size of the viewport
  170. Ortho: TOrthoView3DS; // used for top, bottom, left, right, front, and back views
  171. User: TUserView3DS; // Used for User views
  172. CameraStr: String; // used for camera views
  173. end;
  174. TShadowStyle3DS = (ssUseShadowMap,
  175. ssUseRayTraceShadow);
  176. PShadowSets3DS = ^TShadowSets3DS; // global Shadow settings
  177. TShadowSets3DS = record
  178. AType: TShadowStyle3DS; // either UseShadowMaps or UseRayTraceShadows
  179. Bias: Single; // Shadow Bias factor.
  180. RayBias: Single; // Shadow ray Bias factor, Used in R3
  181. MapSize: Smallint; // Shadow Map Size
  182. Filter: Single; // Shadow Filter
  183. end;
  184. PMeshSet3DS = ^TMeshSet3DS;
  185. TMeshSet3DS = record
  186. MasterScale: Single; // master mesh Scale factor
  187. Shadow: TShadowSets3DS; // Global Shadow settings
  188. AmbientLight: TFColor3DS; // Ambient light Color
  189. OConsts: TPoint3DS; // default object constructing axis
  190. end;
  191. TAtmosphereType3DS = (atNoAtmo, // no active atmospherics
  192. atUseFog, // Fog atmospheric
  193. atUseLayerFog, // layer Fog atmospheric
  194. atUseDistanceCue // distance cue atmospheric
  195. );
  196. TLayerFogFalloff3DS = (lfNoFall, // no FallOff
  197. lfTopFall, // FallOff to the Top
  198. lfBottomFall // FallOff to the Bottom
  199. );
  200. PFogSettings3DS = ^TFogSettings3DS; // Fog atmosphere parameters
  201. TFogSettings3DS = record
  202. NearPlane: Single; // near radius of Fog effect
  203. NearDensity: Single; // near Fog Density
  204. FarPlane: Single; // far radius of Fog effect
  205. FarDensity: Single; // far Fog Density
  206. FogColor: TFColor3DS; // Color of Fog effect
  207. FogBgnd: Boolean; // "Fog background" Flag
  208. end;
  209. PLayerFogSettings3DS = ^TLayerFogSettings3DS; // layered Fog atmosphere parameters
  210. TLayerFogSettings3DS = record
  211. ZMin: Single; // lower bounds of Fog
  212. ZMax: Single; // upper bounds of Fog
  213. Density: Single; // Fog Density
  214. FogColor: TFColor3DS; // Fog Color
  215. FallOff: TLayerFogFalloff3DS; // FallOff style
  216. FogBgnd: Boolean; // "Fog background" Flag
  217. end;
  218. PDCueSettings3DS = ^TDCueSettings3DS; // distance cue atmosphere parameters
  219. TDCueSettings3DS = record
  220. NearPlane: Single; // near radius of effect
  221. NearDim: Single; // near dimming factor
  222. FarPlane: Single; // far radius of effect
  223. FarDim: Single; // far dimming factor
  224. DCueBgnd: Boolean; // effect the background Flag
  225. end;
  226. PAtmosphere3DS = ^TAtmosphere3DS;
  227. TAtmosphere3DS = record
  228. Fog: TFogSettings3DS; // Fog atmosphere settings
  229. LayerFog: TLayerFogSettings3DS; // layered Fog atmosphere parameters
  230. DCue: TDCueSettings3DS; // distance cue atmosphere parameters
  231. ActiveAtmo: TAtmosphereType3DS; // the active atmospheric
  232. end;
  233. // enumerate list of possible backgrounds used in file
  234. TBackgroundType3DS = (btNoBgnd,
  235. btUseSolidBgnd,
  236. btUseVGradientBgnd,
  237. btUseBitmapBgnd);
  238. PBitmapBgnd3DS = ^TBitmapBgnd3DS;
  239. TBitmapBgnd3DS = AnsiString; // Name of background Bitmap
  240. TSolidBgnd3DS = TFColor3DS; // Color of Solid background
  241. PVGradientBgnd3DS = ^TVGradientBgnd3DS;
  242. TVGradientBgnd3DS = record
  243. GradPercent: Single; // placement of Mid Color band, Ranges from 0-1
  244. Top: TFColor3DS; // color of Top band
  245. Mid: TFColor3DS; // color of Mid background band
  246. Bottom: TFColor3DS; // color of Bottom band
  247. end;
  248. PBackground3DS = ^TBackground3DS;
  249. TBackground3DS = record
  250. Bitmap: TBitmapBgnd3DS;
  251. Solid: TSolidBgnd3DS;
  252. VGradient: TVGradientBgnd3DS;
  253. BgndUsed: TBackgroundType3DS; // background in effect
  254. end;
  255. // used for shading field in TMaterial3DS structure
  256. TShadeType3DS = (stWire,
  257. stFlat,
  258. stGouraud,
  259. stPhong,
  260. stMetal);
  261. // used for tiling field in TBitmap3DS structure
  262. TTileType3DS = (ttTile,
  263. ttDecal,
  264. ttBoth);
  265. TFilterType3DS = (ftPyramidal,
  266. ftSummedArea);
  267. TTintType3DS = (ttRGB,
  268. ttAlpha,
  269. ttRGBLumaTint,
  270. ttAlphaTint,
  271. ttRGBTint);
  272. // used by AddMaterial3DS
  273. PACubic3DS = ^TACubic3DS;
  274. TACubic3DS = record
  275. FirstFrame: Boolean; // True for First Frame Only
  276. Flat: Boolean; // True for Flat Mirror reflection
  277. Size: Integer; // Map resolution
  278. nthFrame: Integer; // Map update period
  279. end;
  280. // Cubic reflection Map defintion
  281. PBitmap3DS = ^TBitmap3DS;
  282. TBitmap3DS = record
  283. NameStr: AnsiString; // Bitmap file name
  284. Percent: Single; // Strength percentage
  285. Tiling: TTileType3DS; // Tile/Decal/Both
  286. IgnoreAlpha: Boolean;
  287. Filter: TFilterType3DS; // Pyramidal/Summed Area
  288. Blur: Single;
  289. Mirror: Boolean;
  290. Negative: Boolean;
  291. UScale: Single;
  292. VScale: Single;
  293. UOffset: Single;
  294. VOffset: Single;
  295. Rotation: Single;
  296. Source: TTintType3DS; // RGB/RGB Luma Tint/Alpha Tint/RGB Tint
  297. Tint1: TFColor3DS;
  298. Tint2: TFColor3DS;
  299. RedTint: TFColor3DS;
  300. GreenTint: TFColor3DS;
  301. BlueTint: TFColor3DS;
  302. DataSize: Integer; // Size of procedural Data
  303. Data: Pointer; // Procedural Data
  304. end;
  305. // Bit Map definition
  306. // Structure to all Map settings
  307. PMapSet3DS = ^TMapSet3DS;
  308. TMapSet3DS = record
  309. Map: TBitmap3DS; // The Map settings
  310. Mask: TBitmap3DS; // The Mask settings
  311. end;
  312. TRMapSet3DS = record
  313. Map: TBitmap3DS; // The Map settings
  314. UseAuto: Boolean; // True if automatic reflections are being used
  315. AutoMap: TACubic3DS; // Automatic reflection definitions
  316. Mask: TBitmap3DS; // The Mask settings
  317. end;
  318. PMaterial3DS = ^TMaterial3DS;
  319. TMaterial3DS = record
  320. NameStr: AnsiString; // Name
  321. Ambient: TFColor3DS; // Ambient Light Color
  322. Diffuse: TFColor3DS; // Diffuse Light Color
  323. Specular: TFColor3DS; // Specular Light Color
  324. Shininess: Single; // Shininess factor
  325. ShinStrength: Single; // Shininess strength
  326. Blur: Single; // Blur factor
  327. Transparency: Single; // Trasparency factor
  328. TransFallOff: Single; // Falloff factor
  329. SelfIllumPct: Single; // Self illumination percentage
  330. WireSize: Single; // Width of wireframe
  331. Shading: TShadeType3DS; // Shading type
  332. UseBlur: Boolean; // Blurring Flag
  333. UseFall: Boolean; // Transparency FallOff Flag
  334. TwoSided: Boolean; // Two sided material Flag
  335. SelFillum: Boolean; // Self illumination Flag
  336. Additive: Boolean; // Additive Transparency Flag
  337. UseWire: Boolean; // Use wireframe rendering
  338. UseWireAbs: Boolean; // Wire Size is in units, not pixels.
  339. FaceMap: Boolean; // Face mapping switch
  340. Soften: Boolean; // Soften switch
  341. Texture: TMapSet3DS; // Texture Map settings
  342. Texture2: TMapSet3DS; // Second Texture Map settings
  343. Opacity: TMapSet3DS; // Opacity Map settings
  344. Bump: TMapSet3DS; // Bump Map settings
  345. SpecMap: TMapSet3DS; // Specularity Map settings
  346. ShinMap: TMapSet3DS; // Shininess Map settings
  347. IllumMap: TMapSet3DS; // Self illumination Map settings
  348. Reflect: TRMapSet3DS; // Reflection Map settings
  349. end;
  350. // Mesh definition
  351. PMeshMatrix = ^TMeshMatrix;
  352. TMeshMatrix = array[0..11] of Single;
  353. // Texture Map icon placement
  354. PMapInfo3DS = ^TMapInfo3DS;
  355. TMapInfo3DS = record
  356. MapType: Word; // icon type
  357. TileX: Single; // tiling
  358. TileY: Single;
  359. CenX: Single; // position of center
  360. CenY: Single;
  361. CenZ: Single;
  362. Scale: Single; // icon scaling factor
  363. Matrix: TMeshMatrix; // orientation matrix
  364. PW: Single; // planar icon width
  365. PH: Single; // planar icon height
  366. CH: Single; // cylinder icon height
  367. end;
  368. // Material assignments by face
  369. PObjMat3DS = ^TObjMat3DS;
  370. TObjMat3DS = record
  371. NameStr: AnsiString; // material name
  372. NFaces: Word; // number of faces using material
  373. FaceIndex: PWordList; // list of faces using material
  374. end;
  375. PObjMatList = ^TObjMatList;
  376. TObjMatList = array[0..MaxInt div (2*SizeOf(TObjMat3DS))] of TObjMat3DS;
  377. // Mesh object definition
  378. PMesh3DS = ^TMesh3DS;
  379. TMesh3DS = record
  380. NameStr: AnsiString; // object name
  381. IsHidden: Boolean; // hidden object flag
  382. IsvisLofter: Boolean; // lofter visibility flag
  383. IsMatte: Boolean; // matte object flag
  384. IsNoCast: Boolean; // doesn't cast shadows flag
  385. IsFast: Boolean; // fast display flag
  386. IsNorcvShad: boolean; // doesn't recieve shadows
  387. IsFrozen: Boolean; // frozen object flag
  388. NVertices: Word; // vertice count
  389. VertexArray: PPointList; // list of vertices
  390. NVFlags: Word; // number of vertex flags
  391. VFlagArray: PWordList; // list of vertex flags
  392. NTextVerts: Word; // number of texture vertices
  393. TextArray: PTexVertList; // list of texture coordinates
  394. UseMapInfo: Boolean; // for use of mapping icon information
  395. Map: TMapInfo3DS; // mapping icon info
  396. LocMatrix: TMeshMatrix; // object orientation matrix
  397. NFaces: Word; // face count
  398. FaceArray: PFaceList; // list of faces
  399. SmoothArray: PCardinalArray; // smoothing group assignment list
  400. UseBoxMap: Boolean; // used to indicate the use of box mapping
  401. BoxMapStr: array[0..5] of String; // material names used in boxmapping
  402. MeshColor: Byte; // UI color assigned to the mesh
  403. NMats: Word; // assigned materials count
  404. MatArray: PObjMatList; // material assignment list
  405. UseProc: Boolean; // use animated stand-in flag
  406. ProcSize: Integer; // size of animated stand-in data
  407. ProcNameStr: String; // name of animated stand-in procedure
  408. ProcData: Pointer; // animated stand-in data
  409. end;
  410. // Spotlight projection cone shape
  411. TConeStyle3DS = (csCircular,
  412. csRectangular);
  413. // Spotlight shadow settings
  414. PSpotShadow3DS = ^TSpotShadow3DS;
  415. TSpotShadow3DS = record
  416. Cast: Boolean; // True if spotlight casts shadows
  417. AType: TShadowStyle3DS; // UseShadow or UseRayTrace
  418. Local: Boolean; // True if local shadow settings are being used
  419. Bias: Single; // shadow bias
  420. Filter: Single; // shadow filter
  421. MapSize: Word; // shadow map size
  422. RayBias: Single; // Ray tracing shadow bias
  423. end;
  424. // Cone visibility settings
  425. PSpotCone3DS = ^TSpotCone3DS;
  426. TSpotCone3DS = record
  427. AType: TConeStyle3DS; // Circular or rectangular light cone
  428. Show: Boolean; // True if cone is visible
  429. Overshoot: Boolean; // True if cone overshoot is on
  430. end;
  431. // spotlight projectio Bitmap
  432. PSpotProjector3DS = ^TSpotProjector3DS;
  433. TSpotProjector3DS = record
  434. Use: Boolean; // True if using projector
  435. BitmapStr: String; // name of projector bitmap
  436. end;
  437. // spotlight settings
  438. PSpotLight3DS = ^TSpotLight3DS;
  439. TSpotLight3DS = record
  440. Target: TPoint3DS; // Spotlight Target
  441. Hotspot: Single; // Hotspot Angle
  442. FallOff: Single; // Hotspot FallOff
  443. Roll: Single; // Roll Angle
  444. Aspect: Single; // Aspect ratio
  445. Shadows: TSpotShadow3DS;
  446. Cone: TSpotCone3DS;
  447. Projector: TSpotProjector3DS;
  448. end;
  449. // Light Attenuation settings
  450. PLiteAttenuate3DS = ^TLiteAttenuate3DS;
  451. TLiteAttenuate3DS = record
  452. IsOn: Boolean; // True if Light Attenuation is on
  453. Inner: Single; // Inner range of Attenuation
  454. Outer: Single; // Outer range of Attenuation
  455. end;
  456. // omni and spotlight settings
  457. PLight3DS = ^TLight3DS;
  458. TLight3DS = record
  459. NameStr: AnsiString; // light name
  460. Pos: TPoint3DS; // light position
  461. Color: TFColor3DS; // light color
  462. Multiplier: Single; // light intensity multiplier
  463. DLOff: Boolean; // True if light is off
  464. Attenuation: TLiteAttenuate3DS;
  465. Exclude: TStringList;
  466. Spot: PSpotLight3DS; // if not nil then struct is a spotlight, else omni
  467. end;
  468. // Camera atomosphere Ranges
  469. PCamRanges3DS = ^TCamRanges3DS;
  470. TCamRanges3DS = record
  471. CamNear: Single; // Nearest effect radius
  472. CamFar: Single; // Farthest effect radius
  473. end;
  474. PCamera3DS = ^TCamera3DS;
  475. TCamera3DS = record
  476. NameStr: AnsiString;
  477. Position: TPoint3DS;
  478. Target: TPoint3DS;
  479. Roll: Single;
  480. FOV: Single;
  481. ShowCone: Boolean;
  482. Ranges: TCamRanges3DS;
  483. end;
  484. PKFKeyInfo3DS = ^TKFKeyInfo3DS;
  485. TKFKeyInfo3DS = record
  486. Length: Integer;
  487. CurFrame: Integer;
  488. end;
  489. PKFSegment3DS = ^TKFSegment3DS;
  490. TKFSegment3DS = record
  491. Use: Boolean;
  492. SegBegin: Integer;
  493. SegEnd: Integer;
  494. end;
  495. PKFSets3DS = ^TKFSets3DS;
  496. TKFSets3DS = record
  497. Anim: TKFKeyInfo3DS;
  498. Seg: TKFSegment3DS;
  499. end;
  500. PKFCamera3DS = ^TKFCamera3DS;
  501. TKFCamera3DS = record
  502. NameStr: AnsiString; // Name of Camera object
  503. ParentStr: AnsiString; // Name of Parent object
  504. Flags1: Word; // Flags field from node header -fixup later
  505. Flags2: Word; // Flags2 field from node header -fixup later
  506. NPKeys: Integer; // Number of Camera Position keys
  507. NPFlag: Word; // Loop control Flag for Camera Position keys
  508. PKeys: PKeyHeaderList; // Spline values for Camera Position keys
  509. Pos: PPointList; // Camera Position keys
  510. NFKeys: Integer; // Number of Camera FOV keys
  511. NFFlag: Word; // Loop control Flag for Camera FOV keys
  512. FKeys: PKeyHeaderList; // Spline values for Camera FOV keys
  513. FOV: PSingleList; // Camera FOV keys
  514. NRKeys: Integer; // Number of Camera Roll keys
  515. NRFlag: Word; // Loop control Flag for Camera Roll keys
  516. RKeys: PKeyHeaderList; // Spline values for Camera Roll keys
  517. Roll: PSingleList; // Camera Roll keys
  518. TParentStr: String; // Index of Parent object for Target
  519. NTKeys: Integer; // Number of Target Position keys
  520. NTFlag: Word; // Loop control Flag for Target Position keys
  521. TKeys: PKeyHeaderList; // Spline values for Target Position keys
  522. TPos: PPointList; // Target Position keys
  523. TFlags1: Word; // Flags field from Target node header
  524. TFlags2: Word; // Flags field from Target node header
  525. end;
  526. // Ambient Light animation
  527. PKFAmbient3DS = ^TKFAmbient3DS;
  528. TKFAmbient3DS = record
  529. Flags1: Word; // Flags field from node header -fixup later
  530. Flags2: Word; // Flags2 field from node header -fixup later
  531. NCKeys: Integer; // Number of Color keys
  532. NCFlag: Word; // Loop control Flag for Color keys
  533. CKeys: PKeyHeaderList; // Spline values for Position keys
  534. Color: PFColorList; // Color keys
  535. end;
  536. // used by ObjectMotion3DS
  537. PKFMesh3DS = ^TKFMesh3DS;
  538. TKFMesh3DS = record
  539. NameStr: AnsiString; // Name of mesh
  540. ParentStr: AnsiString; // Name of Parent object
  541. Flags1: Word; // Flags field from node header
  542. Flags2: Word; // Flags2 field from node header
  543. Pivot: TPoint3DS; // Object Pivot point
  544. InstanceStr: AnsiString; // Object Instance Name
  545. BoundMin: TPoint3DS; // Minimum bounding box point for dummy objects
  546. BoundMax: TPoint3DS; // Maximum bounding box point for dummy objects
  547. NPKeys: Integer; // Number of Position keys
  548. NPFlag: Smallint; // Loop control Flag for Position keys
  549. PKeys: PKeyHeaderList; // Spline values for Position keys
  550. Pos: PPointList; // Mesh Position keys
  551. NRKeys: Integer; // Number of Rotation keys
  552. NRFlag: Smallint; // Loop control Flag for Rotation keys
  553. RKeys: PKeyHeaderList; // Spline values for Rotation keys
  554. Rot: PKFRotKeyList; // Rotation keys
  555. NSKeys: Integer; // Number of scaling keys
  556. NSFlag: Smallint; // Loop control Flag for scaling keys
  557. SKeys: PKeyHeaderList; // Spline values for scaling
  558. Scale: PPointList; // Mesh scaling keys
  559. NMKeys: Integer; // Number of Morph keys
  560. NMFlag: Smallint; // Loop control Flag for Morph keys
  561. MKeys: PKeyHeaderList; // Spline values for Morph keys
  562. Morph: PKFMorphKeyList; // Morph keys
  563. NHKeys: Integer; // Number of hide keys
  564. NHFlag: Smallint; // Loop control Flag for hide keys
  565. HKeys: PKeyHeaderList; // Spline values for hide keys
  566. MSAngle: Single; // Morph smoothing group Angle
  567. end;
  568. // used by OmnilightMotion3DS
  569. PKFOmni3DS = ^TKFOmni3DS;
  570. TKFOmni3DS = record
  571. Name: AnsiString; // Name of the Light object node
  572. Parent: AnsiString; // Name of the Parent object
  573. Flags1: Word; // Flags field from node header -fixup later
  574. Flags2: Word; // Flags2 field from node header -fixup later
  575. NPKeys: Integer; // Number of Position keys
  576. NPFlag: Word; // Loop control Flag for Position keys
  577. PKeys: PKeyHeaderList; // Spline values for Position keys
  578. Pos: PPointList; // Position keys
  579. NCKeys: Integer; // Number of Color keys
  580. NCFlag: Word; // Loop control Flag for Color keys
  581. CKeys: PKeyHeaderList; // Spline values for Position keys
  582. Color: PFColorList; // Color keys
  583. end;
  584. PKFSpot3DS = ^TKFSpot3DS;
  585. TKFSpot3DS = record
  586. Name: AnsiString; // Name of Camera object
  587. Parent: AnsiString; // Parent Name
  588. Flags1: Word; // Flags field from node header -fixup later
  589. Flags2: Word; // Flags2 field from node header -fixup later
  590. {$ifdef broken}
  591. visible: Smallint; // Flags to control visibility
  592. {$endif}
  593. NPKeys: Integer; // Number of Light Position keys
  594. NPFlag: Word; // Loop control Flag for Position keys
  595. PKeys: PKeyHeaderList; // Spline values for Light Position keys
  596. Pos: PPointList; // Light Position keys
  597. NCKeys: Integer; // Number of Color keys
  598. NCFlag: Word; // Loop control Flag Color keys
  599. CKeys: PKeyHeaderList; // Spline values for Color keys
  600. Color: PFColorList; // Color keys
  601. NHKeys: Integer; // Number of Hotspot Angle keys
  602. NHFlag: Word; // Loop control Flag for Hotspot Angle keys
  603. HKeys: PKeyHeaderList; // Spline values for Hotspot Angle keys
  604. Hot: PSingleList; // Hotspot Angle keys
  605. NFKeys: Integer; // Number of FallOff Angle keys
  606. NFFlag: Word; // Loop control Flag for FallOff Angle keys
  607. FKeys: PKeyHeaderList; // Spline values for FallOff Angle keys
  608. Fall: PSingleList; // FallOff Angle keys
  609. NRKeys: Integer; // Number of Light Roll keys
  610. NRFlag: Word; // Loop control Flag for Light Roll keys
  611. RKeys: PKeyHeaderList; // Spline values for Light Roll keys
  612. Roll: PSingleList; // Light Roll keys
  613. TParent: AnsiString; // Name of Target's Parent object
  614. NTKeys: Integer; // Number of Target Position keys
  615. NTFlag: Word; // Loop control Flag for Target Position keys
  616. TKeys: PKeyHeaderList; // Spline values for Target Position keys
  617. TPos: PPointList; // Target Position keys
  618. TFlags1: Word; // Flags field from Target node header
  619. TFlags2: Word; // Flags field from Target node header
  620. end;
  621. PXDataRaw3DS = ^TXDataRaw3DS;
  622. TXDataRaw3DS = record
  623. Size: Integer;
  624. Data: Pointer;
  625. end;
  626. TTargetType3DS = (ttLightTarget,ttCameraTarget);
  627. PM3dVersion = ^TM3dVersion;
  628. TM3dVersion = Cardinal;
  629. // inner datatypes not followed by a '3DS' to show they are locally used
  630. // (mostly as a part of another chunk or while collecting specific data)
  631. PColorF = ^TColorF;
  632. TColorF = record
  633. Red, Green, Blue: Single;
  634. end;
  635. PLinColorF = ^TLinColorF;
  636. TLinColorF = TColorF;
  637. PColor24 = ^TColor24;
  638. TColor24 = record
  639. Red, Green, Blue: Byte;
  640. end;
  641. PLinColor24 = ^TLinColor24;
  642. TLinColor24 = TColor24;
  643. PMatMapRCol = ^TMatMapRCol;
  644. TMatMapRCol = TLinColor24;
  645. PMatMapGCol = ^TMatMapGCol;
  646. TMatMapGCol = TMatMapRCol;
  647. PMatMapBCol = ^TMatMapBCol;
  648. TMatMapBCol = TMatMapGCol;
  649. PMatMapCol1 = ^TMatMapCol1;
  650. TMatMapCol1 = TMatMapBCol;
  651. PMatMapCol2 = ^TMatMapCol2;
  652. TMatMapCol2 = TMatMapCol1;
  653. PIntPercentage = ^TIntPercentage;
  654. TIntPercentage = SmallInt;
  655. PMatBumpPercent = ^TMatBumpPercent;
  656. TMatBumpPercent = TIntPercentage;
  657. PFloatPercentage = ^TFloatPercentage;
  658. TFloatPercentage = Single;
  659. PMatMapname = PChar3DS;
  660. PMeshVersion = ^TMeshVersion;
  661. TMeshVersion = Integer;
  662. PMasterScale = ^TMasterScale;
  663. TMasterScale = Single;
  664. PLoShadowBias = ^TLoShadowBias;
  665. TLoShadowBias = Single;
  666. PHiShadowBias = ^THiShadowBias;
  667. THiShadowBias = TLoShadowBias;
  668. PRayBias = ^TRayBias;
  669. TRayBias = THiShadowBias;
  670. PShadowMapSize = ^TShadowMapSize;
  671. TShadowMapSize = SmallInt;
  672. PShadowSamples = ^TShadowSamples;
  673. TShadowSamples = SmallInt;
  674. PShadowRange = ^TShadowRange;
  675. TShadowRange = Integer;
  676. PShadowFilter = ^TShadowFilter;
  677. TShadowFilter = Single;
  678. POConsts = ^TOConsts;
  679. TOConsts = TPoint3DS;
  680. PBitMapName = PChar3DS;
  681. PVGradient = ^TVGradient;
  682. TVGradient = Single;
  683. PFog = ^TFog;
  684. TFog = record
  685. NearPlaneDist: Single;
  686. NearPlaneDensity: Single;
  687. FarPlaneDist: Single;
  688. FarPlaneDensity: Single;
  689. end;
  690. PLayerFog = ^TLayerFog;
  691. TLayerFog = record
  692. ZMin: Single;
  693. ZMax: Single;
  694. Density: Single;
  695. AType: Cardinal;
  696. end;
  697. PDistanceCue = ^TDistanceCue;
  698. TDistanceCue = record
  699. NearPlaneDist: Single;
  700. NearPlaneDimming: Single;
  701. FarPlaneDist: Single;
  702. FarPlaneDimming: Single;
  703. end;
  704. PViewStandard = ^TViewStandard;
  705. TViewStandard = record
  706. ViewTargetCoord: TPoint3DS;
  707. ViewWidth: Single;
  708. end;
  709. PViewUser = ^TViewUser;
  710. TViewUser = record
  711. ViewTargetCoord: TPoint3DS;
  712. ViewWidth: Single;
  713. XYViewangle: Single;
  714. YZViewangle: Single;
  715. BankAngle: Single;
  716. end;
  717. PViewCamera = PChar3DS;
  718. PMatName = PChar3DS;
  719. PMatShading = ^TMatShading;
  720. TMatShading = SmallInt;
  721. PMatAcubic = ^TMatAcubic;
  722. TMatAcubic = record
  723. ShadeLevel: Byte;
  724. Antialias: Byte;
  725. Flags: SmallInt;
  726. MapSize: Cardinal;
  727. FrameInterval: Cardinal;
  728. end;
  729. PIpasData = ^TIpasData;
  730. TIpasData = record
  731. Size: Integer;
  732. Data: Pointer;
  733. end;
  734. PMatWireSize = ^TMatWireSize;
  735. TMatWireSize = Single;
  736. PMatMapTiling = ^TMatMapTiling;
  737. TMatMapTiling = Word;
  738. PMatMapTexblur = ^TMatMapTexblur;
  739. TMatMapTexblur = Single;
  740. PMatMapUScale = ^TMatMapUScale;
  741. TMatMapUScale = Single;
  742. PMatMapVScale = ^TMatMapVScale;
  743. TMatMapVScale = TMatMapUScale;
  744. PMatMapUOffset = ^TMatMapUOffset;
  745. TMatMapUOffset = Single;
  746. PMatMapVOffset = ^TMatMapVOffset;
  747. TMatMapVOffset = TMatMapUOffset;
  748. PMatMapAng = ^TMatMapAng;
  749. TMatMapAng = Single;
  750. PNamedObject = PChar3DS;
  751. PPointArray = ^TPointArray;
  752. TPointArray = record
  753. Vertices: Word;
  754. PointList: PPointList;
  755. end;
  756. PPointFlagArray = ^TPointFlagArray;
  757. TPointFlagArray = record
  758. Flags: Word;
  759. FlagList: PWordList;
  760. end;
  761. PFaceArray = ^TFaceArray;
  762. TFaceArray = record
  763. Faces: Word;
  764. FaceList: PFaceList;
  765. end;
  766. PMshMatGroup = ^TMshMatGroup;
  767. TMshMatGroup = record
  768. MatNameStr: AnsiString;
  769. Faces: Word;
  770. FaceList: PWordList;
  771. end;
  772. PMshBoxmap = ^TMshBoxmap;
  773. TMshBoxmap = array[0..5] of AnsiString;
  774. PSmoothGroup = ^TSmoothGroup;
  775. TSmoothGroup = record
  776. Groups: Word;
  777. GroupList: PCardinalArray;
  778. end;
  779. PTexVerts = ^TTexVerts;
  780. TTexVerts = record
  781. NumCoords: Word;
  782. TextVertList: PTexVertList;
  783. end;
  784. PMeshColor = ^TMeshColor;
  785. TMeshColor = Byte;
  786. PMeshTextureInfo = ^TMeshTextureInfo;
  787. TMeshTextureInfo = record
  788. MapType: Word;
  789. XTiling: Single;
  790. YTiling: Single;
  791. IconPos: TPoint3DS;
  792. IconScaling: Single;
  793. XMatrix: TMeshMatrix;
  794. IconWidth: Single;
  795. IconHeight: Single;
  796. CylIconHeight: Single;
  797. end;
  798. PProcName = PChar3DS;
  799. PNDirectLight = ^TNDirectLight;
  800. TNDirectLight = TPoint3DS;
  801. PDlExclude = PChar3DS;
  802. PDlSpotlight = ^TDlSpotlight;
  803. TDlSpotlight = record
  804. SpotLightTarg: TPoint3DS;
  805. HotspotAngle: Single;
  806. FalloffAngle: Single;
  807. end;
  808. PDlOuterRange = ^TDlOuterRange;
  809. TDlOuterRange = Single;
  810. PDlInnerRange = ^TDlInnerRange;
  811. TDlInnerRange = TDlOuterRange;
  812. PDlMultiplier = ^TDlMultiplier;
  813. TDlMultiplier = Single;
  814. PDlSpotRoll = ^TDlSpotRoll;
  815. TDlSpotRoll = Single;
  816. PDlSpotAspect = ^TDlSpotAspect;
  817. TDlSpotAspect = Single;
  818. PDlSpotProjector = PChar3DS;
  819. PDlRayBias = ^TDlRayBias;
  820. TDlRayBias = Single;
  821. PDlLocalShadow2 = ^TDlLocalShadow2;
  822. TDlLocalShadow2 = record
  823. LocalShadowBias: Single;
  824. LocalShadowFilter: Single;
  825. LocalShadowMapSize: SmallInt
  826. end;
  827. PNCamera = ^TNCamera;
  828. TNCamera = record
  829. CameraPos: TPoint3DS;
  830. TargetPos: TPoint3DS;
  831. CameraBank: Single;
  832. CameraFocalLength: Single;
  833. end;
  834. PCamRanges = ^TCamRanges;
  835. TCamRanges = record
  836. NearPlane: Single;
  837. FarPlane: Single;
  838. end;
  839. PViewportLayout = ^TViewportLayout;
  840. TViewportLayout = record
  841. Form: SmallInt; // 0 = single window
  842. // 1 = 2 split verticle
  843. // 2 = 2 split horizontal
  844. // 3 = 4 equal squares
  845. // 4 = 2 squares left & 1 rect right
  846. // 5 = 1 rect at Top & 2 sqr on bot
  847. // 6 = 1 rect left & 2 sqr right
  848. // 7 = 2 sqr Top & 1 rect bot
  849. // 8 = 3 split vertical
  850. // 9 = 2 split horiz
  851. // 10 = 3 sqr left and 1 rect right
  852. // 11 = 1 rect left & 3 sqr. right
  853. // Form becomes 0 during swap and its preswapped value is stored in the SwapPort field
  854. Top: SmallInt; // Active window index of 0 to 5
  855. Ready: SmallInt;
  856. WState: SmallInt; // 0 if no swap window, 1 if in swaped "w" state. During a swap, the old 0 window gets stored as the 4 window
  857. SwapWS: SmallInt;
  858. SwapPort: SmallInt; // The preswapped value from the Form field
  859. SwapCur: SmallInt; // The window index that was swapped
  860. end;
  861. PViewportSize = ^TViewportSize;
  862. TViewportSize = record // Values given for 1024x768 resolution
  863. XPos: Word; // 0
  864. YPos: Word; // 14
  865. Width: Word; // 895
  866. Height: Word; // 725
  867. end;
  868. PViewportData = ^TViewportData;
  869. TViewportData = record
  870. Flags: Word;
  871. AxisLockout: Word;
  872. WinXPos: Word;
  873. WinYPos: Word;
  874. WinWidth: Word;
  875. WinHeight: Word;
  876. View: Word; // 0 = No View
  877. // 1 = Top View
  878. // 2 = Bottom View
  879. // 3 = Left View
  880. // 4 = Right View
  881. // 5 = Front View
  882. // 6 = Back View
  883. // 7 = User View
  884. // 18 = Spotlight View
  885. // 65535 = Camera View
  886. ZoomFactor: Single;
  887. Center: TPoint3DS;
  888. HorizAng: Single;
  889. VertAng: Single;
  890. CamNameStr: AnsiString;
  891. end;
  892. PViewportData3 = ^TViewportData3;
  893. TViewportData3 = TViewportData;
  894. PKFHdr = ^TKFHdr;
  895. TKFHdr = record
  896. Revision: SmallInt;
  897. Filename: String;
  898. AnimLength: Integer;
  899. end;
  900. PKFId = ^TKFId;
  901. TKFId = SmallInt;
  902. PKFSeg = ^TKFSeg;
  903. TKFSeg = record
  904. First: Integer;
  905. Last: Integer;
  906. end;
  907. PKFCurtime = ^TKFCurtime;
  908. TKFCurtime = Integer;
  909. PNodeHdr = ^TNodeHdr;
  910. TNodeHdr = record
  911. ObjNameStr: String;
  912. Flags1: Word;
  913. Flags2: Word;
  914. ParentIndex: SmallInt;
  915. end;
  916. PPivot = ^TPivot;
  917. TPivot = TPoint3DS;
  918. PInstanceName = PChar3DS;
  919. PMorphSmooth = ^TMorphSmooth;
  920. TMorphSmooth = Single;
  921. PBoundBox = ^TBoundBox;
  922. TBoundBox = record
  923. Min: TPoint3DS;
  924. Max: TPoint3DS;
  925. end;
  926. PPosTrackTag = ^TPosTrackTag;
  927. TPosTrackTag = record
  928. TrackHdr: TTrackHeader3DS;
  929. KeyHdrList: PKeyHeaderList;
  930. PositionList: PPointList;
  931. end;
  932. PColTrackTag = ^TColTrackTag;
  933. TColTrackTag = record
  934. TrackHdr: TTrackHeader3DS;
  935. KeyHdrList: PKeyHeaderList;
  936. ColorList: PFColorList;
  937. end;
  938. PRotTrackTag = ^TRotTrackTag;
  939. TRotTrackTag = record
  940. TrackHdr: TTrackHeader3DS;
  941. KeyHdrList: PKeyHeaderList;
  942. RotationList: PKFRotKeyList;
  943. end;
  944. PScaleTrackTag = ^TScaleTrackTag;
  945. TScaleTrackTag = record
  946. TrackHdr: TTrackHeader3DS;
  947. KeyHdrList: PKeyHeaderList;
  948. ScaleList: PPointList;
  949. end;
  950. PMorphTrackTag = ^TMorphTrackTag;
  951. TMorphTrackTag = record
  952. TrackHdr: TTrackHeader3DS;
  953. KeyHdrList: PKeyHeaderList;
  954. MorphList: PKFMorphKeyList;
  955. end;
  956. PHideTrackTag = ^THideTrackTag;
  957. THideTrackTag = record
  958. TrackHdr: TTrackHeader3DS;
  959. KeyHdrList: PKeyHeaderList;
  960. end;
  961. PFovTrackTag = ^TFovTrackTag;
  962. TFovTrackTag = record
  963. TrackHdr: TTrackHeader3DS;
  964. KeyHdrList: PKeyHeaderList;
  965. FOVAngleList: PSingleList;
  966. end;
  967. PRollTrackTag = ^TRollTrackTag;
  968. TRollTrackTag = record
  969. TrackHdr: TTrackHeader3DS;
  970. KeyHdrList: PKeyHeaderList;
  971. RollAngleList: PSingleList;
  972. end;
  973. PHotTrackTag = ^THotTrackTag;
  974. THotTrackTag = record
  975. TrackHdr: TTrackHeader3DS;
  976. KeyHdrList: PKeyHeaderList;
  977. HotspotAngleList: PSingleList;
  978. end;
  979. PFallTrackTag = ^TFallTrackTag;
  980. TFallTrackTag = record
  981. TrackHdr: TTrackHeader3DS;
  982. KeyHdrList: PKeyHeaderList;
  983. FalloffAngleList: PSingleList;
  984. end;
  985. PXDataEntry = ^TXDataEntry;
  986. TXDataEntry = record
  987. Size: Integer;
  988. Data: Pointer;
  989. end;
  990. PXDataAppName = PChar3DS;
  991. PXDataString = PChar3DS;
  992. PXDataFloat = ^TXDataFloat;
  993. TXDataFloat = Single;
  994. PXDataDouble = ^TXDataDouble;
  995. TXDataDouble = Double;
  996. PXDataShort = ^TXDataShort;
  997. TXDataShort = SmallInt;
  998. PXDataLong = ^TXDataLong;
  999. TXDataLong = Integer;
  1000. PXDataVoid = ^TXDataVoid;
  1001. TXDataVoid = Pointer;
  1002. TReleaseLevel = (rlRelease1,
  1003. rlRelease2,
  1004. rlRelease3,
  1005. rlReleaseNotKnown);
  1006. // to avoid zillion type casts, we use this variant record for
  1007. // chunk data, effectively this defines the same pointer differently
  1008. // for different chunk types
  1009. // this is only possible because all types are just pointers
  1010. TChunkData = record
  1011. case Integer of
  1012. 0 : (ColorF: PColorF);
  1013. 1 : (LinColorF: PLinColorF);
  1014. 2 : (Color24: PColor24);
  1015. 3 : (LinColor24: PLinColor24);
  1016. 4 : (IntPercentage: PIntPercentage);
  1017. 5 : (FloatPercentage: PFloatPercentage);
  1018. 6 : (MatMapname: PMatMapname);
  1019. 7 : (M3dVersion: PM3dVersion);
  1020. 8 : (MeshVersion: PMeshVersion);
  1021. 9 : (MasterScale: PMasterScale);
  1022. 10 : (LoShadowBias: PLoShadowBias);
  1023. 11 : (ShadowFilter: PShadowFilter);
  1024. 12 : (ShadowRange: PShadowRange);
  1025. 13 : (HiShadowBias: PHiShadowBias);
  1026. 14 : (RayBias: PRayBias);
  1027. 15 : (ShadowMapSize: PShadowMapSize);
  1028. 16 : (ShadowSamples: PShadowSamples);
  1029. 17 : (OConsts: POConsts);
  1030. 18 : (BitMapName: PBitMapName);
  1031. 19 : (VGradient: PVGradient);
  1032. 20 : (Fog: PFog);
  1033. 21 : (LayerFog: PLayerFog);
  1034. 22 : (DistanceCue: PDistanceCue);
  1035. 23 : (ViewStandard: PViewStandard);
  1036. 24 : (ViewUser: PViewUser);
  1037. 25 : (ViewCamera: PViewCamera);
  1038. 26 : (MatName: PMatName);
  1039. 27 : (MatShading: PMatShading);
  1040. 28 : (MatAcubic: PMatAcubic);
  1041. 29 : (IpasData: PIpasData);
  1042. 30 : (MatWireSize: PMatWireSize);
  1043. 31 : (MatMapTiling: PMatMapTiling);
  1044. 32 : (MatMapTexblur: PMatMapTexblur);
  1045. 33 : (MatMapUScale: PMatMapUScale);
  1046. 34 : (MatMapVScale: PMatMapVScale);
  1047. 35 : (MatMapUOffset: PMatMapUOffset);
  1048. 36 : (MatMapVOffset: PMatMapVOffset);
  1049. 37 : (MatMapAng: PMatMapAng);
  1050. 38 : (MatMapCol1: PMatMapCol1);
  1051. 39 : (MatMapCol2: PMatMapCol2);
  1052. 40 : (MatMapRCol: PMatMapRCol);
  1053. 41 : (MatMapGCol: PMatMapGCol);
  1054. 42 : (MatMapBCol: PMatMapBCol);
  1055. 43 : (MatBumpPercent: PMatBumpPercent);
  1056. 44 : (NamedObject: PNamedObject);
  1057. 45 : (PointArray: PPointArray);
  1058. 46 : (PointFlagArray: PPointFlagArray);
  1059. 47 : (FaceArray: PFaceArray);
  1060. 48 : (MshMatGroup: PMshMatGroup);
  1061. 49 : (MshBoxmap: PMshBoxmap);
  1062. 50 : (SmoothGroup: PSmoothGroup);
  1063. 51 : (TexVerts: PTexVerts);
  1064. 52 : (MeshMatrix: PMeshMatrix);
  1065. 53 : (MeshColor: PMeshColor);
  1066. 54 : (MeshTextureInfo: PMeshTextureInfo);
  1067. 55 : (ProcName: PProcName);
  1068. 56 : (NDirectLight: PNDirectLight);
  1069. 57 : (DlExclude: PDlExclude);
  1070. 58 : (DlInnerRange: PDlInnerRange);
  1071. 59 : (DlOuterRange: PDlOuterRange);
  1072. 60 : (DlMultiplier: PDlMultiplier);
  1073. 61 : (DlSpotlight: PDlSpotlight);
  1074. 62 : (DlLocalShadow2: PDlLocalShadow2);
  1075. 63 : (DlSpotRoll: PDlSpotRoll);
  1076. 64 : (DlSpotAspect: PDlSpotAspect);
  1077. 65 : (DlSpotProjector: PDlSpotProjector);
  1078. 66 : (DlRayBias: PDlRayBias);
  1079. 67 : (NCamera: PNCamera);
  1080. 68 : (CamRanges: PCamRanges);
  1081. 69 : (ViewportLayout: PViewportLayout);
  1082. 70 : (ViewportSize: PViewportSize);
  1083. 71 : (ViewportData: PViewportData);
  1084. 72 : (XDataEntry: PXDataEntry);
  1085. 73 : (XDataAppName: PXDataAppName);
  1086. 74 : (XDataString: PXDataString);
  1087. 75 : (KFHdr: PKFHdr);
  1088. 76 : (KFSeg: PKFSeg);
  1089. 77 : (KFCurtime: PKFCurtime);
  1090. 78 : (KFId: PKFId);
  1091. 79 : (NodeHdr: PNodeHdr);
  1092. 80 : (Pivot: PPivot);
  1093. 81 : (InstanceName: PInstanceName);
  1094. 82 : (MorphSmooth: PMorphSmooth);
  1095. 83 : (BoundBox: PBoundBox);
  1096. 84 : (PosTrackTag: PPosTrackTag);
  1097. 85 : (ColTrackTag: PColTrackTag);
  1098. 86 : (RotTrackTag: PRotTrackTag);
  1099. 87 : (ScaleTrackTag: PScaleTrackTag);
  1100. 88 : (MorphTrackTag: PMorphTrackTag);
  1101. 89 : (FovTrackTag: PFovTrackTag);
  1102. 90 : (RollTrackTag: PRollTrackTag);
  1103. 91 : (HotTrackTag: PHotTrackTag);
  1104. 92 : (FallTrackTag: PFallTrackTag);
  1105. 93 : (HideTrackTag: PHideTrackTag);
  1106. 99 : (Dummy: Pointer);
  1107. end;
  1108. // finally the chunk definition
  1109. TChunk3DS = record
  1110. Tag: Word; // Type of Chunk
  1111. Size: Cardinal; // Number of bytes used by Chunk
  1112. Position: Cardinal; // Offset in Source file
  1113. Data: TChunkData; // Memory copy of file Data
  1114. Sibling: PChunk3DS; // Next Chunk in database
  1115. Children: PChunk3DS; // Chunks contained within this Chunk
  1116. end;
  1117. //---------------------------------------------------------------------------------------------------------------------
  1118. implementation
  1119. //---------------------------------------------------------------------------------------------------------------------
  1120. end.