Gorilla.GLTF.Model
Unit Gorilla.GLTF.Model.pasClasses
- TGLTFMesh = class ( TMeshDef )
- TGLTFSkin = class ( TSkinDef )
- TGLTFJoint = class ( TJointDef )
- TGLTFJointRef = class ( TJointRefDef )
- TGLTFCache = class ( TVertexCache )
- TGLTFBufferList = class ( {System.Generics.Collections}TList<Gorilla.GLTF.Model.PGLTFBuffer> )
- TGLTFBufferViewList = class ( {System.Generics.Collections}TList<Gorilla.GLTF.Model.PGLTFBufferView> )
- TGLTFAccessorList = class ( {System.Generics.Collections}TList<Gorilla.GLTF.Model.PGLTFAccessor> )
- TGLTFNode = class ( TObject )
- TGLTFSceneNode = class ( TGLTFNode )
- TGLTFTransformNode = class ( TGLTFNode )
- TGLTFMeshNode = class ( TGLTFTransformNode )
- TGLTFSkinMeshNode = class ( TGLTFMeshNode )
- TGLTFJointNode = class ( TGLTFTransformNode )
- TGLTFCameraNode = class ( TGLTFTransformNode )
- TGLTFModel = class ( TModelDef )
Records
- record TVector4I
- record TVector4US
- record TGLTFValue
- record TGLTFBuffer
- record TGLTFBufferView
- record TGLTFAccessor
- record TGLTFDataTypeHelper
- record TGLTFComponentTypeHelper
Enumerations
- enum TGLTFDataType = ( dtUndefined, dtScalar, dtVec2, dtVec3, dtVec4, dtMat2, dtMat3, dtMat4 ) ;
- enum TGLTFComponentType = ( ctUnknown, ctByte, ctUByte, ctShort, ctUShort, ctUInt, ctFloat ) ;
Constants
- const GLTF_COMPONENT_BYTE : Integer = $1400;
- const GLTF_COMPONENT_UBYTE : Integer = $1401;
- const GLTF_COMPONENT_SHORT : Integer = $1402;
- const GLTF_COMPONENT_USHORT : Integer = $1403;
- const GLTF_COMPONENT_UINT : Integer = $1405;
- const GLTF_COMPONENT_FLOAT : Integer = $1406;
- const GLTF_PRIMITVE_MODE_POINTS : Integer = $0;
- const GLTF_PRIMITVE_MODE_LINES : Integer = $1;
- const GLTF_PRIMITVE_MODE_LINE_LOOP : Integer = $2;
- const GLTF_PRIMITVE_MODE_LINE_STRIP : Integer = $3;
- const GLTF_PRIMITVE_MODE_TRIANGLES : Integer = $4;
- const GLTF_PRIMITVE_MODE_TRIANGLE_STRIP : Integer = $5;
- const GLTF_PRIMITVE_MODE_TRIANGLE_FAN : Integer = $6;
- const GLTF_ATTRIBUTE_POSITION : string = "POSITION";
- const GLTF_ATTRIBUTE_NORMAL : string = "NORMAL";
- const GLTF_ATTRIBUTE_TANGENT : string = "TANGENT";
- const GLTF_ATTRIBUTE_TEXCOORD_X : string = "TEXCOORD_%%d";
- const GLTF_ATTRIBUTE_TEXCOORD_0 : string = "TEXCOORD_0";
- const GLTF_ATTRIBUTE_TEXCOORD_1 : string = "TEXCOORD_1";
- const GLTF_ATTRIBUTE_TEXCOORD_2 : string = "TEXCOORD_2";
- const GLTF_ATTRIBUTE_TEXCOORD_3 : string = "TEXCOORD_3";
- const GLTF_ATTRIBUTE_COLOR_X : string = "COLOR_%%d";
- const GLTF_ATTRIBUTE_COLOR_0 : string = "COLOR_0";
- const GLTF_ATTRIBUTE_COLOR_1 : string = "COLOR_1";
- const GLTF_ATTRIBUTE_COLOR_2 : string = "COLOR_2";
- const GLTF_ATTRIBUTE_COLOR_3 : string = "COLOR_3";
- const GLTF_ATTRIBUTE_JOINTS_X : string = "JOINTS_%%d";
- const GLTF_ATTRIBUTE_JOINTS_0 : string = "JOINTS_0";
- const GLTF_ATTRIBUTE_WEIGHTS_X : string = "WEIGHTS_%%d";
- const GLTF_ATTRIBUTE_WEIGHTS_0 : string = "WEIGHTS_0";
- const GLTF_TARGET_ARRAY_BUFFER : Integer = $8892;
- const GLTF_TARGET_ELEMENT_ARRAY_BUFFER : Integer = $8893;
- const GLTF_COMPONENT_COUNT : array[0..7] of Byte = ;
- const GLTF_COMPONENT_SIZE : array[0..6] of Byte = ;
Mics. types
- type PVector4I = pointer to TVector4I;
- type PVector4US = pointer to TVector4US;
- type PGLTFBuffer = pointer to TGLTFBuffer;
- type PGLTFBufferView = pointer to TGLTFBufferView;
- type PGLTFAccessor = pointer to TGLTFAccessor;
TGLTFAccessor
Fields
- public BufferView :
PGLTFBufferView
- public ByteOffset :
Integer
- public _Type :
TGLTFDataType
- public Component :
TGLTFComponentType
- public Count :
Integer
- public Min :
TValue
- public Max :
TValue
Methods
- public function Create ( ) : PGLTFAccessor ; static;
- public procedure Free ( ) ;
- public function GetBufferStream ( ) : TStream ;
- public function GetDataSize ( ) : Integer ;
- public function GetDataSizeWithStride ( ) : Integer ;
- public function AsTypeArray ( const AProc : TGLTFDataValueProc ) : TArray<Gorilla.GLTF.Model.TGLTFAccessor.AsTypeArray.T> ;
- public function AsByteArray ( ) : TArray<System.Byte> ;
- public function AsUByteArray ( ) : TArray<System.Byte> ;
- public function AsShortArray ( ) : TArray<System.SmallInt> ;
- public function AsUShortArray ( ) : TArray<System.Word> ;
- public function AsUIntArray ( ) : TArray<System.Cardinal> ;
- public function AsFloatArray ( ) : TArray<System.Single> ;
- public function AsVec2IArray ( ) : TArray<System.Types.TPoint> ;
- public function AsVec2FArray ( ) : TArray<System.Types.TPointF> ;
- public function AsVec3FArray ( ) : TArray<System.Math.Vectors.TPoint3D> ;
- public function AsVec4FArray ( ) : TArray<System.Math.Vectors.TVector3D> ;
- public function AsVec4IArray ( ) : TArray<Gorilla.GLTF.Model.TVector4I> ;
- public function AsVec4USArray ( ) : TArray<Gorilla.GLTF.Model.TVector4US> ;
- public function AsQ3DFArray ( ) : TArray<System.Math.Vectors.TQuaternion3D> ;
- public function AsAlphaColorFArray ( ) : TArray<System.UITypes.TAlphaColorF> ;
- public function AsMatrixArray ( ) : TArray<System.Math.Vectors.TMatrix> ;
- public function AsMatrix3DArray ( ) : TArray<System.Math.Vectors.TMatrix3D> ;
TGLTFMesh
Ancestors
Members
Fields
- protected FGlobalTransform :
TMatrix3D
- protected FJoints :
TList<System.TArray<Gorilla.GLTF.Model.TVector4US>>
- protected FWeights :
TList<System.TArray<System.Math.Vectors.TVector3D>>
Methods
- public constructor Create ( const AOwner : TMeshDef ) ;
- public destructor Destroy ( ) ;
- public procedure AddJointsSource ( AIndex : Integer; const AData : TArray<Gorilla.GLTF.Model.TVector4US> ) ;
- public procedure AddWeightsSource ( AIndex : Integer; const AData : TArray<System.Math.Vectors.TVector3D> ) ;
Properties
TGLTFSkin
Ancestors
Members
TGLTFJoint
Ancestors
Members
TGLTFCache
Ancestors
Members
Fields
- protected FCurrentHumanoid :
THumanoidDef
- protected FCurrentSkin :
TSkinDef
- protected FCurrentJoint :
TGLTFJoint
Methods
- public constructor Create ( ) ;
- public destructor Destroy ( ) ;
- public function DoOnCreateDefaultMaterial ( AMesh : TMeshDef ) : TMaterialDef ; override;
- public function DoOnCreateMaterialRef ( AMesh : TMeshDef; AMaterial : TMaterialDef ) : TMaterialRefDef ; override;
- public procedure ClearAll ( ) ; override;
- public procedure AddTriangles ( const AIndices : TArray<System.Word> ) ; overload;
- public procedure AddTriangles ( const AIndices : TArray<System.Cardinal> ) ; overload;
TGLTFBufferViewList
TGLTFAccessorList
TGLTFNode
Ancestors
Members
Fields
- protected FIndex :
Integer
- protected FName :
string
- protected FRef :
TJSONObject
- protected FParent :
TGLTFNode
- protected FNodes :
TObjectList<Gorilla.GLTF.Model.TGLTFNode>
Methods
- public constructor Create ( AParent : TGLTFNode ) ;
- public destructor Destroy ( ) ;
- protected function ArrayToMatrix3D ( const AArray : TJSONArray ) : TMatrix3D ; class;
- protected function ArrayToPoint3D ( const AArray : TJSONArray ) : TPoint3D ; class;
- protected function ArrayToQuaternion3D ( const AArray : TJSONArray ) : TQuaternion3D ; class;
- public function CreateFromJSON ( AModel : TGLTFModel; AIndex : Integer; AParent : TGLTFNode; ANode : TJSONObject; ANodes : TJSONArray ) : TGLTFNode ; class;
- public procedure AddNode ( ANode : TGLTFNode ) ;
- public procedure ToMesh ( ACache : TGLTFCache; AParent : TMeshDef ) ; virtual;
- public procedure ToJoint ( ACache : TGLTFCache; AParent : TJointDef ) ; virtual;
- public procedure DoPostLinking ( ACache : TGLTFCache; AParent : TMeshDef ) ; virtual;
- public procedure Traverse ( const ATransform : TMatrix3D ) ; virtual;
- public function GetGlobalTransformation ( ) : TMatrix3D ; virtual;
- public function GetTransformationMatrix ( ) : TMatrix3D ; virtual;
- public function ToString ( ) : string ; override;
Properties
TGLTFTransformNode
Ancestors
Members
Fields
- protected FGlobalTransform :
TMatrix3D
- protected FMatrix :
TMatrix3D
- protected FTranslation :
TPoint3D
- protected FRotation :
TQuaternion3D
- protected FScale :
TPoint3D
- protected FIsSeparated :
Boolean
Methods
- public constructor Create ( AParent : TGLTFNode ) ;
- public procedure Traverse ( const ATransform : TMatrix3D ) ; override;
- public function GetGlobalTransformation ( ) : TMatrix3D ; override;
- public function GetTransformationMatrix ( ) : TMatrix3D ; override;
- public function ToString ( ) : string ; override;
Properties
TGLTFMeshNode
Ancestors
Members
Fields
Methods
- protected procedure BuildPrimitive ( ACache : TGLTFCache; AParent : TMeshDef; ANode : TJSONObject; AMultiplePrimitives : Boolean ) ;
- protected procedure BuildPrimitives ( ACache : TGLTFCache; AParent : TMeshDef; ANode : TJSONObject ) ;
- public procedure ToMesh ( ACache : TGLTFCache; AParent : TMeshDef ) ; override;
Properties
TGLTFSkinMeshNode
Ancestors
Members
TGLTFJointNode
Ancestors
Members
Fields
Methods
- public procedure ToMesh
(
ACache :
TGLTFCache; AParent :
TMeshDef
)
;
override;
We have to create a pseudo mesh for building a representation of the node-tree of gltf.
- public procedure ToJoint ( ACache : TGLTFCache; AParent : TJointDef ) ; override;
- public procedure DoPostLinking ( ACache : TGLTFCache; AParent : TMeshDef ) ; override;
TGLTFCameraNode
Ancestors
Members
Fields
Properties
TGLTFModel
Ancestors
Members
Fields
- protected FJSON :
TJSONObject
- protected FEmptyMaterial :
TMaterialDef
- protected FBuffers :
TGLTFBufferList
- protected FViews :
TGLTFBufferViewList
- protected FAccessors :
TGLTFAccessorList
- protected FImages :
TObjectList<Gorilla.DefTypes.TImageDef>
- protected FSamplers :
TObjectList<Gorilla.DefTypes.TSamplerDef>
- protected FTextures :
TList<Gorilla.DefTypes.TTextureDef>
- protected FOrderedMaterials :
TObjectList<Gorilla.DefTypes.TMaterialDef>
- protected FScene :
TGLTFSceneNode
- protected FNodes :
TArray<Gorilla.GLTF.Model.TGLTFNode>
- protected FOrderedMeshes :
TArray<Gorilla.DefTypes.TMeshDef>
Methods
- public constructor Create ( const AOwner : TMeshDef; const APackage : TObject ) ;
- public destructor Destroy ( ) ;
- protected function DoGetAsset ( ) : TJSONObject ;
- protected function DoGetScene ( ) : TJSONObject ;
- protected function DoGetScenes ( ) : TJSONArray ;
- protected function DoGetNodes ( ) : TJSONArray ;
- protected function DoGetMesh ( const AIdx : Integer ) : TJSONObject ;
- protected function DoGetMeshes ( ) : TJSONArray ;
- protected function DoGetAccessors ( ) : TJSONArray ;
- protected function DoGetBufferViews ( ) : TJSONArray ;
- protected function DoGetBuffers ( ) : TJSONArray ;
- protected function DoGetMaterials ( ) : TJSONArray ;
- protected function DoGetSkins ( ) : TJSONArray ;
- protected function DoGetAnimations ( ) : TJSONArray ;
- protected function DoGetTextures ( ) : TJSONArray ;
- protected function DoGetImages ( ) : TJSONArray ;
- protected function DoGetSamplers ( ) : TJSONArray ;
- protected function GetOrderedMaterial ( AIndex : Integer ) : TMaterialDef ;
- protected procedure DoRead ( ACache : TGLTFCache; AObj : TJSONObject ) ;
- protected function DoPreloadImage ( const AImg : TJSONObject ) : TImageDef ;
- protected procedure DoPreloadImages ( ) ;
- protected procedure DoPreloadBuffer ( ABuf : TJSONObject ) ;
- protected procedure DoPreloadBuffers ( ) ;
- protected procedure DoPreloadBufferView ( AView : TJSONObject ) ;
- protected procedure DoPreloadBufferViews ( ) ;
- protected procedure DoPreloadAccessor ( AAcc : TJSONObject ) ;
- protected procedure DoPreloadAccessors ( ) ;
- protected function DoPreloadSampler ( ASampler : TJSONObject ) : TSamplerDef ;
- protected procedure DoPreloadSamplers ( ) ;
- protected function DoPreloadTexture ( ATex : TJSONObject ) : TTextureDef ;
- protected procedure DoPreloadTextures ( ) ;
- protected function DoPreloadMaterial ( AMat : TJSONObject ) : TMaterialDef ;
- protected procedure DoPreloadMaterials ( ) ;
- protected function DoPreloadSkin ( ANumIdx : Integer; ASkin : TJSONObject ) : THumanoidDef ;
- protected procedure DoPreloadSkins ( ) ;
- protected function DoPreloadAnimation ( AAnim : TJSONObject ) : TAnimationDef ;
- protected procedure DoPreloadAnimations ( ) ;
- protected procedure DoLoadScene ( AScene : TJSONObject ) ;
- protected procedure DoLoadMeshHierarchy ( ACache : TGLTFCache; AParent : TMeshDef; ANode : TGLTFNode ) ;
- protected procedure DoLoadHumanoidJoints ( ACache : TGLTFCache; AParent : TMeshDef; ANode : TGLTFNode ) ;
- protected procedure DoPostLinking ( ACache : TGLTFCache; AParent : TMeshDef; ANode : TGLTFNode ) ;
- public procedure LoadFromFile ( const AFileName : string ) ; virtual;
- public procedure LoadFromStream ( const AStream : TStream; const APath : string ) ; virtual;