Gorilla.Mesh
Unit Gorilla.Mesh.pasClasses
- TGorillaMesh = class ( TGorillaControl )
- TGorillaVertexGroup = class ( TGorillaMesh )
Mics. types
- type TGorillaMeshClass = class of TGorillaMesh;
TGorillaMesh
Default Gorilla3D mesh control.
Remarks
This component can be used as standalone and child component of TGorillaModel. Each mesh inside of a model will be an instance of TGorillaMesh.Ancestors
Members
Fields
- protected FModel :
TGorillaControl
- protected FData :
TMeshData
- protected FInstances :
TList<System.Math.Vectors.TMatrix3D>
- protected FWrapMode :
TMeshWrapMode
- protected FMaterialSource :
TMaterialSource
- protected FReferencedName :
string
- protected FVertexJoints :
TVertexJointsList
- protected FMeshes :
TGorillaMeshList
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected procedure SetHeight ( const Value : Single ) ; override;
- protected procedure SetWidth ( const Value : Single ) ; override;
- protected procedure SetDepth ( const Value : Single ) ; override;
- protected procedure SetWrapMode ( const AValue : TMeshWrapMode ) ; virtual;
- protected function GetIsStatic ( ) : Boolean ; virtual;
- protected procedure SetIsStatic ( const AValue : Boolean ) ; virtual;
- protected function GetCoordinates ( ) : TPoint3DDynArray ; virtual;
- protected procedure SetCoordinates ( const AValue : TPoint3DDynArray ) ; virtual;
- protected function GetVertices ( ) : TVertexDataMap ; virtual;
- protected procedure SetVertices ( const AValue : TVertexDataMap ) ; virtual;
- protected procedure SetFrustumCullingCheck ( const AValue : Boolean ) ; override;
- protected function GetModel ( ) : TGorillaControl ; virtual;
- protected function GetMeshData ( ) : TMeshData ; virtual;
- protected function GetMaterialSource ( ) : TMaterialSource ; virtual;
- protected procedure SetMaterialSource ( AValue : TMaterialSource ) ; virtual;
- protected function GetInstance ( AIndex : Integer ) : TMatrix3D ;
- protected procedure SetInstance ( AIndex : Integer; const AValue : TMatrix3D ) ;
- protected procedure Loaded ( ) ; override;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- protected procedure DoDuplicate
(
ASource :
TComponent; ADuplicator :
TGorillaDuplicator
)
;
override;
Duplicates a TGorillaMesh/TGorillaModel and all of its submeshes. The method copies the complete memory structure and refreshes necessary lists and standalone components
- protected procedure Render ( ) ; override;
- protected procedure RenderChildren
(
)
;
override;
Initializing the rendering process... If a CurrentCache was assigned the MeshData (TMeshData) buffers are empty and rendering should use the applied cache within TCustomContextOpenGL.DoDrawPrimitivesBatch(). instead of the VertexBuffer/IndexBuffer of MeshData.
- protected procedure BuildTriangleMesh ( ) ;
- protected procedure ComputeTangentsAndBinormals ( ) ;
- protected procedure DoOnRenderControls ( ASender : TObject; AContext : TContext3D ) ; virtual;
- protected procedure DoAddObject ( const AObject : TFmxObject ) ; override;
- protected procedure DoRemoveObject ( const AObject : TFmxObject ) ; override;
- protected procedure DoInsertObject ( Index : Integer; const AObject : TFmxObject ) ; override;
- protected procedure AddToParentMesh ( ) ; virtual;
- protected procedure RemoveFromParentMesh ( ) ; virtual;
- protected procedure DoOnVertexJointsListValueNotify ( ASender : TObject; const AItem : TVertexJoints; AAction : TCollectionNotification ) ;
- protected function DoInternalRayCastIntersect ( const ARayPos : TPoint3D; const ARayDir : TPoint3D; var AIntersection : TPoint3D; var ANormal : TPoint3D ) : Boolean ;
- protected function DoRayCastIntersect ( const ARayPos : TPoint3D; const ARayDir : TPoint3D; var AIntersection : TPoint3D ) : Boolean ; override;
- protected procedure DoApplyToMeshData ( ADef : TMeshDef; AData : TMeshData ) ; virtual;
- public procedure GenerateVertexJoints
(
const
AController :
TControllerDef; const
ABindShapeMatrix :
TMatrix3D
)
;
virtual;
Generates a vertex joints list, if it do not exist yet.
- public function VertexJointsExist
(
)
: Boolean
;
virtual;
Checks if the vertex joints list already exists.
- public procedure ClearVertexJoints
(
)
;
virtual;
Clears and destroys an existing vertex joint list.
- public procedure LoadFromDefinition
(
const
ADef :
TMeshDef
)
;
virtual;
Loads mesh information with materials, textures and animations from a mesh definition.
- public function GetMeshMatrix
(
)
: TMatrix3D
;
virtual;
Computes and returns the matrix (translation and scaling), built from bounding box computation of this mesh.
- public function GetBoundingBox
(
)
: TBoundingBox
;
override;
Returns the current bounding box depending on the vertices data of all contained sub meshes.
- public function GetUnwrappedBoundingBox
(
)
: TBoundingBox
;
virtual;
Returns the current bounding box without MeshMatrix computation. This will only compound vertex data to a bounding box information.
- public function RayCastIntersect
(
const
ARayPos :
TPoint3D; const
ARayDir :
TPoint3D; var
AIntersection :
TPoint3D; var
ANormal :
TPoint3D
)
: Boolean
;
virtual;
Perform a ray cast on this mesh.
- public procedure ApplyMaterialSource
(
ASource :
TMaterialSource
)
;
For easily changing materials for the complete mesh hierarchy call ApplyMaterialSource. This procedure will apply the submitted source to the mesh and all its child meshes.
- public function AddInstance ( ATransform : TMatrix3D ) : Integer ;
- public function DeleteInstance ( AIndex : Integer; ATransform : TMatrix3D ) : Boolean ;
- public procedure SetTwoSide
(
const
AValue :
Boolean
)
;
virtual;
(Un)Sets all submeshes to two side rendering
- public procedure SetOpacityValue
(
const
AValue :
Single
)
;
virtual;
Set opacity value for this mesh/model and all its submeshes.
- public procedure SetVisibility
(
const
AValue :
Boolean
)
;
virtual;
Set visible value for this mesh/model and all its submeshes.
- public procedure SetHitTestValue
(
const
AValue :
Boolean
)
;
virtual;
Set hittest value for this mesh/model and all its submeshes.
- public procedure ComputeAllNormalsAndTangents ( ) ;
Properties
- public Model : TGorillaControl
- public ReferencedName : string
Defines a reference name for identifying a mesh explicitly.
read FReferencedName
write FReferencedName - public MeshData : TMeshData
- public VertexJoints : TVertexJointsList
- public Meshes : TObjectList<Gorilla.Mesh.TGorillaMesh>
- public IsStatic : Boolean
Activates a buffer for static rendering with buffers inside of GPU.
read GetIsStatic
write SetIsStatic - public Instance[Index] : TMatrix3D
- published WrapMode : TMeshWrapMode
- published MaterialSource : TMaterialSource
Get or set the used material source for rendering this mesh instance.
read GetMaterialSource
write SetMaterialSource - published Coordinates : TArray<System.Math.Vectors.TPoint3D>
- published Vertices : TDictionary<System.Word,Gorilla.DefTypes.TVertexData>