File3DSTypes.pas 51 KB

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