home *** CD-ROM | disk | FTP | other *** search
- unit TsxApi;
-
- interface
-
- {
- Module Search Tag Description
- ----------------------------------------------------------------------------
- tsxPLUG tsxPlug.h Installation Interface
- tsxTYPES tsxTypes.h Basic data types used in most places
- tsxERR tsxErr.h TSX Error Codes
- tsxGEOM tsxGeom.h Basic geometric manipulation in 2D and 3D
- tsxSOBJ tsxSObj.h Definition of tsxSOBJ
- tsxMATRL tsxMatrl.h Definition of tsxMATERIAL
- tsxSCENE tsxScene.h Definition of tsxSCENE
- tsxGNODE tsxGNode.h Definition of tsxGNODE
- tsxCAMRA tsxCamra.h Interface to tsxCAMERA
- tsxLIGHT tsxLight.h Interface to tsxLIGHT
- tsxMNODE tsxMNode.h Definition of tsxMNODE
- tsxGROUP tsxGroup.h Definition of tsxGROUP
- tsxPOLYH tsxPolyh.h Definition of tsxPOLYHEDRA
- tsxSELECT tsxSelect.h The Selection Mechanism
- tsxANIM tsxAnim.h Animation
- tsxMISC tsxMisc.h Miscellaneous items
- tsxMOUSE tsxMouse.h Interface to the Mouse
- tsxAVIEW tsxAView.h Interface to the Active View
- }
-
- uses
- Windows;
-
- type
- Short = SmallInt;
- UnsignedShort = Word;
- UnsignedInt = DWord;
- Float = Single;
-
- // =============================================================================
- //
- // t s x P L U G
- //
- //
- // File: tsxplug.h
- // Module: trueSpace eXtensions Installation Interface
- //
-
- //---------------------------
- // tsxData
- //---------------------------
-
- // Every trueSpace eXtension must define a function (see below) that returns
- // information about the eXtension in the following `tsxData' structure.
-
- type
- TTsxData = packed Record
- mTitle: array[0..31] of Char; //Brief name of this eXtension.
- mAuthor: array[0..63] of Char; //Name of author|company.
- mResIDBtnBmp: SmallInt; //Resource id used for Button Bitmap
- mResIDBtnHelp: SmallInt; //Resource id used for Button Help Message
- end;
-
- // Each ts-eXtension will be associated with a button in the trueSpace
- // interface. This requires:
- // - a bitmap (m_ResidBtnBmp), 34x34 pixels, 256 colors.
- // - and a brief help message (m_ResidBtnHelp) that gets
- // displayed on the status bar when a cursor moves over the button.
-
- //---------------------------
- // TSX API Version Info
- //---------------------------
-
- // This is the version number for this copy of the API (SDK).
- // To check the version number of an installed trueSpace, see "tsxMisc.h".
-
- // Base alpha minor-version nbr
- const
- tsxVersion_Alpha_base = -200;
- tsxVersion_Beta_Base = -100;
- tsxVersion_Major = 300;
- tsxVersion_Minor = 0;
-
- //---------------------------
- // Access function Return Values
- //---------------------------
- tsxPLUG_DONE = 0;
- tsxPLUG_FAILED = -1;
- tsxPLUG_STAYON = 1;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x T Y P E S
- //
- //
- // File: tsxTypes.h
- // Module: trueSpace eXtensions API
- // Descr: Basic data types used in most places
-
- //---------------------------
- // Misc
- //---------------------------
- const
- e_tsxFalse = false;
- e_tsxTrue = true;
- type
- // Return type for functions that test a condition.
- tsxBOOL = Boolean; //( e_tsxFalse, e_tsxTrue );
- // Return type for functions that simply report success or failure.
- tsxRet = ( e_tsxFailure, e_tsxSuccess );
- // Return type for functions that return an error code when they fail.
- // These are documented in "tsxErr.h".
- tsxErr = Integer;
-
- //---------------------------
- // Geometry
- //---------------------------
-
- // Reference Frames: World or Model
- type
- tsxFRAMEID = ( e_tsxWorldFrame, e_tsxModelFrame );
-
- // Note:
- // trueSpace uses `float' to represent all coordinates and related values.
- // 3D types have suffix "3f" and 2D data-types have suffix "2f".
-
- // Specifying Vectors and Points
- TTsxVector2f = Record
- x, y: Float;
- end;
-
- TTsxVector3f = Record
- x, y, z: Float;
- end;
- PTsxVector3f = ^TTsxVector3f;
- TsxVector3fArray = array[0..1000] of TTsxVector3f;
- PTsxVector3fArray = ^TsxVector3fArray;
-
- // Specifying axes.
- TTsxAxes3f = Record
- xAxis: TTsxVector3f; //Unit vector specifying orientation of Model's X axis.
- yAxis: TTsxVector3f; // ... Y ...
- zAxis: TTsxVector3f; // ... Z ...
- end;
- PTsxAxes3f = ^TTsxAxes3f;
-
- // Transformation Matrix.
- // This is the traditional homogeneous matrix, with the columns and rows
- // reversed from what is customary in algebra notation for 3D operations.
- // Most 3D algebra is based on a 4 x 4 matrix, with the terms in the last
- // column always {0,0,0,1}. In our representation this would be the last
- // row, which is kept implicit and not stored.
- TTsxTxmx3f = Record
- matrix: array[0..2, 0..3] of Float;
- end;
- PTsxTxmx3f = ^TTsxTxmx3f;
-
- // Bounding Box.
- // This is a (smallest) world-axes aligned paralellopiped enclosing an object.
- // Since it is aligned with the world axes, the box is definable through its
- // minimum and maximum coordinates.
- TTsxBBox3f = Record
- minBounds: TTsxVector3f; // Minimum X,Y,Z coordinates.
- maxBounds: TTsxVector3f; // Maximum X,Y,Z coordinates.
- end;
- PTsxBBox3f = ^TTsxBBox3f;
-
- //---------------------------
- // Geometry Inlined Functions
- //---------------------------
-
- // Equality test on CtsxVector3f
- function EqualVector3f(const vec1, vec2: TTsxVector3f): Boolean;
- // Equality test on CtsxVector2f
- function EqualVector2f(const vec1, vec2: TTsxVector2f): Boolean;
-
- //---------------------------
- // Color, UV-Space
- //---------------------------
-
- // For specifying color, e.g. in a material or for a vertex.
- type
- TTsxColor = Record
- red, green, blue: Byte; // 0 - 255
- alpha: Byte; // 0 - 100
- end;
- PTsxColor = ^TTsxColor;
-
- // For specifying UV-space coordinates of a vertex.
- TTsxUV = Record
- u, v: Float;
- end;
- TTsxUVArray = array[0..1000] of TTsxUV;
- PTsxUVArray = ^TTsxUVArray;
-
- //---------------------------
- // Scene Graph
- //---------------------------
-
- // The Scene graph is arranged as follows:
- // There is a Float tsxSCENE object at the top.
- // In trueSpace, there is always and only one scene.
- // At the first level below (commonly referred to as the operational top
- // level) are instances of geometric objects (derived tsxGNODEs).
- // Geometric objects may be organized into tree-shaped hierarchies.
- // In such cases, only tsxGROUP or tsxLOD may occur as internal nodes
- // in the hierarchy. All other instances of GNODE types must occur at the
- // leaves of the hierarchy tree.
- // Each internal node, including the tsxSCENE node, points to
- // a list of its children.
- // Only GNODE types and tsxAXES may be selected
- // (i.e. made the "current object").
- // Geometric objects (GNODEs) may be positioned, rotated and scaled. These
- // transformations may be done in either the World frame or the object's
- // own Model frame (see tsxFRAMEID). The model frame is defined by the
- // position and orientation of the object's axes (see tsxGNode.h).
- // Only MNODE types allow their axes to be manipulated (tsxMNode.h).
- // At present not all trueSpace node types are supported in the TSX API.
-
- // Object types in a scene.
- type
- TTsxSOBJTYPE = Integer;
-
- const
- e_tsxUNDEFINED = 0; //Not a TSX-supported SOBJ type
- // SOBJ types
- e_tsxMATERIAL = 1;
- e_tsxSCENE = 2;
- // Selectable objects
- e_tsxSELECTABLE = 50; //(Not a legal SOBJ type)
- e_tsxAXES = 51;
- // GNODE types
- e_tsxGNODETYPES = 100; //(Not a legal SOBJ type)
- e_tsxCAMERA = 101;
- e_tsxLIGHT = 102;
- // MNODE types
- e_tsxMNODETYPES = 200; //(Not a legal SOBJ type)
- e_tsxPOLYHEDRON = 201;
- e_tsxGROUP = 202;
- e_tsxLODGROUP = 203; //Levels of Detail
- e_tsxMBALLOBJ = 204; //Object with meta-balls
-
- e_tsxSOBJEND = 205; //(Not a legal SOBJ type)
-
-
- // The following are all really abstract type definitions,
- // and their implementations are defined within TSXAPI.
- // Use the specific create function to create an object
- // of a particular type (e.g. tsxPolyhCreate for creating
- // a Polyhedron). Any object can be deleted with
- // tsxSobjDelete, though if some types have specific
- // delete functions, then they should be used.
- // Types that do not have a special function to create
- // an instance cannot be created through the TSXAPI.
- // The types labelled "Abstract type" below are abstractions
- // of other types defined here.
-
- type
- PTsxSOBJ = Pointer;
- // Derived from tsxSOBJ
- PTsxMaterial = Pointer;
- PTsxScene = Pointer;
- PTsxAxes = Pointer;
-
- PTsxGNode = Pointer;
- // Derived from tsxGNODE
- PTsxCamera = Pointer;
- PTsxLight = Pointer;
-
- PTsxMNode = Pointer;
- // Derived from tsxMNODE
- PTsxPOLYHEDRON = Pointer;
- PTsxGROUP = Pointer;
- PTsxLODGROUP = Pointer;
- PTsxMBALLOBJ = Pointer;
-
- //---------------------------
- // Types for Callback Functions
- //---------------------------
-
- // Function with no args and no return value.
- type
- TTsxBasicCallbackFP = procedure; cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x E R R
- //
- //
- // File: tsxErr.h
- // Module: trueSpace eXtensions API
- // Descr: TSX Error Codes
- //
-
- //-----------------------------
- // Error Codes returned by Functions with return type tsxERR
- //-----------------------------
- const
- tsxERR_SUCCESS = 0;
-
- // Defined Error Codes
-
- tsxERR_NOGOOD = -1; // something generally went wrong
- tsxERR_NO_MEMORY = -2; // no memory available
- tsxERR_NULL_REF = -3; // null pointer reference
- tsxERR_BAD_INPUT = -4; // bad input data
- tsxERR_FORMAT = -5; // general bad data format
- tsxERR_ABORT = -8; // user abort request
- tsxERR_REPORTED = -10; // still an error but was reported below
- tsxERR_UNIMPL = -11; // feature unimplemented
- tsxERR_IDENTIFIER = -12; // bad identifier on data or record
- tsxERR_VERSION = -13; // Correct file type but wrong version
- tsxERR_NOT_FOUND = -14; // object not found
- tsxERR_OVERFLOW = -15; // data overflow for size of result
- tsxERR_RANGE = -16; // value out of range
- tsxERR_INIT = -18; // subsystem improperly initialized
-
- // system errors
- tsxERR_SYSERR_BASE = -50;
- tsxERR_STDIO = (tsxERR_SYSERR_BASE - 0); // error occurred in io
- tsxERR_MSWIN = (tsxERR_SYSERR_BASE - 1); // error occurred in windows
-
- // If a function returns an error code not defined above, then treat it
- // as an undefined error.
- function tsxSucceeded(err: tsxErr): tsxBool;
- function tsxFailed(err: tsxErr): tsxBool;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x G E O M
- //
- //
- // File: tsxGeom.h
- // Module: trueSpace eXtensions API
- // Descr: Basic geometric manipulation in 2D and 3D.
- //
-
- //-----------------------------
- // General comments
- //-----------------------------
- {*
- ** `float' is used as the basic scalar data type.
- **
- ** 3D types have suffix "3f" and 2D data-types have suffix "2f".
- ** The functions have similar suffixes.
- **
- ** All normal and axis vectors used as arguments in functions are assumed to be
- ** unit vectors.
- **
- ** trueSpace uses a "Right-handed" spatial orientation.
- **
- ** All types are defined in "tsxTypes.h".
- *}
-
- //-----------------------------
- // Basics
- //-----------------------------
-
- const
- M_PI = 3.14159265359;
- // 180/pi
- tsxRAD2DEG_FAC = 57.29577951308;
- // pi/180
- tsxDEG2RAD_FAC = 0.01745329251994;
-
- // Radians -> Degrees
- function tsxRad2Deg(rad: Float): Float; cdecl;
- // Degrees -> Radians
- function tsxDeg2Rad(deg: Float): Float; cdecl;
-
- //-----------------------------
- // Vector Geometry
- //-----------------------------
-
- // |vect|
- function tsxMagnitude3f(const vec: TTsxVector3f): Float; cdecl;
- function tsxMagnitude2f(const vec: TTsxVector2f): Float; cdecl;
- // Normalizing ... returns the length of the original vector `vec'.
- function tsxNormalize3f(var vec: TTsxVector3f): Float; cdecl;
- function tsxNormalize2f(var vec: TTsxVector2f): Float; cdecl;
- // norm = vec/|vec|
- function tsxGetNormalized3f(var norm: TTsxVector3f; const vec: TTsxVector3f): Float; cdecl;
- function tsxGetNormalized2f(var norm: TTsxVector3f; const vec: TTsxVector3f): Float; cdecl;
- // Scalar-Vector arithmetic ... `vec' is modified and returned
- // vec = vec + s
- function tsxAddScalar3f(var vec: TTsxVector3f; s: Float): PTsxVector3f; cdecl;
- // vec = vec * s
- function tsxMulScalar3f(var vec: TTsxVector3f; s: Float): PTsxVector3f; cdecl;
-
- // Vector-Vector arithmetic ... Vector `u' is modified and returned
- // u = u + v
- function tsxAddVec3f(var u: TTsxVector3f; const v: TTsxVector3f): PTsxVector3f; cdecl;
- // u = u - v
- function tsxSubVec3f(var u: TTsxVector3f; const v: TTsxVector3f): PTsxVector3f; cdecl;
-
- // Vector Multiplication
- // u . v ... Dot Product
- function tsxDProdVec3f(const u, v: TTsxVector3f): Float; cdecl;
- // uxv = u x v ... Cross Product
- function tsxXProdVec3f(var uxv: TTsxVector3f; const u, v: TTsxVector3f): PTsxVector3f; cdecl;
-
- // Returns Signed angle from vector `u' to `v' about the axis `axis'.
- // `axis' gets the (unnormalized) cross-product (axis = u x v). Angle in radians.
- function tsxAngleBtwVecs3f(const u, v: TTsxVector3f; var axis: TTsxVector3f): Float; cdecl;
-
-
- //-----------------------------
- // Distances from a Point
- //-----------------------------
-
- // Note: TTsxVector is used to represent the cartesian coordinates of a point.
-
- // Distances are non-negative unless mentioned otherwise.
-
- // Distance between 2 points `p', `q'.
- function tsxDistanceToPoint3f(const p, q: TTsxVector3f): Float; cdecl;
- // Distance from a point `p' to a line containing point `line_point' and
- // with unit direction vector `line_unitvec'.
- function tsxDistanceToLine3f(const p, line_point, line_unitvec: TTsxVector3f): Float; cdecl;
- // Distance from a Point `p' to a Plane with normal `plane_norm' and
- // containing Point `plane_point'. This distance is positive only if
- // `plane_norm' points towards `p'.
- function tsxDistanceToPlane3f(const p, plane_norm, plane_point: TTsxVector3f): Float; cdecl;
-
- //-----------------------------
- // Transformation Matrices
- //-----------------------------
-
- // A = B x C ... Matrix Multiplication.
- // A may be the same as B or C.
- function tsxXProdMx3f(var A: TTsxTxmx3f; const B, C: TTsxTxmx3f): Pointer; cdecl;
- // Minv = Inverse(M) ... Matrix Inverse
- // Returns e_tsxFAILURE if result is not reliable.
- function tsxInvertMx3f(var Minv: TTsxTxmx3f; const M: TTsxTxmx3f): tsxRet; cdecl;
-
- // Makes Transformation Matrix from specified X and Z axes and Origin.
- // pTxmx points to matrix where result Transformation Matrix is stored.
- // If pInvTxmx is specified, the inverted Transform is stored there.
- // Returns reference to Txmx.
- function tsxMakeMxFromXZO3f(const xAxis, zAxis, origin: TTsxVector3f;
- var pTxmx: TTsxTxmx3f; pInvTxmx: PTsxTxmx3f): PTsxTxmx3f; cdecl;
-
- // Makes a transformation matrix for rotation by `angle' about a line
- // defined by the center point `cent' and the normalized axis vector `axis'.
- // Returns reference to Txmx.
- function tsxMakeRotMx3f(const cent, axis: TTsxVector3f;
- angle: Float; //radians
- var pTxmx: TTsxTxmx3f; pInvTxmx: PTsxTxmx3f): PTsxTxmx3f; cdecl;
- // This version builds a pure rotation matrix, leaving other cells untouched.
- // The rotation is about a (unit) vector `axis'.
- function tsxMakePureRotMx3f(const axis: TTsxVector3f;
- angle: Float; //radians
- var pTxmx: TTsxTxmx3f; pInvTxmx: PTsxTxmx3f): PTsxTxmx3f; cdecl;
-
- // Translation in the Txmx
- // Get the translation components (x, y, z) into `trvec'.
- function tsxGetMxTranslation3f(var trvec: TTsxVector3f;
- const Txmx: TTsxTxmx3f): PTsxVector3f; cdecl;
-
- // Set the translation components of a Txmx
- function tsxSetMxTranslation3f(var Txmx: TTsxTxmx3f;
- const trvec: TTsxVector3f): PTsxTxmx3f; cdecl;
- // Add translation vector `trvec' to Txmx
- function tsxAddMxTranslation3f(var Txmx: TTsxTxmx3f;
- const trvec: TTsxVector3f): PTsxTxmx3f; cdecl;
- // Subtract translation vector `trvec' from Txmx
- function tsxSubMxTranslation3f(var Txmx: TTsxTxmx3f;
- const trvec: TTsxVector3f): PTsxTxmx3f; cdecl;
-
- // Extract the pure rotation matrix (Rot) and scaling/shearing factors
- // from a Transformation Matrix (Txmx).
- // If specified, pScaleShear must be float[6], and is assigned as follows:
- // ( Sx, Sy, Sz, Sxy, Sxz, Syz )
- procedure tsxUnMatrix3f(const Txmx: TTsxTxmx3f; var Rot: TTsxTxmx3f;
- pScaleShear: Pointer); cdecl; // Pointer = ^Float
-
- //-----------------------------
- // Applying the Transformation Matrix
- //-----------------------------
-
- // Transform an array of vectors `pInVecs', placing result in `pOutVecs'.
- procedure tsxTransformVecs3f(numVecs: Integer;
- pOutVecs, pInVecs: PTsxVector3f;
- var Txmx: TTsxTxmx3f); cdecl;
-
- // Apply only the rotational part of the Txmx to an array of vectors.
- procedure tsxRotateVecs3f(numVecs: Integer;
- pOutVecs, pInVecs: PTsxVector3f;
- var Txmx: TTsxTxmx3f); cdecl;
-
- // OutAxes = Rotate InAxes using Txmx. Ignore non-rotational part of Txmx.
- // IF InAxes are orthogonal and unit, then OutAxes are also valid axes.
- procedure tsxRotateAxes3f(var pOutAxes, pInAxes: TTsxAxes3f;
- var Txmx: TTsxTxmx3f); cdecl;
-
- //-----------------------------
- // Bounding Box
- //-----------------------------
-
- // Initialize BBox to negative volume.
- procedure tsxBBoxInit(var pBBox: TTsxBBox3f); cdecl;
-
- // Returns e_tsxTRUE if BBox1 and BBox2 intersect.
- // If they do intersect, and pBBintx is non-zero,
- // then BBintx gets their intersection.
- function tsxBBoxIntersection(
- pBBintx: PTsxBBox3f; const pBBox1, pBBox2: TTsxBBox3f
- ): tsxBool; cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x S O B J
- //
- //
- // File: tsxSobj.h
- // Module: trueSpace eXtensions API
- // Descr: Definition of tsxSOBJ
- //
-
- // A tsxSOBJ is the most abstract type for objects associated with a
- // trueSpace Scene.
- // It contains the following information:
- // - Object Type
-
- //-----------------------------
- // Sobj Type
- //-----------------------------
-
- // Sobj Type
- function tsxSobjGetType(pSobj: PTsxSObj): TTsxSObjType; cdecl;
-
- //-----------------------------
- // Manage
- //-----------------------------
-
- // Delete and free memory, including internal allocations.
- // Also delete all children, if any.
- // Erases objects from all Views.
- procedure tsxSobjDelete(pSobj: PTsxSObj); cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x M A T R L
- //
- //
- // File: tsxMatrl.h
- // Module: trueSpace eXtensions API
- // Descr: Definition of tsxMATERIAL
- //
-
- // tsxMATERIAL is used to set the material for obects and faces.
- // Use the following structures and functions to access, update and create
- // materials. Functions for painting with materials are in "tsxPolyh.h".
-
- //-----------------------------
- // Related Types and Values
- //-----------------------------
- // Solid texture direction values (used in the grain fields).
- const
- tsxSOLID_DIR_X = 0;
- tsxSOLID_DIR_Y = 1;
- tsxSOLID_DIR_Z = 2;
-
- type
- // Simulates a granite like texture with upto 4 colors.
- TTsxGraniteProps = packed Record
- color1: TTsxColor; //The different stone colors.
- color2: TTsxColor;
- color3: TTsxColor;
- color4: TTsxColor;
- amount1: Float; //Relative amount of color1 [0.0 - 1.0] (0=none)
- amount2: Float; //Relative amount of color2 [0.0 - 1.0]
- amount3: Float; //Relative amount of color3 [0.0 - 1.0]
- amount4: Float; //Relative amount of color4 [0.0 - 1.0]
- sharpness: Float; //[0.0 (max blurring to one color) - 1.0 (no blur)]
- scale: TTsxVector3f; //Scaling along solid texture directions. Non-negative.
- // Larger values result in finer texture.
- seed: UnsignedShort; //Random seed for generating pattern [0 - 64k]
- end;
-
- // Simulates texture of swirling veins produced by turbulent forces
- // applied before marble solidifies.
- TTsxMarbleProps = packed Record
- stonecol: TTsxColor; //Base stone color
- veincol: TTsxColor; //Color of veins
- turbulence: Short; //Higher numbers result in larger, bumpier veins.
- // 0 produces straight veins. Typically [0 - 20].
- //
- pad1: Word; // SJM - Undocumented (alignment bytes)
- //
- sharpness: Float; //Blending between vein and stone colors at vein edges.
- // Higher values increase sharpness. [0.0 - 1.0]
- grain: Short; //Vein direction (tsxSOLID_DIR_*).
- //
- pad2: Word; // SJM - Undocumented (alignment bytes)
- //
- scale: TTsxVector3f; //Scaling along solid texture directions. Non-negative.
- // Larger values result in more veins.
- seed: UnsignedShort; //Random seed for generating pattern [0 - 64k]
- end;
-
- // This produces concentric light (Spring) and dark (Summer) colored rings,
- // around an axis.
- TTsxWoodProps = packed Record
- lightcol: TTsxColor; //The light or spring color
- darkcol: TTsxColor; //The dark or summer color
- ldratio: Float; //Light/Dark ratio.
- // [0.0 (almost all dark) - 1.0 (almost all light)]
- rdensity: Float; //Number of rings per unit distance.
- rwidthvar: Float; //Variation in ring width [0.0 (uniform) - 1.0]
- rshapevar: Float; //Variation in ring shape [0.0 (perfect circle) - 1.0]
- center: TTsxVector3f; //Location of rings center.
- grain: Short; //Ring axis direction (tsxSOLID_DIR_*).
- //
- pad: Word; // SJM - Undocumented (alignment bytes)
- //
- scale: TTsxVector3f; //Scaling along solid texture directions. Non-negative.
- seed: UnsignedShort; //Random seed for generating pattern [0 - 64k]
- end;
-
- const
- // Values for CtsxProcTexture::txtrtype
- tsxTEXTURE_NONE = 0;
- tsxTEXTURE_GRANITE = 1;
- tsxTEXTURE_MARBLE = 2;
- tsxTEXTURE_WOOD = 3;
- // returned by `tsxMaterialGetTextureType' if texture is not procedural.
- // Not a valid value for field txtrtype.
- tsxTEXTURE_IMAGE = 4;
-
- type
- // Structure for specifying one of the procedural textures in tsxMATERIAL
- TTsxProcTexture = packed Record
- txtrtype: Short; //one of tsxTEXTURE_*
- //
- pad: Word; // SJM - Undocumented (alignment bytes)
- //
- case Integer of
- 0: ( wprops: TTsxWoodProps; );
- 1: ( gprops: TTsxGraniteProps; );
- 2: ( mprops: TTsxMarbleProps; );
- end;
- PTsxProcTexture = ^TTsxProcTexture;
-
- const
- // Reflection shading types (mutually exclusive)
- tsxSHADER_FLAT = $01;
- tsxSHADER_PHONG = $02;
- tsxSHADER_METAL = $04;
- // Surface smoothness (mutually exclusive)
- tsxFACET_FACETED = $01;
- tsxFACET_AUTO = $02;
- tsxFACET_SMOOTH = $04;
-
- type
- // Surface properties ......................................
- TTsxSurfaceProps = packed Record
- ka: Float; //ambient coefficent [0.0 -(0.01)- 1.0]
- ks: Float; //specular coefficent [0.0 -(0.01)- 1.0]
- exp: Float; //exponent of specularity (roughness) [0.0 -(0.01)- 1.0]
- end;
- PTsxSurfaceProps = ^TTsxSurfaceProps;
-
- const
- // Texture Map properties ..................................
- tsxTXTR_OVERLAY = $0001;
- tsxTXTR_ON = $0002; //otherwise OFF
- tsxTXTR_MOVIE = $0004;
- tsxTXTR_MARBLE = $0400;
- tsxTXTR_WOOD = $0800;
- tsxTXTR_GRANITE = $1000;
- // Only one of MARBLE, WOOD or GRANITE may be set.
-
- type
- TTsxTextureProps = packed Record
- offsetu: Float; //texture U offset [-1.0 -(.001)- 1.0]
- offsetv: Float; //texture V offset [-1.0 -(.001)- 1.0]
- repeatsu: Float; //texture repeats in U [0.01 -(.1)- 100.0]
- repeatsv: Float; //texture repeats in V [0.01 -(.1)- 100.0]
- flags: UnsignedShort; //see above
- end;
- PTsxTextureProps = ^TTsxTextureProps;
-
- const
- // Bump Map properties .....................................
- tsxBUMP_ON = $0002; //otherwise OFF
- tsxBUMP_MOVIE = $0004;
-
- type
- TTsxBumpProps = packed Record
- offsetu: Float; //bump U offset [-1.0 -(.001)- 1.0]
- offsetv: Float; //bump V offset [-1.0 -(.001)- 1.0]
- repeatsu: Float; //bump repeats in U [0.01 -(.1)- 100.0]
- repeatsv: Float; //bump repeats in V [0.01 -(.1)- 100.0]
- amplitude: Float; //bump amplitude [-10.0 - 10.0]
- flags: UnsignedShort; //see above
- end;
- PTsxBumpProps = ^TTsxBumpProps;
-
- const
- // Environment Map properties ..............................
- tsxENVR_CUBIC = $0001; //cubic environment, otherwise its spherical
- tsxENVR_ON = $0002; //otherwise OFF
- tsxENVR_MOVIE = $0004;
-
- tsxUVPROJ_PLANE = $01;
- tsxUVPROJ_PLANE_SQUARE = $02;
- tsxUVPROJ_CYLINDER = $04;
- tsxUVPROJ_SPHERE = $08;
-
- //-----------------------------
- // Managers
- //-----------------------------
-
- // Create a new material object with default properties:
- // - reflection shading = tsxSHADER_FLAT
- // - Surface smoothness = tsxFACET_FACETED
- // - alpha-chanel = 1
- // - index of refraction = 1
- // - Texture U repeats = 1
- // - Texture V repeats = 1
- // - Bump U repeats = 1
- // - Bump V repeats = 1
- // - Bump amplitude = 1
- // - Zero (0) in the rest of the fields
- // Ptr to new object assigned to ppMatrl on success.
- function tsxMaterialCreate(var ppMatrl: PTsxMaterial): tsxErr; cdecl;
-
- // Create a new material object, with same properties as pOldMatrl.
- // Ptr to new object assigned to ppNewMatrl on success.
- function tsxMaterialCreateCopy(
- var ppNewMatrl: PTsxMaterial;
- pOldMatrl: PTsxMaterial
- ): tsxErr; cdecl;
-
- // Create a new material object, with same properties as the Active Material.
- // Ptr to new object assigned to ppMatrl on success.
- function tsxMaterialCreateCopyActive(var ppMatrl: PTsxMaterial): tsxErr; cdecl;
-
- // Destroy a material object. If assigned to faces, corresponding material
- // entries in matlist set to null.
- procedure tsxMaterialDestroy(pMatrl: PTsxMaterial); cdecl;
-
- //-----------------------------
- // Active Material
- //-----------------------------
-
- // There is an active material which in trueSpace is the material last painted,
- // and the default material for the next painting action.
-
- // Set the active material to pNewActive (may be NULL).
- procedure tsxMaterialSetActive(pNewActive: PTsxMaterial); cdecl;
-
- // Returns ptr to the Active Material (may be NULL)
- function tsxMaterialGetActive: PTsxMaterial; cdecl;
-
- // Copy Active Material's (if any) attributes into pMatrl.
- procedure tsxMaterialCopyActive(pNewActive: PTsxMaterial); cdecl;
-
-
- //-----------------------------
- // Attribute Access
- //-----------------------------
-
- // Testing two materials for equivalence.
- function tsxMaterialsAreEqual( pMatrl1, pMatrl2: PTsxMaterial): tsxBool; cdecl;
-
- // Get its ID (0-64K, -1 if not material)
- function tsxMaterialGetId(pMatrl: PTsxMaterial): Integer; cdecl;
-
-
- // Surface attributes ..........................................................
-
- // Reflection shading (tsxSHADER_*, 0 on error)
- function tsxMaterialGetShadingType(pMatrl: PTsxMaterial): Integer; cdecl;
-
- // Surface faceting (tsxFACET_*, 0 on error)
- function tsxMaterialGetFacetingType(pMatrl: PTsxMaterial): Integer; cdecl;
-
- // The angle in degrees (0 - 120)
- function tsxMaterialGetAutofacetAngle(pMatrl: PTsxMaterial): Integer; cdecl;
-
- // Color
- procedure tsxMaterialGetColor(pMatrl: PTsxMaterial; var pColor: TTsxColor); cdecl;
-
- // Surface properties
- procedure tsxMaterialGetSurfaceProps(pMatrl: PTsxMaterial;
- var pSprops: TTsxSurfaceProps); cdecl;
-
- // index of refraction (1.0 - 2.0, 0 on error)
- function tsxMaterialGetIor(pMatrl: PTsxMaterial): Float; cdecl;
-
-
- // Texture Map .................................................................
-
- // Returns tsxTEXTURE_*
- function tsxMaterialGetTextureType(pMatrl: PTsxMaterial): Integer; cdecl;
-
- // If not procedural texture, pPrTxt->txtrtype = tsxTEXTURE_NONE.
- procedure tsxMaterialGetProcTexture(pMatrl: PTsxMaterial;
- var pPrTxt: TTsxProcTexture); cdecl;
-
- // File used as texture map image.
- procedure tsxMaterialGetTextureFilename(
- pMatrl: PTsxMaterial;
- szFilename: PChar; // File name copied here, if any
- iFilenameSize: Integer // size of szFilename buffer
- ); cdecl;
-
- // Texture mapping parameters
- procedure tsxMaterialGetTextureProps(
- pMatrl: PTsxMaterial;
- var pTxtrProps: TTsxTextureProps
- ); cdecl;
-
-
- // Bump Map ....................................................................
-
- // File used as bump map image.
- procedure tsxMaterialGetBumpFilename(
- pMatrl: PTsxMaterial;
- szFilename: PChar; // File name copied here, if any
- iFilenameSize: Integer // size of szFilename buffer
- ); cdecl;
-
- // Bump mapping parameters
- procedure tsxMaterialGetBumpProps(
- pMatrl: PTsxMaterial;
- var pBumpProps: TTsxBumpProps
- ); cdecl;
-
-
- // Environment Map .............................................................
-
- // Returns tsxENVR_* (0 on error)
- function tsxMaterialGetEnvrFlags(pMatrl: PTsxMaterial): Integer; cdecl;
-
-
- //-----------------------------
- // Attribute Update
- //-----------------------------
-
- // Surface attributes ..........................................................
-
- // Reflection shading (tsxSHADER_*)
- procedure tsxMaterialSetShadingType(pMatrl: PTsxMaterial; shading: Integer); cdecl;
-
- // Surface faceting (tsxFACET_*)
- procedure tsxMaterialSetFacetingType(pMatrl: PTsxMaterial; faceting: Integer); cdecl;
-
- // The angle in degrees (0 - 120)
- procedure tsxMaterialSetAutofacetAngle(pMatrl: PTsxMaterial; angleDegrees: Integer); cdecl;
-
- // Color
- procedure tsxMaterialSetColor(pMatrl: PTsxMaterial; const Color: TTsxColor); cdecl;
-
- // Surface properties
- procedure tsxMaterialSetSurfaceProps(
- pMatrl: PTsxMaterial;
- const pSprops: TTsxSurfaceProps); cdecl;
-
- // index of refraction (1.0 - 2.0)
- procedure tsxMaterialSetIor(pMatrl: PTsxMaterial; ior: Float); cdecl;
-
-
- // Texture Map .................................................................
-
- // Returns tsxTEXTURE_*
- procedure tsxMaterialSetTextureType(pMatrl: PTsxMaterial; txtype: Integer); cdecl;
-
- // If not procedural texture, pPrTxt->txtrtype = tsxTEXTURE_NONE.
- procedure tsxMaterialSetProcTexture(
- pMatrl: PTsxMaterial;
- const pPrTxt: TTsxProcTexture); cdecl;
-
- // File used as texture map image.
- procedure tsxMaterialSetTextureFilename(
- pMatrl: PTsxMaterial;
- szFilename: PChar // File name ptr (may be NULL)
- ); cdecl;
-
- // Texture mapping parameters
- procedure tsxMaterialSetTextureProps(
- pMatrl: PTsxMaterial;
- const pTxtrProps: TTsxTextureProps
- ); cdecl;
-
-
- // Bump Map ....................................................................
-
- // File used as bump map image.
- procedure tsxMaterialSetBumpFilename(
- pMatrl: PTsxMaterial;
- szFilename: PChar // File name ptr (may be 0)
- ); cdecl;
-
- // Bump mapping parameters
- procedure tsxMaterialSetBumpProps(
- pMatrl: PTsxMaterial;
- const pBumpProps: TTsxBumpProps
- ); cdecl;
-
-
- // Environment Map .............................................................
-
- // Environment flags tsxENVR_*
- procedure tsxMaterialSetEnvrFlags(pMatrl: PTsxMaterial; flags: Integer); cdecl;
-
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x S C E N E
- //
- //
- // File: tsxScene.h
- // Module: trueSpace eXtensions API
- // Descr: Definition of tsxSCENE
- //
-
- // There is always one and only one scene in trueSpace.
- // tsxSCENE adds the following information to tsxSOBJ:
- // - Fog parms
-
- //-----------------------------
- // Scene, Graph access
- //-----------------------------
-
- // Get the trueSpace scene.
- function tsxGetScene: PTsxScene; cdecl;
-
- // Adds pGNode as top-level member of scene, and makes it the current selection.
- // IF bNoDraw is TRUE THEN the object will not be drawn in this function call.
- // pGNode must be a new object not already in Scene.
- procedure tsxSceneAddObject(pGNode: PTsxGNode; bNoDraw: tsxBool); cdecl;
-
- // Get the first top level GNode.
- // The rest can be accessed using `tsxGNodeGetNext'.
- function tsxSceneGetFirstNode: PTsxGNode; cdecl;
-
- //-----------------------------
- // Fog
- //-----------------------------
-
- // Returns tsxTRUE for Fog On.
- function tsxSceneIsFogOn: Boolean; cdecl;
-
- // Use tsxTRUE to set Fog On.
- procedure tsxSceneSwitchFog(fog_on: tsxBOOL); cdecl;
-
- //
- procedure tsxSceneGetFogParms(
- var pFogRed: UnsignedInt; //0 - 255
- var pFogBlue: UnsignedInt; //0 - 255
- var pFogGreen: UnsignedInt; //0 - 255
- var pFogNear: Integer;
- var pFogFar: Integer;
- var pFogMax: Integer
- ); cdecl;
-
- //
- procedure tsxSceneSetFogParms(
- FogRed: UnsignedInt; //0 - 255
- FogBlue: UnsignedInt; //0 - 255
- FogGreen: UnsignedInt; //0 - 255
- FogNear: Integer;
- FogFar: Integer;
- FogMax: Integer
- ); cdecl;
-
-
- //-----------------------------
- // Rendering
- //-----------------------------
-
- // (Re)Draw the scene in the active View, in the View's rendering mode.
- procedure tsxSceneDraw; cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x G N O D E
- //
- //
- // File: tsxGNode.h
- // Module: trueSpace eXtensions API
- // Descr: Definition of tsxGNODE
- //
-
- // A tsxGNODE is the abstract type for Nodes in a Scene Graph.
- // All tsxGNODEs have position and orientation, as defined by their Axes,
- // and can be visible while editing.
- // A tsxGNODE adds the following attributes to tsxSOBJ:
- // - Name
- // - parent
- // - children
- // - siblings
- // - Axes position and orientation
-
- // NOTE on Transformations ...
- // Transformations are applied to a GNode by specifying the amount of change
- // from the current configuration. For example, `tsxGNodeTranslate' takes a
- // translation vector as argument to specify the direction and distance of
- // translation. This relative transformation can be given in either the World
- // frame (e.g. the translation vector is relative to the World axes) or in
- // the Model frame. The Model frame for a GNode is specified by the position
- // and orientation of its Axes. The function `tsxGNodeGetPosition' can be used
- // to get the position of the GNode's Model-frame origin, and the function
- // `tsxGNodeGetAxes' can be used to get their orientation. These two pieces
- // of information can be accessed together as a combined pure rotation matrix
- // through the function `tsxGNodeGetPureTransform'.
- //
- // Only MNODE object types allow their Model-frame to be modified (tsxMNode.h).
-
-
- //-----------------------------
- // GNode type check
- //-----------------------------
-
- // e_tsxTRUE if pSobj is a GNode
- function tsxIsGNode(pSobj: PTsxSObj): Boolean; cdecl;
-
-
- //-----------------------------
- // Management
- //-----------------------------
-
- // Get a copy of the entire tree rooted at a GNode
- function tsxGNodeCopy(
- pGNode: PTsxGNODE; // The GNode to copy
- var ppGNodeCopy: PTsxGNODE // Ptr to Copy placed here, on success
- ): tsxErr; cdecl;
-
- //-----------------------------
- // Traverse Scene Graph
- //-----------------------------
-
- // Returns: 0 if pGNode is the Scene object;
- // pGNode if parent of pGNode is the Scene object,
- // or pGNode has no parent;
- // else ptr to highest tsxGNODE ancestor of pGNode below Scene.
- function tsxGNodeGetRoot(pGNode: PTsxGNode): PTsxGNode; cdecl;
-
- // Get the parent node in the scene graph.
- function tsxGNodeGetParent(pGNode: PTsxGNode): PTsxGNode; cdecl;
-
- // Returns e_tsxTRUE if pGNode is a member of the Scene at some level.
- function tsxIsGNodeInScene(pGNode: PTsxGNode): tsxBool; cdecl;
-
- // Get the first child of a Group or LOD object.
- function tsxGNodeGetFirstChild(pGNode: PTsxGNode): PTsxGNode; cdecl;
-
- // Get the next node of valid tsx Type
- function tsxGNodeGetNext(pGNode: PTsxGNode): PTsxGNode; cdecl;
-
- // Get the prev node of valid tsx Type
- function tsxGNodeGetPrev(pGNode: PTsxGNode): PTsxGNode; cdecl;
-
- // Returns e_tsxTRUE if pCheckGNode is a node in the tree rooted at pGNode.
- function tsxIsGNodeSubobj(pGNode: PTsxGNode; pCheckGNode: PTsxGNode): tsxBool; cdecl;
-
-
- //-----------------------------
- // Drawing/Rendering
- //-----------------------------
-
- // Draws pGNode in the current view, in the current view's rendering mode.
- procedure tsxGNodeDraw(pGNode: PTsxGNode); cdecl;
-
-
- //-----------------------------
- // Name
- //-----------------------------
-
- // Gets the Name of a GNode.
- // Returns length of name. (0 if not valid request or null name)
- function tsxGNodeGetName(
- pGNode: PTsxGNODE;
- pName: PChar; //buffer where name is copied
- iNameSz: Integer //Size of pName buffer
- ): Integer; cdecl;
-
- // Sets the Name of a GNode.
- // Returns 0 on success.
- function tsxGNodeSetName(pGNode: PTsxGNODE; szNewName: PChar): tsxErr; cdecl;
-
-
- //-----------------------------
- // Model-frame Axes
- //-----------------------------
-
- // Get the GNode's position in World coordinates.
- // Returns 0 if not GNODE, else posn.
- function tsxGNodeGetAxesPosition(
- pGNode: PTsxGNode;
- var posn: TTsxVector3f
- ): PTsxVector3f; cdecl;
-
- // Get the GNode's model axes orientation, as a triple of normalized orthogonal
- // vectors pointing in the directions of GNode's X, Y and Z.
- // Returns 0 if not GNODE, else axes.
- function tsxGNodeGetAxesOrientation(
- pGNode: PTsxGNode;
- var axes: TTsxAxes3f
- ): PTsxAxes3f; cdecl;
-
- // Setting the axes orientation and position is only allowed for MNODEs.
-
- // Add the bounding box of GNode to input BBox.
- // Not valid for Track and Path objects.
- // The resulting BBox will also enclose the input BBox bounds. To get BBox
- // of only pGNode, use `tsxBBoxInit()' before calling this function.
- function tsxGNodeGetBBox(
- pGNode: PTsxGNode; //Non Track/Path GNode
- var pBBox: TTsxBBox3f //BBox updated with result.
- ): tsxErr; cdecl;
-
- //-----------------------------
- // Transformation
- //-----------------------------
-
- // Returns Transformation matrix representation of the GNode's axes,
- // with only Rotation and Translation elements,
- // and no Scaling/Shearing factors.
- // 0 if not GNode
- function tsxGNodeGetPureTransform(
- pGNode: PTsxGNode;
- var pTsxms: TTsxTxmx3f
- ): PTsxTxmx3f; cdecl;
-
- // Translate GNode by pVec, in the specified reference frame.
- procedure tsxGNodeTranslate(
- pGNode: pTsxGNode;
- const pVec: TTsxVector3f; // translation vector
- frameid: tsxFRAMEID // Reference frame for pVec
- ); cdecl;
-
- // Rotate by fAngle radians about pAxis passing thru pCenter,
- // in the specified reference frame.
- procedure tsxGNodeRotate(
- pGNode: pTsxGNode;
- const pCenter: TTsxVector3f; //Center of rotation.
- const pAxis: TTsxVector3f; //Rotation axis passing thru pCenter.
- fAngle: Float; //Radians. Rotation angle.
- frameid: tsxFRAMEID // Reference frame for pVec
- ); cdecl;
-
- // Scale by factors along each axis, in the specified reference frame.
- // Scale factors must be non-zero.
- procedure tsxGNodeScale(
- pGNode: PTsxGNode;
- const pScaleFacs: TTsxVector3f; //x, y, z scale factors (non-zero)
- frameid: tsxFrameID); cdecl;
-
- // Scale by factor UNIFORMLY along each axis, in the specified reference frame.
- // Scale factor must be non-zero.
- procedure tsxGNodeScaleUniform(
- pGNode: PTsxGNode;
- fScaleFac: Float;
- frameid: tsxFrameID); cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x C A M R A
- //
- //
- // File: tsxCamra.h
- // Module: trueSpace eXtensions API
- // Descr: Interface to tsxCAMERA
- //
-
- // A Camera is a GNode, with some special properties as mentioned below.
- // See also "tsxAView.h"
-
- //-----------------------------
- // Managers
- //-----------------------------
-
- // Creates a camera at world origin, with the viewing plane on the world
- // YZ plane, Z in the up direction, and pointing in the positive world X
- // direction. On success, the new camera is the currently selected object.
- function tsxCameraCreateInScene: tsxErr; cdecl;
-
- // Use `tsxSobjDelete' to remove and delete from scene, and GNODE functions
- // to manage in the scene graph and access/modify position.
-
- // Scaling along Camera's Z axis changes ZOOM.
- // Use GNODE rotation and translation functions to point the camera at an object.
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x L I G H T
- //
- //
- // File: tsxLight.h
- // Module: trueSpace eXtensions API
- // Descr: Interface to tsxLIGHT
- //
-
- // tsxLIGHT contains the following information in addition to tsxGNODE:
- // - type
- // - color
- // - intensity
- // - falloff
- // - shadow properties
- // - (Spot) cone angle, hot-spot ratio
- // Please consult the trueSpace Reference Manual for detailed description
- // of the shadow and other attributes.
- // The Z axis of a Spot or Infinite Light points in the direction of the
- // light rays.
-
-
- //-----------------------------
- // Related types and definitions
- //-----------------------------
- // Light types
- type
- tsxLIGHT_TYPE = (
- e_tsxLT_UNDEF,
- e_tsxLT_INFINITE, //Light from an very distant source
- e_tsxLT_LOCAL, //Light from a local point source
- e_tsxLT_SPOT //A spot-light
- );
-
- // Light intensity falloff
- tsxLIGHT_FALLOFF = (
- e_tsxLF_UNDEF,
- e_tsxLF_ZERO, //No falloff
- e_tsxLF_LINEAR, //Linear with distance
- e_tsxLF_SQUARED //square of distance
- );
-
- // Shadow type
- tsxLIGHT_SHADOWING = (
- e_tsxLS_NOSHADOWS,
- e_tsxLS_RAYTRACE,
- e_tsxLS_SHADOWMAP
- );
-
- // Shadow-map Size
- tsxLIGHT_SMSIZE = (
- e_tsxSMZ_UNDEF,
- e_tsxSMZ_LOW,
- e_tsxSMZ_MEDIUM,
- e_tsxSMZ_HIGH
- );
-
- // Shadow-map sharpness
- tsxLIGHT_SMSHARPNESS = (
- e_tsxSMS_UNDEF,
- e_tsxSMS_LOW,
- e_tsxSMS_MEDIUM,
- e_tsxSMS_HIGH
- );
-
-
- //-----------------------------
- // Managers
- //-----------------------------
-
- // Creates a Light of specified LtType at world origin,
- // with default position, orientation and attributes.
- // On success, the new Light is the currently selected object.
- // Default location: Spot, Local -- (0,0,1), Infinite -- (0,0,0).
- // Default orientation: 180 deg rotation about world X, making it
- // point towards world origin (spot, infinite) with its Z axis.
- // The axes are aligned as follows:
- // X aligned with World X,
- // Y and Z aligned with world negative Y and negative Z.
- function tsxLightCreateInScene(LtType: tsxLIGHT_TYPE): tsxErr; cdecl;
-
- // Use `tsxSobjDelete' to remove and delete from scene, and GNODE functions
- // to manage in the scene graph and access/modify position.
-
-
- //-----------------------------
- // Common Attributes
- //-----------------------------
-
- // Note: None of the following routines for modifying a light's attributes
- // update the display.
-
- // Light type
- function tsxLightGetType(pLight: PTsxLight): tsxLIGHT_TYPE; cdecl;
-
- // Get Light color (copied into pColor).
- procedure tsxLightGetColor(pLight: PTsxLight; var pColor: TTsxColor); cdecl;
-
- // Set Light color (copied from pColor).
- procedure tsxLightSetColor(pLight: PTsxLight; const pColor: TTsxColor); cdecl;
-
- // Get the light intensity. Returns -1 if not a light.
- function tsxLightGetIntensity(pLight: PTsxLight): Float; cdecl;
-
- // Set the light intensity. Returns new intensity, -1.0 if not a light.
- function tsxLightSetIntensity(pLight: PTsxLight; fNewIntens: Float): Float; cdecl;
-
- // Get the light intensity falloff type with distance.
- function tsxLightGetFalloff(pLight: PTsxLight): tsxLIGHT_FALLOFF; cdecl;
-
- // Set the light intensity falloff type with distance.
- // Returns new value, or tsxLF_UNDEF for invalid request.
- function tsxLightSetFalloff(pLight: PTsxLight; NewFo: tsxLIGHT_FALLOFF): tsxLIGHT_FALLOFF; cdecl;
-
- // Shadowing.
- function tsxLightGetShadType(pLight: PTsxLight): tsxLIGHT_SHADOWING; cdecl;
-
- // Set shadowing type.
- // Returns new value, e_tsxLS_NOSHADOWS if not a light.
- function tsxLightSetShadType(
- pLight: PTsxLight;
- newShType: tsxLIGHT_SHADOWING
- ): tsxLIGHT_SHADOWING; cdecl;
-
- // True if shadow-map is image size dependent.
- function tsxLightIsShadImgDep(pLight: PTsxLight): tsxBool; cdecl;
-
- // (Un)Set shadow-map's image size dependence.
- // Returns new value, False if not a light.
- function tsxLightSetShadImgDep(
- pLight: PTsxLight;
- bDependent: tsxBOOL //True to make it dependent
- ): tsxBool; cdecl;
-
- // Get shadow-map size
- function tsxLightGetShmapSize(pLight: PTsxLight): tsxLIGHT_SMSIZE; cdecl;
-
- // Set shadow-map size. Returns new value, or e_tsxSMZ_UNDEF if invalid request.
- function tsxLightSetShmapSize(
- pLight: PTsxLight;
- NewSz: tsxLIGHT_SMSIZE
- ): tsxLIGHT_SMSIZE; cdecl;
-
- // Get shadow-map sharpness (_UNDEF if not light).
- function tsxLightGetShmapSharpness(pLight: PTsxLight): tsxLIGHT_SMSHARPNESS; cdecl;
-
- // Set shadow-map sharpness.
- // Returns new value, or tsxSMS_UNDEF for invalid request.
- function tsxLightSetShmapSharpness(
- pLight: PTsxLight;
- NewSharpness: tsxLIGHT_SMSHARPNESS
- ): tsxLIGHT_SMSHARPNESS; cdecl;
-
-
- //-----------------------------
- // Spotlight Attributes
- //-----------------------------
-
- // Get cone angle (in radians).
- // This is the solid angle of the lit area subtended at the light source.
- // Returns -1.0 if not a spotlight.
- function tsxLightGetSpotAngle(pLight: PTsxLight): Float; cdecl;
-
- // Set the spotlight cone angle (in radians).
- // Returns the new angle, -1 if not a spotlight.
- function tsxLightSetSpotAngle( pLight: PTsxLight; newAngle: Float): Float; cdecl;
-
- // Get the hot-spot ratio.
- // The hot-spot in a spotlight is the inner circle of even bright light.
- // In the lit ring outside the hot-spot, the light intensity decreases
- // towards the outer edge. The hot-spot ratio is the ratio of the hot-spot
- // cone solid angle to the entire spotlight cone solid angle.
- // Returns 0.0 <= ratio <= 1.0, -1.0 if not a light.
- function tsxLightGetSpotRatio(pLight: PTsxLight): Float; cdecl;
-
- // Set the hot-spot ratio (see `tsxLightGetSpotRatio').
- // Returns new value, -1.0 if not a light, or invalid newRatio.
- function tsxLightSetSpotRatio(pLight: PTsxLight; newRatio: Float): Float; cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x M N O D E
- //
- //
- // File: tsxMNode.h
- // Module: trueSpace eXtensions API
- // Descr: Definition of tsxMNODE
- //
-
- // A tsxMNODE is the abstract type for Geometric Objects in a Scene.
- // An MNode adds the following features to a GNode:
- // - Modification of Model Frame position and orientation,
- // - Visibility.
- // All MNodes have a model frame that can be directly modified. TrueSpace
- // visualy displays the model frame through the position and orientation of
- // the MNode's Axes. TSXAPI allows direct modification of this model frame.
-
-
- //-----------------------------
- // MNode type check
- //-----------------------------
-
- // e_tsxTRUE if pSobj is a MNode
- function tsxIsMNode(pSObj: PTsxSObj): tsxBool; cdecl;
-
-
- //-----------------------------
- // Drawing/Rendering
- //-----------------------------
-
- // Polyhdera are the only visible object types in a photo-rendered scene (other
- // than lighting effects). Since Polyhdera may be members of Groups in a
- // hierarchy, TSXAPI allows a Group MNode to be rendered, or set (in)visible.
- // Only the Polyhdera members of the group are affected. Therefore, the following
- // operations are meaningful for Group MNodes only if they have some Polyhdera
- // as sub-objects.
-
- // Returns e_tsxTRUE if pMNode is Visible in a rendered scene.
- // A Group object may return TRUE even if it does not have any
- // Polyhdera descendants.
- function tsxMNodeIsVisible(pMNode: PTsxMNODE): tsxBool; cdecl;
-
- // Makes pMNode Visible. Effect on next Draw operation.
- procedure tsxMNodeSetVisible(pMNode: PTsxMNODE); cdecl;
-
- // Makes pMNode Invisible. Effect on next Draw operation.
- procedure tsxMNodeSetInvisible(pMNode: PTsxMNODE); cdecl;
-
-
- //-----------------------------
- // Model-frame Axes
- //-----------------------------
-
- // The Axes define the object's own model frame (as different from the world
- // frame). This frame is used for rigid body transformations
- // (translation/rotation/scaling) (see tsxGNode).
-
- // Returns e_tsxTRUE if MNode has its Axes displayed in tS.
- function tsxMNodeAreAxesVisible(pMNode: PTsxMNODE): tsxBool; cdecl;
-
- // Toggles (On/Off) the display of the current object's axes, if applicable.
- procedure tsxCurrobjToggleAxes; cdecl;
-
- // Set the position of MNode's axes.
- // Does not update views.
- procedure tsxMNodeSetAxesPosition(pMNode: PTsxMNODE; const posn: TTsxVector3f); cdecl;
-
- // Set the orientation of MNode's axes.
- // `axes' must point to valid (orthogonal, unit) axes.
- // Does not update views.
- procedure tsxMNodeSetAxesOrientation(pMNode: PTsxMNODE; const axes: TTsxAxes3f); cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x G R O U P
- //
- //
- // File: tsxGroup.h
- // Module: trueSpace eXtensions API
- // Descr: Definition of tsxGROUP
- //
-
- // Only tsxGNODE types can be grouped together. The children of a group
- // may be any tsxGNODE derived type.
-
- //-----------------------------
- // Making Groups
- //-----------------------------
-
- // The grouping mechanism (currently) only works with the currently selected obj.
-
- // This is the same function as used in the [Glue as Child] button.
- // (Currobj = currently selected object)
- // Makes pGNode and Currobj children of a new Group obj, and
- // the Group obj is placed where Currobj was in the Scene Graph.
- // The new Group obj becomes the current selection, and acquires
- // the previous Currobj's axes position and orientation.
- // The animation timeline window is updated.
- // pGNode and Currobj must have different Roots (`tsxGNodeGetRoot').
- // Returns: 0 if no pGNode or Currobj, or not valid GNodes, or
- // if pGNode is same as Currobj (no grouping done), else
- // ptr to the new Group obj.
- function tsxGroupNewWithCurrobj(pGNode: PTsxGNode): PTsxGroup; cdecl;
-
- // This is the same function as used in the [Glue as Sibling] button.
- // (Currobj = currently selected object)
- // IF Currobj is a Group node,
- // THEN pGNode is added to it as another child;
- // ELSE
- // Makes pGNode and Currobj children of a new Group obj, and
- // the Group obj is placed where Currobj was in the Scene Graph.
- // The new Group obj becomes the current selection, and acquires
- // the previous Currobj's axes position and orientation.
- // The animation timeline window is updated.
- // pGNode and Currobj must have different Roots (`tsxGNodeGetRoot').
- // pGNode must be a top level object (no parent groups above it).
- // Returns: 0 if no pGNode or Currobj, or not valid GNodes, or
- // if pGNode is same as Currobj (no grouping done), else
- // ptr to the (new or Currobj) Group obj.
- function tsxGroupAtCurrobj(pGNode: PTsxGNode): PTsxGroup; cdecl;
-
- // This is the same function as used in the [Unglue] button.
- // Currobj is removed from its parent Group and added as a top level object
- // to the scene. Current selection is updated to next available sibling.
- // Side Effect: If the Currobj has only one sibling before calling this
- // function, then the parent GROUP object is removed and the sibling takes
- // the place in the scene graph of the removed GROUP object. Thus this
- // function never results in a Group object with just one child.
- // (Parent = parent GROUP of Currobj before calling this function)
- // Returns:
- // 0 on failure (e.g. No Currobj, Currobj not part of group), else
- // ptr to oject that takes the place of Parent in the scene graph
- // (see note on Side Effect):
- // = Parent if it had more than 2 children before this function, else
- // = the sibling that replaces Parent.
- function tsxGroupRemoveCurrobj: PTsxGNode; cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x P O L Y H
- //
- //
- // File: tsxPolyh.h
- // Module: trueSpace eXtensions API
- // Descr: Definition of tsxPOLYHEDRA
- //
-
- // A tsxPOLYHEDRON is the only renderable simple geometric node type.
- // It is basically a geometric object constructed of polygonal faces.
- // It contains the following additional info beyond MNode:
- // - Status flags
- // - Vertices
- // - Vertex Transformation Matrix
- // - Faces
- // - Materials
- // - UV space mappings
- // - Bounding Box
-
- // trueSpace divides the traditional model transformation matrix of geometric
- // objects into two:
- // - The Model-Axes, which specify the model-frame origin and axes orientation.
- // - The Vertex Transformation Matrix, which specifies the transformation
- // necessary to convert a Polyhedron's vertices into world space coordinates.
- // The coordinates used to specify each vertex in the Polyhedron's vertex
- // array are relative to the Vertex Transformation Matrix.
- // See also tsxGNode.h and tsxMNode.h .
-
- //-----------------------------
- // Related Types
- //-----------------------------
-
- // Face -> Vertex data
- // Note: Use the TSXAPI memory routines (tsxMisc.h) to allocate
- // the memory area for instances of this type.
- // DO NOT use `new' or `malloc/calloc'!
- type
- TTsxFaceVx = Record
- vix: Integer; // Index into Polyhedron's Vertex Array (see `tsxPolyhGetVxArray').
- uvix: Integer; // Index into Polyhedron's UV Array.
- nextfaceix: Integer; // Index (in Polyh) of next face containing this vertex.
- // Use `tsxPolyhComputeFaceAdjacency' to set this field.
- color: TTsxColor; //IF color.alpha == 0 THEN use material color
- //OTHERWISE use vertex color.
- end;
- PTsxFaceVx = ^TTsxFaceVX;
- TsxFaceVxArray = array[0..1000] of TTsxFaceVx;
- PTsxFaceVxArray = ^TsxFaceVxArray;
-
- // Face.
- // Faces are one-sided polygons, with their vertices specified in clockwise
- // order when looking at the front of the polygon. The surface normal points
- // out of (or away from) the front.
- // Use `tsxPolyhGetFaceptrArray' to access a polyhedron's faces.
- // You must use `tsxFaceAlloc' or `tsxFaceCopy' to create instances of this type.
- TTsxFace = Record
- nbrVxs: Short; //Nbr of Vertices
- pFVxs: PTsxFaceVXArray; //Array of Face-Vertex data, Vertices in clockwise order.
- r1: Byte; // reserved
- r2: Byte; // reserved
- r3: Pointer; // reserved
- normVxs: array[0..2] of Byte; //Indices into pFVxs of 3 vertices
- // ... to build Face Normal (see below).
- materialIdx: Word; //ID of Face's material
- end;
- PTsxFace = ^TTsxFace;
- TsxPFaceArray = array[0..9000] of PTsxFace;
- PTsxPFaceArray = ^TsxPFaceArray;
-
- // Note on the field tsxFace.normVxs ...
- // The three indices represent three face vertices in clockwise order,
- // defining two rays in the plane of the face:
- // ORIGIN -> RAY1 and ORIGIN -> RAY2
- // The cross-product of (ray1 x ray2) gives an unnormalized vector
- // perpendicular to the face, facing out. These vertices must not be colinear.
- const
- tsx_NORM_VXS_ORIGIN = 1;
- tsx_NORM_VXS_RAY1 = 0;
- tsx_NORM_VXS_RAY2 = 2;
-
- // -----------------------------------------------------------------------
- // How to create a Polyhedron from scratch
- // ---------------------------------------
- //
- // The following pseudo-code demonstrates how to create a new Polyhedron.
- // Actual code should include error tests omitted here.
- //
- // ... Create the Polyhedron shell
- // tsxPOLYHEDRON* pPolyh;
- // tsxPolyhCreate( &pPolyh );
- // ... Vertices
- // CtsxVector3f* pVxs = tsxCalloc( iNbrVxs, sizeof(CtsxVector3f) );
- // ... Set Vertex coordinates
- // tsxPolyhSetVxs( pPolyh, iNbrVxs, pVxs );
- // ... Faces
- // CtsxFace** ppFaces = tsxCalloc( iNbrFaces, sizeof(CtsxFace*) );
- // for ( i=0; i<iNbrFaces; ++i )
- // ... set Face-vertex info
- // CtsxFaceVx* pFVxs = tsxCalloc( NbrVxsForFace[i], sizeof(CtsxFaceVx) );
- // ... set fields in pFVxs, especially vix = index into pVxs
- // ... set Face info
- // CtsxFace* pFace = tsxFaceAlloc();
- // pFace->pFVxs = pFVxs;
- // pFace->nbrVxs = NbrVxsForFace[i];
- // ... set the normVxs field, etc.
- // ... Add face to Face-array
- // ppFaces[i] = pFace;
- //
- // tsxPolyhSetFaces( pPolyh, iNbrFaces, ppFaces );
- // ... Tell trueSpace to complete Polyhedron internals
- // tsxPolyhComputeFaceAdjacency( pPolyh );
- // tsxPolyhMarkTopologyChange( pPolyh );
- // tsxPolyhMarkGeomChange( pPolyh );
- // ... Initialize to default active material
- // tsxPolyhInitializeMaterials( pPolyh );
- // ... Add to scene and display
- // tsxSceneAddObject( (tsxGNODE*)pPolyh, e_tsxFALSE);
- // -----------------------------------------------------------------------
-
-
- //-----------------------------
- // Managers
- //-----------------------------
-
- // Creates an empty Polyhedron (0 vertices and faces).
- // The Model-Axes are set to the World Axes.
- // The Vertex Transformation Matrix is set to the identity matrix
- // with no translation.
- function tsxPolyhCreate(var ppPolyh: PTsxPolyhedron): tsxErr; cdecl;
-
- // Clears a Polyhedron to 0 vertices & faces, freeing related structures.
- procedure tsxPolyhClear(pPolyh: PTsxPolyhedron); cdecl;
-
- // Tessellate the polyhedron.
- // The geometry of the polyhedron is modified so that all faces are triangles.
- // If the original polyhedron had some non-triangular faces, then the number
- // of faces will probably increase. Actually replaces the internal face
- // and related structures.
- function tsxPolyhTessellate(pPolyh: PTsxPolyhedron): tsxErr; cdecl;
-
-
- //-----------------------------
- // Status
- //-----------------------------
-
- // The following functions inform trueSpace of changes in a Polyhedron.
- // These flags are checked when the object is next drawn, and some topological
- // information is computed and cached.
-
- // Tell tS that this Polyhedron's Geometry has changed.
- procedure tsxPolyhMarkGeomChange(pPolyh: PTsxPOLYHEDRON); cdecl;
-
- // Tell tS that this Polyhedron's Topology has changed.
- procedure tsxPolyhMarkTopologyChange(pPolyh: PTsxPOLYHEDRON); cdecl;
-
- // Tell tS that this Polyhedron's Material(s) have changed.
- // Use after modifying UV entries, for example.
- procedure tsxPolyhMarkMaterialChange(pPolyh: PTsxPOLYHEDRON); cdecl;
-
-
- //-----------------------------
- // Vertices
- //-----------------------------
-
- // Get the number of vertices (0 if not a Polyhedron).
- function tsxPolyhGetNbrVxs(pPolyh: PTsxPOLYHEDRON): Integer; cdecl;
-
- // Get pointer to the array of vertices (0 if not a Polyhedron).
- // The Vertex coordinates are in the frame defined by
- // the Vertex Transformation Matrix.
- function tsxPolyhGetVxArray(pPolyh: PTsxPolyhedron): PTsxVector3fArray; cdecl;
-
- // Get the Vertex Transformation Matrix. Returns pTxmx, if valid operation.
- // Note: This matrix includes scaling and shearing terms, so it is not
- // guaranteed to be orthogonal. Use `tsxUnMatrix3f' before inverting.
- function tsxPolyhGetVxTxmx(
- pPolyh: PTsxPolyhedron;
- var pTxmx: TTsxTxmx3f
- ): PTsxTxmx3f; cdecl;
-
- // Assign a new vertex array to the Polyhedron.
- // The corresponding field in pPolyh is set to pVxs.
- // Clears old Vx array and frees memory, if any.
- // Note: Use the TSXAPI memory routines (tsxMisc.h) to allocate
- // the memory area (pVxs) for the Vertex Array
- // -- DO NOT use `new' or `malloc/calloc'!
- procedure tsxPolyhSetVxs(
- pPolyh: PTsxPolyhedron;
- iNbrVxs: Integer; // Number of Vxs (>= 0)
- pVxs: PTsxVector3fArray); cdecl;// ptr to Array. May be 0.
-
- // Copies a new Vertex Transformation Matrix into pPolyh.
- procedure tsxPolyhSetVxTxmx(
- pPolyh: PTsxPolyhedron;
- const pTxmx: TTsxTxmx3f //ptr to new Txmx copied into Polyh.
- ); cdecl;
-
-
- //-----------------------------
- // Faces
- //-----------------------------
-
- // The face data is stored as an array of pointers to CtsxFace structures.
- // Always use the following functions to manage faces.
-
- // Allocate a new face structure
- function tsxFaceAlloc: PTsxFace; cdecl;
-
- // Delete's pFace and all related structures.
- procedure tsxFaceDelete(pFace: PTsxFace); cdecl;
-
- // Allocates new Face structure, assigning it to ppFaceCopy,
- // and Copies pFace and all related structures into it.
- function tsxFaceCopy(var ppFaceCopy: PTsxFace; pFace: PTsxFace): tsxErr; cdecl;
-
- // Get the number of Faces (0 if not a Polyhedron).
- function tsxPolyhGetNbrFaces(pPolyh: PTsxPolyhedron): Integer; cdecl;
-
- // Get pointer to the array of Face-ptrs (0 if not a Polyhedron).
- function tsxPolyhGetFaceptrArray(pPolyh: PTsxPolyhedron): PTsxPFaceArray; cdecl;
-
- // Assign a new Face-ptr array to the Polyhedron.
- // The corresponding field in pPolyh is set to pFaces.
- // Clears old Faces and array and frees memory, if any.
- // Note: Use the TSXAPI memory routines (tsxMisc.h) to allocate
- // the memory area (pFaces) for the Face Array
- // -- DO NOT use `new' or `malloc/calloc'!
- procedure tsxPolyhSetFaces(
- pPolyh: PTsxPOLYHEDRON;
- iNbrFaces: Integer; // Number of Faces (>= 0)
- pFaces: PTsxPFaceArray // Array of ptrs. May be 0.
- ); cdecl;
-
- // Uses pFace->normVxs to compute face normal of pFace in pPolyh.
- // Normal returned in pNorm, in the frame defined by the
- // Vertex Transformation Matrix.
- procedure tsxPolyhGetFaceNormal(
- pPolyh: PTsxPOLYHEDRON;
- pFace: PTsxFace;
- var pNorm: TTsxVector3f //ptr to struct where result is copied.
- ); cdecl;
-
- // Sets up the `nextfaceix' fields in CtsxFaceVx structs.
- // Call after all the other Face-Vertex data has been set for all faces.
- function tsxPolyhComputeFaceAdjacency(pPolyh: PTsxPOLYHEDRON): tsxErr; cdecl;
-
- //-----------------------------
- // UV Space
- //-----------------------------
-
- // Every polyhedron maintains an array of UV entries.
- // CtsxFaceVx.uvix is an index into this array, giving the UV coordinates
- // for that vertex for the corresponding face's material.
-
- // Get the number of entries in UV-array (0 if not a Polyhedron).
- function tsxPolyhGetNbrUV(pPoly: PTsxPOLYHEDRON): Integer; cdecl;
-
- // Get pointer to the UV-array (0 if not a Polyhedron).
- function tsxPolyhGetUVArray(pPolyh: PTsxPolyhedron): PTsxUVArray; cdecl;
-
- // Assign a new UV array to the Polyhedron.
- // The corresponding field in pPolyh is set to pUV.
- // Clears old Faces and array and frees memory, if any.
- // Note: Use the TSXAPI memory routines (tsxMisc.h) to allocate
- // the memory area (pUV) for the UV Array -- DO NOT use `new' or `malloc/calloc'!
- procedure tsxPolyhSetUVArray(
- pPolyh: PTsxPOLYHEDRON;
- iNbrUV: Integer; // Number of UV entries (>= 0)
- pUV: PTsxUVArray // ptr to UV-Array. May be 0.
- ); cdecl;
-
- //-----------------------------
- // Painting/Materials
- //-----------------------------
-
- // Assigns active material to entire Polyhedron.
- // Call this function AFTER setting/modifying a polyhedron's geometry,
- // and BEFORE painting faces or vertices.
- // Use other material functions to specify specific materials.
- function tsxPolyhInitializeMaterials(pPoly: PTsxPOLYHEDRON): tsxErr; cdecl;
-
- // Give entire pPolyh the material pMatrl. Remove old materials.
- // Note: A copy of pMatrl is created and assigned to the Polyhedron.
- // Caller is responsible for managing pMatrl.
- procedure tsxPolyhPaint(pPolyh: PTsxPOLYHEDRON; pMatrl: PTsxMATERIAL); cdecl;
-
- // Paint face with a material.
- // Returns e_tsxFALSE on failure or if object not changed.
- // Note: A copy of pMatrl is created and assigned to the Polyhedron.
- // Caller is responsible for managing pMatrl.
- function tsxPolyhPaintFace(
- pPolyh: PTsxPolyhedron;
- iFaceIndex: Integer; //Index of face to be painted in pPolyh
- pMatrl: PTsxMaterial; //New material to paint on face
- bClearVxColors: tsxBool //e_tsxTRUE if Vertex colors should be cleared.
- ): tsxBool; cdecl;
-
- // Paint vertex with a color.
- // Returns e_tsxFALSE on failure or if object not changed.
- // Note: A copy of pColor is created and assigned to the Polyhedron.
- // Caller is responsible for managing pColor.
- function tsxPolyhPaintVertex(
- pPolyh: PTsxPolyhedron;
- iVxIndex: Integer; //Index of face to be painted in pPolyh
- const pColor: TTsxColor //New color to paint on face
- ): tsxBool; cdecl;
-
- // Use this function to access the material assigned to a face.
- // pMatrl is a pointer to a Material object created through one of the
- // tsxMaterialCreate functions. The face's material, if any, is copied
- // into this structure.
- // Returns e_tsxFALSE on failure or if face does not have a material.
- function tsxPolyhGetMaterial(
- pPolyh: pTsxPOLYHEDRON;
- materialIdx: WORD; //From CtsxFace.materialIdx
- pMatrl: PTsxMATERIAL //Material copied into this structure
- ): tsxBool; cdecl;
-
- // Photo-render a face in the active view.
- function tsxPolyhPhrenderFace(pPolyh: PTsxPolyhedron; iFaceIndex: Integer): tsxErr; cdecl;
-
-
- //-----------------------------
- // Primitive Polyhedron Shapes
- //-----------------------------
-
- // These are the same functions as used in the tS interface.
- // They all create an object centered at the origin,
- // painted with the currently active material.
- // Where there is no specific input, the X, Y, Z dimensions default to 2.
- // Since these are all polyhedra, with a piecewise linear approximation
- // of curved surfaces, the resolution of this approximation is controlled
- // by the NbrLongitudes and NbrLattitudes parameters.
-
- // Creates a sphere sitting on the XY plane, with Z as the vertical axis.
- function tsxCreateSphere(NbrLongitudes, NbrLatitudes: Integer; radius: Float): PTsxPolyhedron; cdecl;
-
- // Creates a Cylinder with the base in the XY plane and Z as the vertical axis.
- function tsxCreateCylinder(
- NbrLongitudes: Integer; // # Longs (Min = 3)
- NbrLattitudes: Integer; // # Latts (Min = 2)
- topRadius: Float; // Top radius
- botRadius: Float; // Base radius
- height: Float): PTsxPolyhedron; cdecl;
-
- // Creates a Cone (really a cylinder with a very very small top)
- // with the base in the XY plae, and Z as the vertical axis.
- function tsxCreateCone(
- NbrLongitudes: Integer; // # Longs (Min = 3)
- NbrLattitudes: Integer; // # Latts (Min = 2)
- botRadius: Float; // Base radius
- height: Float): PTsxPolyhedron; cdecl;
-
- // Creates a cube aligned with the World axes.
- function tsxCreateCube(
- nbrSections: Integer;
- x, y, z: Float): PTsxPolyhedron; cdecl;
-
- // Create a torus with Z as the axis.
- function tsxCreateTorus(
- NbrLongitudes: Integer; // # Longitudes (Min = 3)
- NbrLattitudes: Integer; // # Lattitudes (Min = 3)
- innerRadius: Float // Inner radius (0 < radius < 1.0)
- ): PTsxPolyhedron; cdecl;
-
- // Creates rectangular plane in XY plane.
- function tsxCreatePlane(
- nbrXrects: Integer; // # rects in X direction (Min = 1)
- nbrYrects: Integer // # rects in Y direction (Min = 1)
- ): PTsxPolyhedron; cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x S E L E C T
- //
- //
- // File: tsxSelect.h
- // Module: trueSpace eXtensions API
- // Descr: The Selection Mechanism
- //
-
- // This describes the API to trueSpace's selection mechanism. Several trueSpace
- // functions require their target object to be currently selected.
- // Selectable objects are:
- // - GNodes
- // - Axes
- // trueSpace may allow selection of some unsupported object types (which
- // show up as e_tsxUNDEFINED). Call the appropriate Selection function
- // (e.g. tsxSelectNext) until a TSX-supported Node type is selected.
-
- //-----------------------------
- // Select Modes
- //-----------------------------
-
- type
- tsxSELECTMODE = (
- e_tsxSELECT, // Ordinary Selection of a Node.
- e_tsxERASE, // For selecting an object after erasing curr obj.
- e_tsxGLUE // For selecting an object to attach to curr obj.
- );
-
-
- //-----------------------------
- // Tests
- //-----------------------------
- // e_tsxTRUE if pSobj is of supported selectable type (see doc above).
- function tsxIsSelectable(pSObj: PTsxSObj): tsxBool; cdecl;
-
- // e_tsxTRUE if pSobj is part of a selected Object/Group
- function tsxIsSelected(pSObj: PTsxSObj): tsxBool; cdecl;
-
-
- //-----------------------------
- // Accessing/Making/Changing a Selection
- //-----------------------------
-
- // Get pointer to the currently selected object.
- // Note: trueSpace may select objects that are not currently supported in TSX.
- function tsxGetCurrentSelection: pTsxSOBJ; cdecl;
- // Essentially same (with correct args) as picking an object with the mouse.
- // Make specified pSobj the current selection.
- // Set `bNoDraw' to e_tsxTRUE if you do not wish the object to be redrawn in
- // "selected" mode. Use this feature carefully, as it might result in all
- // or portions of the object being erased when the next object is selected.
- // Primarily meant as a mechanism for temporarily selecting an object for
- // operations, and to be followed by a scene refresh.
- procedure tsxSelectSobj(
- pSobj: PTsxSObj; //Must be `tsxIsSelectable'
- selmode: tsxSelectMode;
- bNoDraw: tsxBOOL //TRUE if Views should not be updated.
- ); cdecl;
-
- // Same function as called on the [downArrow] button.
- // Selects a child of the Currobj.
- // Views updated.
- procedure tsxSelectDown; cdecl;
-
- // Same function as called on the [upArrow] button.
- // Selects parent of Currobj.
- // Views updated.
- procedure tsxSelectUp; cdecl;
-
- // Same function as called on the <rightArrow> key.
- // Selects a sibling of the Currobj, following Currobj in the list.
- // Views updated.
- procedure tsxSelectNext; cdecl;
-
- // Same function as called on the <leftArrow> key.
- // Selects a sibling of the Currobj, preceeding Currobj in the list.
- // Views updated.
- procedure tsxSelectPrev; cdecl;
-
-
- //-----------------------------
- // Callback
- //-----------------------------
-
- // The function `func' will get called each time there is a change in the
- // current selection, made by the normal trueSpace mouse tool or through a
- // call to one of the above functions for making/changing a selection, while
- // an eXtension is active. Use 0 (NULL) to remove an installed callback.
- // Installation and callback works only while an eXtension is active.
- // Returns the previous callback function pointer (or 0 if none).
- function tsxSelectionChangedCB(
- tsxid: Integer; // Id of this eXtn (see tsxGetData).
- func: TTsxBasicCallbackFP // This function gets installed as the callback.
- ): TTsxBasicCallBackFP; cdecl;
-
-
- //-----------------------------
- // Misc fns dealing with Currobj
- //-----------------------------
-
- // Removes the current object and substitutes it with pNewGNode.
- // If the selected part of the current object does not include it's children,
- // the children are moved to the new object and removed from the current
- // object, leaving the children non-selected. pNewGNode is installed in
- // Currobj's location, and becomes the new Currobj. The old Currobj is deleted.
- procedure tsxCurrobjReplace(
- pNewGNode: PTsxGNode;
- bNoDraw: tsxBOOL //TRUE if View displays should not be refreshed.
- ); cdecl;
-
- // Copy curr obj and add to scene at top level, making it new currobj.
- function tsxCurrobjCopy: tsxErr; cdecl;
-
- // Draw the curr selection
- procedure tsxCurrobjDraw; cdecl;
-
- // Photo-render the current object in the active view.
- procedure tsxCurrobjPhrender; cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x A N I M
- //
- //
- // File: tsxAnim.h
- // Module: trueSpace eXtensions API
- // Descr: Animation
- //
-
- //-----------------------------
- // Misc
- //-----------------------------
-
- type
- tsxKFRAME_TYPE = (
- e_tsxKFT_UNDEF, // undefined
- e_tsxKFT_LOOK, // look at object or ahead
- e_tsxKFT_ROTATE,// object rotate
- e_tsxKFT_MOVE, // object move
- e_tsxKFT_SCALE, // object scale
- e_tsxKFT_END
- );
-
- //-----------------------------
- // Managers
- //-----------------------------
-
- // Creates and attaches a Script, if none present.
- function tsxGNodeCreateScript(pGNode: PTsxGNode): TsxErr; cdecl;
- // As above, for obj and all its children
- function tsxGNodeCreateScriptTree(pGNode: PTsxGNode): TsxErr; cdecl;
-
- // Deletes animation for the object
- function tsxGNodeDeleteScript(pGNode: PTsxGNode): TsxErr; cdecl;
- // As above, for owner and all its children
- function tsxGNodeDeleteScriptTree(pGNode: PTsxGNode): TsxErr; cdecl;
-
- // Copies animation of From obj to destination To object
- function tsxGNodeCopyScript(pGNodeTo, pGNodeFrom: PTsxGNode): TsxErr; cdecl;
-
- //-----------------------------
- // Key Frames
- //-----------------------------
-
- // Create Keyframe (at curr active frame nbr) for obj, for specified attributes.
- function tsxGNodeSetFrame(pGNode: PTsxGNode; keyfType: tsxKFRAME_TYPE): TsxErr; cdecl;
- // Delete Keyframe (at curr active frame nbr) for obj, for specified attributes.
- function tsxGNodeUnsetFrame(pGNode: PTsxGNode; keyfType: tsxKFRAME_TYPE): TsxErr; cdecl;
- // Set the active frame nbr for pGNode, related preparation.
- procedure tsxAnimSetActiveFrame(pGNode: PTsxGNODE; frameNbr: Float); cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x M I S C
- //
- //
- // File: tsxMisc.h
- // Module: trueSpace eXtensions API
- // Descr: Miscellaneous items
- //
-
- //-----------------------------
- // Accessing an installed trueSpace's TSX Version Info
- //-----------------------------
-
- // An eXtension may want to confirm that it is compatible with the version of
- // trueSpace it is being installed into (actually, compatible with the TSXAPI),
- // by checking the version number of tsxapi.dll .
- //
- // Note on TSX API Version numbering scheme:
- // Major is the major release version of trueSpace, in hundreds.
- // For example,
- // for trueSpace 3, Major = 300;
- // for trueSpace 3.5 (should there be one) Major = 350.
- // Minor is the minor release version of TSX API.
- // Negative numbers in the minor refer to pre-release (alpha, beta) versions.
- //
- // To check compatibility,
- // if a TSX requires any version on or after [baseMajor, baseMinor],
- // check for: (Major >= baseMajor) &&
- // (Minor >= baseMinor)
-
- // Accessing an installed trueSpace's TSX Version Info. Values placed in
- // the arguments.
- procedure tsxGetTsVersionNbrs(
- var pMajor: Short; // Major version nbr
- var pMinor: Short // Minor version nbr
- ); cdecl;
-
-
- //-----------------------------
- // Accessing The primary view-window client area
- //-----------------------------
-
- // Returns handle to the main view window.
- function tsxGetMainViewHwnd: HWND; cdecl;
-
-
- //-----------------------------
- // Requesting (De)Activation
- //-----------------------------
-
- // Requests a left-click action on the extension's button (see tsxOnLeftClick).
- // Useful when, e.g., an extension wants to leave a panel on the screen even
- // when deactivated, and then requests re-activation when a button is clicked
- // on this panel. Also useful to deactivate an active extension when user
- // exits from extensions parameter panel.
- function tsxForceLeftClick(
- tsxid: Integer // extension-id (see tsxGetData)
- ): tsxErr; cdecl;
-
- //-----------------------------
- // Heap Memory
- //-----------------------------
-
- // Use these memory routines when allocating memory for trueSpace,
- // e.g. vertex-array for Polyhedra (tsxPolyh.h).
-
- function tsxMalloc(size: DWORD): Pointer; cdecl;
- function tsxCalloc(num, size: DWORD): Pointer; cdecl;
- // You MUST use the following two functions to reallocate or free
- // memory blocks allocated by the above functions.
- function tsxRealloc(memblock: Pointer; size: UnsignedInt): Pointer; cdecl;
- procedure tsxFree(memblock: Pointer); cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x M O U S E
- //
- //
- // File: tsxMouse.h
- // Module: trueSpace eXtensions API
- // Descr: Interface to the Mouse
- //
-
- // This is the interface to the Mouse-Tool in trueSpace.
- // For an extension to receive mouse action messages, it must install
- // the mouse-tool (using tsxMtoolInstall).
- // See also picking functions in "tsxAView.h".
-
- //-----------------------------
- // Related Types and Definitions
- //-----------------------------
-
- // Internal data structure for managing the mouse tool.
- type
- TTsxMousetool = Record end;
- PTsxMouseTool = ^TTsxMouseTool;
-
- // Callback type for mouse-tool message
- TTsxMtoolMsg = function(
- mt: PTsxMousetool;
- msg: Short; //see mouse-tool messages, below.
- X: Short; //mouse position on screen, viewport X coordinate.
- Y: Short; //mouse position on screen, viewport Y coordinate.
- data: Short //additional data depending upon msg.
- ): Boolean; cdecl;
-
- // Callback type for mouse events
- TTsxMtoolClick = function(
- mt: PTsxMousetool;
- X: Short; //mouse position on screen, viewport X coordinate.
- Y: Short; //mouse position on screen, viewport Y coordinate.
- flags: Short //see mouse event flags, below.
- ): Boolean; cdecl;
-
- // Mouse-tool messages
- const
- tsxMTM_ACTIVATE = 1; //Mousetool is being activated.
- tsxMTM_DEACTIVATE = 2; //Mousetool is being deactivated.
- tsxMTM_DESELECT = 3; //Current object is being deselected.
- tsxMTM_SELECT = 4; //New current object has been selected.
- tsxMTM_KEY = 5; //Key has been pressed: char is in `data'.
- // Return FALSE if key is used.
- tsxMTM_CREATE = 6; //Mousetool has been created.
- tsxMTM_DESTROY = 7; //Mousetool is being destroyed.
- tsxMTM_ERASE = 8; //Erase requested on currently selected object.
- // If TRUE is returned the current object is deleted.
- tsxMTM_CHECKCURSOR = 9; //Called on WM_MOUSEMOVE, WM_KEYUP, WM_KEYDOWN.
- // `data' contains mouse event flags.
- // For Mouse-move, mouse coordinates are passed.
-
- // Mouse event flags
- tsxMTF_RIGHT = $01; //Right mouse button clicked
- tsxMTF_LEFT = $02; //Left mouse button clicked
- tsxMTF_SHIFT = $04; //Shift key is pressed
- tsxMTF_CTRL = $08; //Control key is pressed
- tsxMTF_OUTSIDE = $4000; //Mouse is outside window (for drag operations)
- tsxMTF_DBLCLK = $8000; //Mouse button was double-clicked
-
-
- //-----------------------------
- // Management
- //-----------------------------
-
- // When a new mouse-tool is installed, `pMtoolMsgFunc' is called with the
- // message tsxMTM_CREATE, and then with tsxMTM_ACTIVATE. The eXtension
- // MUST be active at this time.
- // A mouse-tool installed by an extension is removed before the extension is
- // deactivated. It is also removed when trueSpace receives a new install request.
- // Before a mouse-tool is removed, its message function `pMtoolMsgFunc' is
- // called first with the message tsxMTM_DEACTIVATE and then with tsxMTM_DESTROY.
- //
- // Typical sequence of events:
- // - User selects eXtn
- // - eXtn is activated
- // - eXtn installs mouse-tool
- // - pMtoolMsgFunc called with message tsxMTM_CREATE
- // - pMtoolMsgFunc called with message tsxMTM_ACTIVATE
- // - ... handle mouse events ...
- // - user selects another tS tool
- // - pMtoolMsgFunc called with message tsxMTM_DEACTIVATE
- // - pMtoolMsgFunc called with message tsxMTM_DESTROY
- // - eXtn is deactivated (tsxDeactivate)
- // - control switches to the new tool selected by user
-
- // Installs the mouse-tool if the eXtension is active.
- // Function pointers cannot be NULL.
- function tsxMtoolInstall(
- tsxId: Integer; // extension-id (see tsxGetData)
- pMtoolMsgFunc: TTsxMtoolMsg; // mouse-tool-message callback
- pMtoolEventFunc: TTsxMtoolClick // mouse-event callback
- ): tsxErr; cdecl;
-
- // Removes the mouse-tool installed by this extension, if any.
- // Extension must be active.
- procedure tsxMtoolRemove(tsxId: Integer); cdecl;
- // -----------------------------------------------------------------------------
-
-
-
- // =============================================================================
- //
- // t s x A V I E W
- //
- //
- // File: tsxAView.h
- // Module: trueSpace eXtensions API
- // Descr: Interface to the Active View
- //
-
- // This is the interface to the active viewport and its "eye" attributes.
- // The Active Viewport is the currently active view into the scene.
- // Eye attributes:
- // - Position
- // - Bank angle w.r.t. the world X axis
- // - "Look at" direction
- // - Zoom
- // The eye's frame is similar to that of a Camera, with the Z axis pointing
- // out into the scene, and the Y axis pointing up.
- // See also "tsxCamra.h" and "tsxMouse.h".
-
- //-----------------------------
- // Related Types
- //-----------------------------
- type
- tsxRENDERMODE = (
- e_tsxRM_UNDEF,
- e_tsxRM_WIRE, //Wire-frame
- e_tsxRM_3DR, //3DR
- e_tsxRM_D3D //Direct3D
- );
-
- // Viewing modes
- tsxVIEWMODE = (
- e_tsxVM_PERSPECTIVE,
- e_tsxVM_TOP,
- e_tsxVM_FRONT,
- e_tsxVM_LEFT,
- e_tsxVM_CAMERA //Look through an object or camera
- );
-
-
- //-----------------------------
- // Refreshing the Active View
- //-----------------------------
-
- // Use this function to refresh the active view of the scene after changing
- // the view's attributes.
- procedure tsxAViewRefresh; cdecl;
-
-
- //-----------------------------
- // Render and View Mode
- //-----------------------------
-
- // Get the rendering mode of the active view.
- function tsxAViewGetRenderMode: tsxRENDERMODE; cdecl;
-
- // Get the view mode for the active view.
- function tsxAViewGetViewMode: tsxVIEWMODE; cdecl;
-
- // Change the view mode for teh active view.
- // If newmode is e_tsxVM_CAMERA, it is set to look through the currently
- // selected object, if any. Useful with Cameras and Lights.
- // Returns: e_tsxTRUE if there is a change in mode.
- function tsxAViewSetViewMode(newmode: tsxVIEWMODE): tsxBool; cdecl;
-
- // Make the active view look through an object (pGNode), until further notice.
- // In this mode, any changes to the eye's position, orientation and direction
- // will also be transmitted to the object.
- function tsxAViewSetCameraMode(pGNode: PTsxGNode): tsxErr; cdecl;
-
- // Turn off the camera mode, removing the constraint on the active view
- // to look through an object. The current view of the scene is not changed.
- procedure tsxAViewUnsetCameraMode; cdecl;
-
- // Get pointer to the object that the active view is currently constrained
- // to look through, if any.
- function tsxAViewGetCameraObj: PTsxSObj; cdecl;
-
-
- //-----------------------------
- // Eye attributes
- //-----------------------------
-
- // Get the eye position (copied into `posn') in world coordinates
- procedure tsxAViewGetPosition(var posn: TTsxVector3f); cdecl;
-
- // Get the direction in which the view is pointed, as a normalized
- // vector relative to its position (copied into `dirn')
- procedure tsxAViewGetDirection(var dirn: TTsxVector3f); cdecl;
-
- // Get the Bank angle
- function tsxAViewGetBankAngle: Float; cdecl;
-
- // Get the Zoom
- function tsxAViewGetZoom: Float; cdecl;
-
- // Use this function to change the position and direction of the active
- // view's "eye". A NULL value for `pEyePosn' or `pLookAt' indicates no
- // change in that parameter.
- procedure tsxAViewSetView(
- pEyePosn: PTsxVector3f; //New position of eye, in world coordinates
- pLookAt: PTsxVector3f; //New point at which eye should point, in world coord
- bLevelIt: tsxBOOL //e_tsxTRUE if eye's horizontal axis should be made
- // parallel to world X, otherwise current bank angle
- // with world-X is maintained.
- ); cdecl;
-
- // Change the bank angle between the view's horizontal axis and the world X axis.
- procedure tsxAViewSetBank(bankAngle: Float); cdecl;
-
- // Change the active view's zoom (clamped to allowed min/max values).
- // Returns: the new zoom value.
- function tsxAViewSetZoom(newzoom: Float): Float; cdecl;
-
-
- //-----------------------------
- // Frame relationships
- //-----------------------------
-
- // Matrix for transforming world coordinates to viewport (screen) coordinates.
- // Returns: pTxmx.
- function tsxAViewGetWorld2VportTxmx(var pTxmx: TTsxTxmx3f): PTsxTxmx3f; cdecl;
-
- // Matrix for transforming world coordinates to view's Eye coordinates.
- // Returns: pTxmx.
- function tsxAViewGetWorld2EyeTxmx(var pTxmx: TTsxTxmx3f): PTsxTxmx3f; cdecl;
-
- // Matrix for transforming view's Eye coordinates to world coordinates
- // (inverse of the World-to-Eye matrix).
- // Returns: pTxmx.
- function tsxAViewGetEye2WorldTxmx(var pTxmx: TTsxTxmx3f): PTsxTxmx3f; cdecl;
-
- // Computes a ray pointing from the eye's viewpoint through the mouse point.
- // The ray is returned in pRayOrigin and pRayDirn, the latter giving the
- // direction as a normalized vector pointing from pRayOrigin.
- // Any of the output arguments may be NULL, if that value is not desired.
- procedure tsxAViewGetMouseRay(
- mousePtX: Short; //IN: mouse X coordinate (in screen space)
- mousePtY: Short; //IN: mouse Y coordinate
- var pRayOrigin: TTsxVector3f; //OUT: Eye location for active view
- var pRayDirn: TTsxVector3f //OUT: Normalized direction from pRayOrigin
- ); cdecl;
-
-
- //-----------------------------
- // Picking
- //-----------------------------
-
- // Pick the Root object in scene containing the object under the mouse.
- // A Root object has the scene as its parent.
- // Returns: e_tsxTRUE on successful pick.
- function tsxAViewPickRoot(
- x: Short; //Screen coordinates of mouse
- y: Short;
- var ppSobj: PTsxSOBJ //OUT: Ptr to root object containing picked object.
- ): tsxBool; cdecl;
-
- // Picking nearest one of MNode's vertices under the mouse, if any.
- // If pMNode is 0 (null) then all objects in scene are tested.
- // Returns: e_tsxTRUE on successful pick.
- function tsxAViewPickVertex(
- pMNode: PTsxMNode; //Must be a Group or Polyhedron. 0 = all objs in scene.
- x: Short; //Screen coordinates of mouse
- y: Short;
- var ppPolyh: PTsxPOLYHEDRON; //OUT: Polyhderon whose vertex picked
- var pVxIndex: Integer //OUT: Index of picked vertex in pPolyh
- ): tsxBool; cdecl;
-
- // Picks nearest one of MNode's faces under the mouse, if any.
- // If pMNode is 0 (null) then all objects in scene are tested.
- // Returns: e_tsxTRUE on successful pick.
- function tsxAViewPickFace(
- pMNode: PTsxMNode; //Must be a Group or Polyhedron. 0 = all objs in scene.
- x: Short; //Screen coordinates of mouse
- y: Short;
- var ppPolyh: PTsxPOLYHEDRON; //OUT: Polyhderon whose face picked
- var pFxIndex: Integer; //OUT: Index of picked face in pPolyh
- var pFxDist: Float //OUT: Distance to picked face
- ): tsxBool; cdecl;
-
-
- //-----------------------------
- // Miscellaneous
- //-----------------------------
-
- // Handle to the active view's window
- function tsxAViewGetHwnd: HWND; cdecl;
-
- // -----------------------------------------------------------------------------
-
- implementation
-
- function EqualVector3f(const vec1, vec2: TTsxVector3f): Boolean;
- begin
- Result := ((vec1.x = vec2.x) and (vec1.y = vec2.y) and (vec1.z = vec2.z));
- end;
-
- // Equality test on TTsxVector2f
- function EqualVector2f(const vec1, vec2: TTsxVector2f): Boolean;
- begin
- Result := ((vec1.x = vec2.x) and (vec1.y = vec2.y));
- end;
-
- function tsxSucceeded(err: tsxErr): tsxBool;
- begin
- // A function may (rare) return positive success codes ...
- Result := (err >= 0);
- end;
-
- function tsxFailed(err: tsxErr): tsxBool;
- begin
- Result := (err < 0);
- end;
-
- // Radians -> Degrees
- function tsxRad2Deg(rad: Float): Float;
- begin
- Result := rad * tsxRAD2DEG_FAC;
- end;
-
- // Degrees -> Radians
- function tsxDeg2Rad(deg: Float): Float;
- begin
- Result := deg * tsxDEG2RAD_FAC;
- end;
-
- // Externals
- const
- tsxApiDll = 'tsxapi.dll';
-
- function tsxMagnitude3f; external tsxApiDll;
- function tsxMagnitude2f; external tsxApiDll;
- function tsxNormalize3f; external tsxApiDll;
- function tsxNormalize2f; external tsxApiDll;
- function tsxGetNormalized3f; external tsxApiDll;
- function tsxGetNormalized2f; external tsxApiDll;
- function tsxAddScalar3f; external tsxApiDll;
- function tsxMulScalar3f; external tsxApiDll;
- function tsxAddVec3f; external tsxApiDll;
- function tsxSubVec3f; external tsxApiDll;
- function tsxDProdVec3f; external tsxApiDll;
- function tsxXProdVec3f; external tsxApiDll;
- function tsxAngleBtwVecs3f; external tsxApiDll;
- function tsxDistanceToPoint3f; external tsxApiDll;
- function tsxDistanceToLine3f; external tsxApiDll;
- function tsxDistanceToPlane3f; external tsxApiDll;
- function tsxXProdMx3f; external tsxApiDll;
- function tsxInvertMx3f; external tsxApiDll;
- function tsxMakeMxFromXZO3f; external tsxApiDll;
- function tsxMakeRotMx3f; external tsxApiDll;
- function tsxMakePureRotMx3f; external tsxApiDll;
- function tsxGetMxTranslation3f; external tsxApiDll;
- function tsxSetMxTranslation3f; external tsxApiDll;
- function tsxAddMxTranslation3f; external tsxApiDll;
- function tsxSubMxTranslation3f; external tsxApiDll;
- procedure tsxUnMatrix3f; external tsxApiDll;
- procedure tsxTransformVecs3f; external tsxApiDll;
- procedure tsxRotateVecs3f; external tsxApiDll;
- procedure tsxRotateAxes3f; external tsxApiDll;
- procedure tsxBBoxInit; external tsxApiDll;
- function tsxBBoxIntersection; external tsxApiDll;
- function tsxSobjGetType; external tsxApiDll;
- procedure tsxSobjDelete; external tsxApiDll;
- function tsxMaterialCreate; external tsxApiDll;
- function tsxMaterialCreateCopy; external tsxApiDll;
- function tsxMaterialCreateCopyActive; external tsxApiDll;
- procedure tsxMaterialDestroy; external tsxApiDll;
- procedure tsxMaterialSetActive; external tsxApiDll;
- function tsxMaterialGetActive; external tsxApiDll;
- procedure tsxMaterialCopyActive; external tsxApiDll;
- function tsxMaterialsAreEqual; external tsxApiDll;
- function tsxMaterialGetId; external tsxApiDll;
- function tsxMaterialGetShadingType; external tsxApiDll;
- function tsxMaterialGetFacetingType; external tsxApiDll;
- function tsxMaterialGetAutofacetAngle; external tsxApiDll;
- procedure tsxMaterialGetColor; external tsxApiDll;
- procedure tsxMaterialGetSurfaceProps; external tsxApiDll;
- function tsxMaterialGetIor; external tsxApiDll;
- function tsxMaterialGetTextureType; external tsxApiDll;
- procedure tsxMaterialGetProcTexture; external tsxApiDll;
- procedure tsxMaterialGetTextureFilename; external tsxApiDll;
- procedure tsxMaterialGetTextureProps; external tsxApiDll;
- procedure tsxMaterialGetBumpFilename; external tsxApiDll;
- procedure tsxMaterialGetBumpProps; external tsxApiDll;
- function tsxMaterialGetEnvrFlags; external tsxApiDll;
- procedure tsxMaterialSetShadingType; external tsxApiDll;
- procedure tsxMaterialSetFacetingType; external tsxApiDll;
- procedure tsxMaterialSetAutofacetAngle; external tsxApiDll;
- procedure tsxMaterialSetColor; external tsxApiDll;
- procedure tsxMaterialSetSurfaceProps; external tsxApiDll;
- procedure tsxMaterialSetIor; external tsxApiDll;
- procedure tsxMaterialSetTextureType; external tsxApiDll;
- procedure tsxMaterialSetProcTexture; external tsxApiDll;
- procedure tsxMaterialSetTextureFilename; external tsxApiDll;
- procedure tsxMaterialSetTextureProps; external tsxApiDll;
- procedure tsxMaterialSetBumpFilename; external tsxApiDll;
- procedure tsxMaterialSetBumpProps; external tsxApiDll;
- procedure tsxMaterialSetEnvrFlags; external tsxApiDll;
- function tsxGetScene; external tsxApiDll;
- procedure tsxSceneAddObject; external tsxApiDll;
- function tsxSceneGetFirstNode; external tsxApiDll;
- function tsxSceneIsFogOn; external tsxApiDll;
- procedure tsxSceneSwitchFog; external tsxApiDll;
- procedure tsxSceneGetFogParms; external tsxApiDll;
- procedure tsxSceneSetFogParms; external tsxApiDll;
- procedure tsxSceneDraw; external tsxApiDll;
- function tsxIsGNode; external tsxApiDll;
- function tsxGNodeCopy; external tsxApiDll;
- function tsxGNodeGetRoot; external tsxApiDll;
- function tsxGNodeGetParent; external tsxApiDll;
- function tsxIsGNodeInScene; external tsxApiDll;
- function tsxGNodeGetFirstChild; external tsxApiDll;
- function tsxGNodeGetNext; external tsxApiDll;
- function tsxGNodeGetPrev; external tsxApiDll;
- function tsxIsGNodeSubobj; external tsxApiDll;
- procedure tsxGNodeDraw; external tsxApiDll;
- function tsxGNodeGetName; external tsxApiDll;
- function tsxGNodeSetName; external tsxApiDll;
- function tsxGNodeGetAxesPosition; external tsxApiDll;
- function tsxGNodeGetAxesOrientation; external tsxApiDll;
- function tsxGNodeGetBBox; external tsxApiDll;
- function tsxGNodeGetPureTransform; external tsxApiDll;
- procedure tsxGNodeTranslate; external tsxApiDll;
- procedure tsxGNodeRotate; external tsxApiDll;
- procedure tsxGNodeScale; external tsxApiDll;
- procedure tsxGNodeScaleUniform; external tsxApiDll;
- function tsxCameraCreateInScene; external tsxApiDll;
- function tsxLightCreateInScene; external tsxApiDll;
- function tsxLightGetType; external tsxApiDll;
- procedure tsxLightGetColor; external tsxApiDll;
- procedure tsxLightSetColor; external tsxApiDll;
- function tsxLightGetIntensity; external tsxApiDll;
- function tsxLightSetIntensity; external tsxApiDll;
- function tsxLightGetFalloff; external tsxApiDll;
- function tsxLightSetFalloff; external tsxApiDll;
- function tsxLightGetShadType; external tsxApiDll;
- function tsxLightSetShadType; external tsxApiDll;
- function tsxLightIsShadImgDep; external tsxApiDll;
- function tsxLightSetShadImgDep; external tsxApiDll;
- function tsxLightGetShmapSize; external tsxApiDll;
- function tsxLightSetShmapSize; external tsxApiDll;
- function tsxLightGetShmapSharpness; external tsxApiDll;
- function tsxLightSetShmapSharpness; external tsxApiDll;
- function tsxLightGetSpotAngle; external tsxApiDll;
- function tsxLightSetSpotAngle; external tsxApiDll;
- function tsxLightGetSpotRatio; external tsxApiDll;
- function tsxLightSetSpotRatio; external tsxApiDll;
- function tsxIsMNode; external tsxApiDll;
- function tsxMNodeIsVisible; external tsxApiDll;
- procedure tsxMNodeSetVisible; external tsxApiDll;
- procedure tsxMNodeSetInvisible; external tsxApiDll;
- function tsxMNodeAreAxesVisible; external tsxApiDll;
- procedure tsxCurrobjToggleAxes; external tsxApiDll;
- procedure tsxMNodeSetAxesPosition; external tsxApiDll;
- procedure tsxMNodeSetAxesOrientation; external tsxApiDll;
- function tsxGroupNewWithCurrobj; external tsxApiDll;
- function tsxGroupAtCurrobj; external tsxApiDll;
- function tsxGroupRemoveCurrobj; external tsxApiDll;
- function tsxPolyhCreate; external tsxApiDll;
- procedure tsxPolyhClear; external tsxApiDll;
- function tsxPolyhTessellate; external tsxApiDll;
- procedure tsxPolyhMarkGeomChange; external tsxApiDll;
- procedure tsxPolyhMarkTopologyChange; external tsxApiDll;
- procedure tsxPolyhMarkMaterialChange; external tsxApiDll;
- function tsxPolyhGetNbrVxs; external tsxApiDll;
- function tsxPolyhGetVxArray; external tsxApiDll;
- function tsxPolyhGetVxTxmx; external tsxApiDll;
- procedure tsxPolyhSetVxs; external tsxApiDll;
- procedure tsxPolyhSetVxTxmx; external tsxApiDll;
- function tsxFaceAlloc; external tsxApiDll;
- procedure tsxFaceDelete; external tsxApiDll;
- function tsxFaceCopy; external tsxApiDll;
- function tsxPolyhGetNbrFaces; external tsxApiDll;
- function tsxPolyhGetFaceptrArray; external tsxApiDll;
- procedure tsxPolyhSetFaces; external tsxApiDll;
- procedure tsxPolyhGetFaceNormal; external tsxApiDll;
- function tsxPolyhComputeFaceAdjacency; external tsxApiDll;
- function tsxPolyhGetNbrUV; external tsxApiDll;
- function tsxPolyhGetUVArray; external tsxApiDll;
- procedure tsxPolyhSetUVArray; external tsxApiDll;
- function tsxPolyhInitializeMaterials; external tsxApiDll;
- procedure tsxPolyhPaint; external tsxApiDll;
- function tsxPolyhPaintFace; external tsxApiDll;
- function tsxPolyhPaintVertex; external tsxApiDll;
- function tsxPolyhGetMaterial; external tsxApiDll;
- function tsxPolyhPhrenderFace; external tsxApiDll;
- function tsxCreateSphere; external tsxApiDll;
- function tsxCreateCylinder; external tsxApiDll;
- function tsxCreateCone; external tsxApiDll;
- function tsxCreateCube; external tsxApiDll;
- function tsxCreateTorus; external tsxApiDll;
- function tsxCreatePlane; external tsxApiDll;
- function tsxIsSelectable; external tsxApiDll;
- function tsxIsSelected; external tsxApiDll;
- function tsxGetCurrentSelection; external tsxApiDll;
- procedure tsxSelectSobj; external tsxApiDll;
- procedure tsxSelectDown; external tsxApiDll;
- procedure tsxSelectUp; external tsxApiDll;
- procedure tsxSelectNext; external tsxApiDll;
- procedure tsxSelectPrev; external tsxApiDll;
- function tsxSelectionChangedCB; external tsxApiDll;
- procedure tsxCurrobjReplace; external tsxApiDll;
- function tsxCurrobjCopy; external tsxApiDll;
- procedure tsxCurrobjDraw; external tsxApiDll;
- procedure tsxCurrobjPhrender; external tsxApiDll;
- function tsxGNodeCreateScript; external tsxApiDll;
- function tsxGNodeCreateScriptTree; external tsxApiDll;
- function tsxGNodeDeleteScript; external tsxApiDll;
- function tsxGNodeDeleteScriptTree; external tsxApiDll;
- function tsxGNodeCopyScript; external tsxApiDll;
- function tsxGNodeSetFrame; external tsxApiDll;
- function tsxGNodeUnsetFrame; external tsxApiDll;
- procedure tsxAnimSetActiveFrame; external tsxApiDll;
- procedure tsxGetTsVersionNbrs; external tsxApiDll;
- function tsxGetMainViewHwnd: HWND; external tsxApiDll;
- function tsxForceLeftClick; external tsxApiDll;
- function tsxMalloc; external tsxApiDll;
- function tsxCalloc; external tsxApiDll;
- function tsxRealloc; external tsxApiDll;
- procedure tsxFree; external tsxApiDll;
- function tsxMtoolInstall; external tsxApiDll;
- procedure tsxMtoolRemove; external tsxApiDll;
- procedure tsxAViewRefresh; external tsxApiDll;
- function tsxAViewGetRenderMode; external tsxApiDll;
- function tsxAViewGetViewMode; external tsxApiDll;
- function tsxAViewSetViewMode; external tsxApiDll;
- function tsxAViewSetCameraMode; external tsxApiDll;
- procedure tsxAViewUnsetCameraMode; external tsxApiDll;
- function tsxAViewGetCameraObj; external tsxApiDll;
- procedure tsxAViewGetPosition; external tsxApiDll;
- procedure tsxAViewGetDirection; external tsxApiDll;
- function tsxAViewGetBankAngle; external tsxApiDll;
- function tsxAViewGetZoom; external tsxApiDll;
- procedure tsxAViewSetView; external tsxApiDll;
- procedure tsxAViewSetBank; external tsxApiDll;
- function tsxAViewSetZoom; external tsxApiDll;
- function tsxAViewGetWorld2VportTxmx; external tsxApiDll;
- function tsxAViewGetWorld2EyeTxmx; external tsxApiDll;
- function tsxAViewGetEye2WorldTxmx; external tsxApiDll;
- procedure tsxAViewGetMouseRay; external tsxApiDll;
- function tsxAViewPickRoot; external tsxApiDll;
- function tsxAViewPickVertex; external tsxApiDll;
- function tsxAViewPickFace; external tsxApiDll;
- function tsxAViewGetHwnd; external tsxApiDll;
-
- end.
-
-