Formatx.m3DSTypes.pas 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314
  1. //
  2. // The graphics engine GXScene
  3. //
  4. unit Formatx.m3DSTypes;
  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..Defines.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.