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 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 GetCoordinates ( ) : TPoint3DDynArray ; virtual;
- protected procedure SetCoordinates ( const AValue : TPoint3DDynArray ) ; virtual;
- protected function GetVertices ( ) : TVertexDataMap ; virtual;
- protected procedure SetVertices ( const AValue : TVertexDataMap ) ; virtual;
- protected function GetModel ( ) : TGorillaControl ; virtual;
- protected function GetMeshData ( ) : TMeshData ; virtual;
- protected function GetMaterialSource ( ) : TMaterialSource ; virtual;
- protected procedure SetMaterialSource ( AValue : TMaterialSource ) ; virtual;
- protected procedure Loaded ( ) ; override;
- protected procedure Render ( ) ; override;
- protected procedure RenderChildren
(
)
;
override;
Initializing the rendering process... If a CurrentCache was assigned the FData (TMeshData) buffers are empty and rendering should use the applied cache within TCustomContextOpenGL.DoDrawPrimitivesBatch(). instead of the VertexBuffer/IndexBuffer of FData.
- 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 DoRayCastIntersect ( const ARayPos : TPoint3D; const ARayDir : TPoint3D; var AIntersection : TPoint3D ) : Boolean ; override;
- 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 SetTwoSide
(
const
AValue :
Boolean
)
;
virtual;
(Un)Sets all submeshes to two side rendering
- public procedure SetOpacity
(
const
AValue :
Single
)
;
virtual;
Set opacity value for all submeshes.
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>
- 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>